electrobun 0.0.18 → 0.0.19-beta.100
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.
- package/BETA_RELEASE.md +67 -0
- package/BUILD.md +90 -0
- package/README.md +48 -21
- package/bin/electrobun.cjs +165 -0
- package/debug.js +5 -0
- package/dist/api/browser/builtinrpcSchema.ts +9 -0
- package/dist/api/browser/index.ts +89 -154
- package/dist/api/browser/rpc/webview.ts +79 -0
- package/dist/api/browser/webviewtag.ts +64 -180
- package/dist/api/bun/core/ApplicationMenu.ts +2 -2
- package/dist/api/bun/core/BrowserView.ts +71 -139
- package/dist/api/bun/core/BrowserWindow.ts +40 -27
- package/dist/api/bun/core/ContextMenu.ts +2 -2
- package/dist/api/bun/core/Tray.ts +7 -5
- package/dist/api/bun/core/Updater.ts +336 -44
- package/dist/api/bun/core/Utils.ts +5 -5
- package/dist/api/bun/events/eventEmitter.ts +1 -1
- package/dist/api/bun/events/webviewEvents.ts +1 -4
- package/dist/api/bun/proc/linux.md +43 -0
- package/dist/api/bun/proc/native.ts +1220 -0
- package/dist/api/shared/platform.ts +48 -0
- package/dist/main.js +53 -0
- package/package.json +30 -28
- package/src/cli/bun.lockb +0 -0
- package/src/cli/index.ts +2404 -0
- package/src/cli/package-lock.json +93 -0
- package/src/cli/package.json +14 -0
- package/templates/hello-world/README.md +57 -0
- package/templates/hello-world/bun.lock +63 -0
- package/templates/hello-world/electrobun.config +18 -0
- package/templates/hello-world/package.json +16 -0
- package/templates/hello-world/src/bun/index.ts +15 -0
- package/templates/hello-world/src/mainview/index.css +124 -0
- package/templates/hello-world/src/mainview/index.html +47 -0
- package/templates/hello-world/src/mainview/index.ts +5 -0
- package/test-npm-install.sh +34 -0
- package/dist/api/bun/proc/zig.ts +0 -622
- package/dist/bsdiff +0 -0
- package/dist/bspatch +0 -0
- package/dist/bun +0 -0
- package/dist/electrobun +0 -0
- package/dist/extractor +0 -0
- package/dist/launcher +0 -0
- package/dist/webview +0 -0
- /package/dist/api/bun/events/{applicationEvents.ts → ApplicationEvents.ts} +0 -0
package/BETA_RELEASE.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Electrobun Beta Releases
|
|
2
|
+
|
|
3
|
+
## For Users
|
|
4
|
+
|
|
5
|
+
### Installing Beta Versions
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install latest beta
|
|
9
|
+
npm install electrobun@beta
|
|
10
|
+
|
|
11
|
+
# Install specific beta version
|
|
12
|
+
npm install electrobun@0.0.19-beta.1
|
|
13
|
+
|
|
14
|
+
# View available versions
|
|
15
|
+
npm view electrobun versions --json
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Switching Between Stable and Beta
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Switch to stable
|
|
22
|
+
npm install electrobun@latest
|
|
23
|
+
|
|
24
|
+
# Switch to beta
|
|
25
|
+
npm install electrobun@beta
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## For Maintainers
|
|
29
|
+
|
|
30
|
+
### Publishing Beta Releases
|
|
31
|
+
|
|
32
|
+
1. **Update version:**
|
|
33
|
+
```bash
|
|
34
|
+
# First beta of a new version
|
|
35
|
+
npm version 0.0.19-beta.1
|
|
36
|
+
|
|
37
|
+
# Increment beta number
|
|
38
|
+
bun npm:version:beta
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
2. **Create GitHub Release:**
|
|
42
|
+
```bash
|
|
43
|
+
git push origin v0.0.19-beta.1
|
|
44
|
+
```
|
|
45
|
+
Or manually trigger the workflow with the beta tag.
|
|
46
|
+
|
|
47
|
+
3. **Publish to npm:**
|
|
48
|
+
```bash
|
|
49
|
+
bun npm:publish:beta
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Beta Release Workflow
|
|
53
|
+
|
|
54
|
+
1. Beta versions use semantic versioning: `MAJOR.MINOR.PATCH-beta.NUMBER`
|
|
55
|
+
2. GitHub Actions automatically marks releases with `-beta` as pre-releases
|
|
56
|
+
3. npm publishes to the `beta` dist-tag (not `latest`)
|
|
57
|
+
4. Users on stable versions won't get beta updates
|
|
58
|
+
|
|
59
|
+
### Promoting Beta to Stable
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Update version to stable
|
|
63
|
+
npm version 0.0.19
|
|
64
|
+
|
|
65
|
+
# Publish as latest
|
|
66
|
+
bun npm:publish
|
|
67
|
+
```
|
package/BUILD.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Build System
|
|
2
|
+
|
|
3
|
+
This document describes Electrobun's build system and cross-platform compilation approach.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Electrobun uses a custom build system (`build.ts`) that handles:
|
|
8
|
+
- Vendoring dependencies (Bun, Zig, CEF, WebView2)
|
|
9
|
+
- Building native wrappers for each platform
|
|
10
|
+
- Creating distribution packages
|
|
11
|
+
|
|
12
|
+
## Platform-Specific Native Wrappers
|
|
13
|
+
|
|
14
|
+
### macOS
|
|
15
|
+
- Single `libNativeWrapper.dylib` with weak linking to CEF framework
|
|
16
|
+
- Uses `-weak_framework 'Chromium Embedded Framework'` for optional CEF support
|
|
17
|
+
- Gracefully falls back to WebKit when CEF is not bundled
|
|
18
|
+
|
|
19
|
+
### Windows
|
|
20
|
+
- Single `libNativeWrapper.dll` with runtime CEF detection
|
|
21
|
+
- Links both WebView2 and CEF libraries at build time
|
|
22
|
+
- Uses runtime checks to determine which webview engine to use
|
|
23
|
+
|
|
24
|
+
### Linux
|
|
25
|
+
**Dual Binary Approach** - Linux builds create two separate native wrapper binaries:
|
|
26
|
+
|
|
27
|
+
#### `libNativeWrapper.so` (GTK-only)
|
|
28
|
+
- Size: ~1.46MB
|
|
29
|
+
- Dependencies: WebKitGTK, GTK+3, AppIndicator only
|
|
30
|
+
- No CEF dependencies linked
|
|
31
|
+
- Used when `bundleCEF: false` in electrobun.config
|
|
32
|
+
|
|
33
|
+
#### `libNativeWrapper_cef.so` (CEF-enabled)
|
|
34
|
+
- Size: ~3.47MB
|
|
35
|
+
- Dependencies: WebKitGTK, GTK+3, AppIndicator + CEF libraries
|
|
36
|
+
- Full CEF functionality available
|
|
37
|
+
- Used when `bundleCEF: true` in electrobun.config
|
|
38
|
+
|
|
39
|
+
#### Why Dual Binaries?
|
|
40
|
+
|
|
41
|
+
Unlike macOS and Windows, Linux doesn't have reliable weak linking for shared libraries. Hard linking CEF libraries causes `dlopen` failures when CEF isn't bundled. The dual binary approach provides:
|
|
42
|
+
|
|
43
|
+
1. **Small bundle sizes** - Developers can ship lightweight apps without CEF overhead
|
|
44
|
+
2. **Flexibility** - Same codebase supports both system WebKitGTK and CEF rendering
|
|
45
|
+
3. **Reliability** - No runtime linking failures or undefined symbols
|
|
46
|
+
|
|
47
|
+
#### CLI Binary Selection
|
|
48
|
+
|
|
49
|
+
The Electrobun CLI automatically copies the appropriate binary based on the `bundleCEF` setting:
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
const useCEF = config.build.linux?.bundleCEF;
|
|
53
|
+
const nativeWrapperSource = useCEF
|
|
54
|
+
? PATHS.NATIVE_WRAPPER_LINUX_CEF
|
|
55
|
+
: PATHS.NATIVE_WRAPPER_LINUX;
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Both binaries are included in the distributed `electrobun` npm package, ensuring developers can toggle CEF support without recompilation.
|
|
59
|
+
|
|
60
|
+
## Build Commands
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Full build with all platforms
|
|
64
|
+
bun build.ts
|
|
65
|
+
|
|
66
|
+
# Development build with playground
|
|
67
|
+
bun dev:playground
|
|
68
|
+
|
|
69
|
+
# Release build
|
|
70
|
+
bun build.ts --release
|
|
71
|
+
|
|
72
|
+
# CI build
|
|
73
|
+
bun build.ts --ci
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Architecture Support
|
|
77
|
+
|
|
78
|
+
- **macOS**: ARM64 (Apple Silicon), x64 (Intel)
|
|
79
|
+
- **Windows**: x64 only (ARM Windows users run via automatic emulation)
|
|
80
|
+
- **Linux**: x64, ARM64
|
|
81
|
+
|
|
82
|
+
### Windows Architecture Notes
|
|
83
|
+
|
|
84
|
+
Windows builds are created on ARM VMs but target x64 architecture. Both x64 and ARM Windows users use the same x64 binary:
|
|
85
|
+
- **x64 Windows**: Runs natively
|
|
86
|
+
- **ARM Windows**: Runs via automatic Windows emulation layer
|
|
87
|
+
|
|
88
|
+
This approach simplifies distribution while maintaining compatibility across Windows architectures.
|
|
89
|
+
|
|
90
|
+
The build system automatically detects the host architecture and downloads appropriate dependencies.
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
## What is Electrobun?
|
|
10
10
|
|
|
11
|
-
> Electrobun is in the **_very_** early stages. We currently
|
|
11
|
+
> Electrobun is in the **_very_** early stages. We currently support development on macOS, Windows, and Linux, but it has memory leaks, has no tests, and many core things are still missing. We're actively working on stabilizing cross-platform support.
|
|
12
12
|
|
|
13
13
|
Electrobun aims to be a complete **solution-in-a-box** for building, updating, and shipping ultra fast, tiny, and cross-platform desktop applications written in Typescript.
|
|
14
14
|
Under the hood it uses <a href="https://bun.sh">bun</a> to execute the main process and to bundle webview typescript, and has native bindings written in <a href="https://ziglang.org/">zig</a>.
|
|
@@ -29,21 +29,7 @@ Read about how Electrobun is designed, and why, in our <a href="https://www.elec
|
|
|
29
29
|
|
|
30
30
|
## Roadmap
|
|
31
31
|
|
|
32
|
-
See the
|
|
33
|
-
|
|
34
|
-
**High level roadmap**
|
|
35
|
-
|
|
36
|
-
| | Milestones | Description |
|
|
37
|
-
| :-- | :-------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- |
|
|
38
|
-
| ✅ | Core Architecture | Ship a working proof of concept with most of the core architecture wired up |
|
|
39
|
-
| ✅ | Packaging and signing | Packaging and code signing for MacOS |
|
|
40
|
-
| ✅ | Shipping updates | Integrated auto-updator |
|
|
41
|
-
| ✅ | Webview Tag | Cross browser electrobun implementation of the <webview> tag that electron has, for isolated nested webviews |
|
|
42
|
-
| ✅ | Port co(lab) | Harden implementation and enough electron parity to migrate <a href="https://colab.sh">https://colab.sh</a> from Electron to Electrobun |
|
|
43
|
-
| | Custom Web Runtime | Optionally use a cross-platform web runtime (Chromium) instead of the system's native webview |
|
|
44
|
-
| | Intel Mac Builds | build on and distribute to intel macs |
|
|
45
|
-
| | API Parity | Accelerate development of Electrobun apis and native integrations to enable apps to migrate from Electron and Tauri |
|
|
46
|
-
| | Windows support | build for and distribute to Windows |
|
|
32
|
+
See the <a href="https://github.com/orgs/blackboardsh/projects/5">roadmap</a>
|
|
47
33
|
|
|
48
34
|
## Contributing
|
|
49
35
|
|
|
@@ -53,14 +39,55 @@ As we get closer to 1.0.0 I'll probably make guidelines for PRs and stuff. In th
|
|
|
53
39
|
|
|
54
40
|
Ways to get involved at this early stage:
|
|
55
41
|
|
|
56
|
-
- Follow us on X for updates <a href="https://twitter.com/BlackboardTech">@BlackboardTech</a>
|
|
42
|
+
- Follow us on X for updates <a href="https://twitter.com/BlackboardTech">@BlackboardTech</a> or <a href="https://bsky.app/profile/yoav.codes">@yoav.codes</a>
|
|
57
43
|
- Join the conversation on <a href="https://discord.gg/ueKE4tjaCE">Discord</a>
|
|
58
44
|
- Create and participate in Github issues and discussions
|
|
59
45
|
|
|
60
|
-
##
|
|
46
|
+
## Development Setup
|
|
47
|
+
|
|
48
|
+
### Prerequisites
|
|
49
|
+
|
|
50
|
+
**macOS:**
|
|
51
|
+
- Xcode command line tools
|
|
52
|
+
- cmake (install via homebrew: `brew install cmake`)
|
|
53
|
+
|
|
54
|
+
**Windows:**
|
|
55
|
+
- Visual Studio Build Tools or Visual Studio with C++ development tools
|
|
56
|
+
- cmake
|
|
57
|
+
|
|
58
|
+
**Linux:**
|
|
59
|
+
- build-essential package
|
|
60
|
+
- cmake
|
|
61
|
+
- webkit2gtk and GTK development packages
|
|
62
|
+
|
|
63
|
+
### First-time Setup
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
git clone <repo-url>
|
|
67
|
+
cd electrobun
|
|
68
|
+
bun install
|
|
69
|
+
bun dev:playground:clean
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Development Workflow
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# After making changes to source code
|
|
76
|
+
bun dev:playground
|
|
77
|
+
|
|
78
|
+
# If you only changed playground code (not electrobun source)
|
|
79
|
+
bun dev:playground:rerun
|
|
80
|
+
|
|
81
|
+
# If you need a completely fresh start
|
|
82
|
+
bun dev:playground:clean
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Additional Commands
|
|
61
86
|
|
|
62
|
-
|
|
87
|
+
- `bun dev:playground:canary` - Build and run playground in canary mode
|
|
88
|
+
- `bun build:dev` - Build electrobun in development mode
|
|
89
|
+
- `bun build:release` - Build electrobun in release mode
|
|
63
90
|
|
|
64
|
-
|
|
91
|
+
### Debugging
|
|
65
92
|
|
|
66
|
-
|
|
93
|
+
**macOS:** Use `lldb <path-to-bundle>/Contents/MacOS/launcher` and then `run` to debug release builds
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execSync, spawn } = require('child_process');
|
|
4
|
+
const { existsSync, mkdirSync, createWriteStream, unlinkSync, chmodSync } = require('fs');
|
|
5
|
+
const { join, dirname } = require('path');
|
|
6
|
+
const https = require('https');
|
|
7
|
+
const tar = require('tar');
|
|
8
|
+
|
|
9
|
+
// Detect platform and architecture
|
|
10
|
+
function getPlatform() {
|
|
11
|
+
switch (process.platform) {
|
|
12
|
+
case 'win32': return 'win';
|
|
13
|
+
case 'darwin': return 'darwin';
|
|
14
|
+
case 'linux': return 'linux';
|
|
15
|
+
default: throw new Error(`Unsupported platform: ${process.platform}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function getArch() {
|
|
20
|
+
switch (process.arch) {
|
|
21
|
+
case 'arm64': return 'arm64';
|
|
22
|
+
case 'x64': return 'x64';
|
|
23
|
+
default: throw new Error(`Unsupported architecture: ${process.arch}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const platform = getPlatform();
|
|
28
|
+
// Always use x64 for Windows since we only build x64 Windows binaries
|
|
29
|
+
const arch = platform === 'win' ? 'x64' : getArch();
|
|
30
|
+
const binExt = platform === 'win' ? '.exe' : '';
|
|
31
|
+
|
|
32
|
+
// Paths
|
|
33
|
+
const electrobunDir = join(__dirname, '..');
|
|
34
|
+
const cacheDir = join(electrobunDir, '.cache');
|
|
35
|
+
const cliBinary = join(cacheDir, `electrobun${binExt}`);
|
|
36
|
+
|
|
37
|
+
async function downloadFile(url, filePath) {
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
39
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
40
|
+
const file = createWriteStream(filePath);
|
|
41
|
+
|
|
42
|
+
https.get(url, (response) => {
|
|
43
|
+
if (response.statusCode === 302 || response.statusCode === 301) {
|
|
44
|
+
// Follow redirect
|
|
45
|
+
return downloadFile(response.headers.location, filePath).then(resolve).catch(reject);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (response.statusCode !== 200) {
|
|
49
|
+
reject(new Error(`Download failed: ${response.statusCode}`));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
response.pipe(file);
|
|
54
|
+
|
|
55
|
+
file.on('finish', () => {
|
|
56
|
+
file.close();
|
|
57
|
+
resolve();
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
file.on('error', reject);
|
|
61
|
+
}).on('error', reject);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function ensureCliBinary() {
|
|
66
|
+
// Check if CLI binary exists in bin location (where npm expects it)
|
|
67
|
+
const binLocation = join(electrobunDir, 'bin', 'electrobun' + binExt);
|
|
68
|
+
if (existsSync(binLocation)) {
|
|
69
|
+
return binLocation;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Check if core dependencies already exist in cache
|
|
73
|
+
if (existsSync(cliBinary)) {
|
|
74
|
+
// Copy to bin location if it exists in cache but not in bin
|
|
75
|
+
mkdirSync(dirname(binLocation), { recursive: true });
|
|
76
|
+
const fs = require('fs');
|
|
77
|
+
fs.copyFileSync(cliBinary, binLocation);
|
|
78
|
+
if (platform !== 'win') {
|
|
79
|
+
chmodSync(binLocation, '755');
|
|
80
|
+
}
|
|
81
|
+
return binLocation;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
console.log('Downloading electrobun CLI for your platform...');
|
|
85
|
+
|
|
86
|
+
// Get the package version to download the matching release
|
|
87
|
+
const packageJson = require(join(electrobunDir, 'package.json'));
|
|
88
|
+
const version = packageJson.version;
|
|
89
|
+
const tag = `v${version}`;
|
|
90
|
+
|
|
91
|
+
const tarballUrl = `https://github.com/blackboardsh/electrobun/releases/download/${tag}/electrobun-cli-${platform}-${arch}.tar.gz`;
|
|
92
|
+
const tarballPath = join(cacheDir, `electrobun-${platform}-${arch}.tar.gz`);
|
|
93
|
+
|
|
94
|
+
try {
|
|
95
|
+
// Download tarball
|
|
96
|
+
await downloadFile(tarballUrl, tarballPath);
|
|
97
|
+
|
|
98
|
+
// Extract CLI binary
|
|
99
|
+
await tar.x({
|
|
100
|
+
file: tarballPath,
|
|
101
|
+
cwd: cacheDir
|
|
102
|
+
// No strip needed - CLI tarball contains just the binary
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// Clean up tarball
|
|
106
|
+
unlinkSync(tarballPath);
|
|
107
|
+
|
|
108
|
+
// Check if CLI binary was extracted
|
|
109
|
+
if (!existsSync(cliBinary)) {
|
|
110
|
+
throw new Error(`CLI binary not found at ${cliBinary} after extraction`);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Make executable on Unix systems
|
|
114
|
+
if (platform !== 'win') {
|
|
115
|
+
chmodSync(cliBinary, '755');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Copy CLI to bin location so npm scripts can find it
|
|
119
|
+
const binLocation = join(electrobunDir, 'bin', 'electrobun' + binExt);
|
|
120
|
+
mkdirSync(dirname(binLocation), { recursive: true });
|
|
121
|
+
|
|
122
|
+
// Copy the downloaded CLI to replace this script
|
|
123
|
+
const fs = require('fs');
|
|
124
|
+
fs.copyFileSync(cliBinary, binLocation);
|
|
125
|
+
|
|
126
|
+
// Make the bin location executable too
|
|
127
|
+
if (platform !== 'win') {
|
|
128
|
+
chmodSync(binLocation, '755');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
console.log('electrobun CLI downloaded successfully!');
|
|
132
|
+
return binLocation;
|
|
133
|
+
|
|
134
|
+
} catch (error) {
|
|
135
|
+
throw new Error(`Failed to download electrobun CLI: ${error.message}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
async function main() {
|
|
140
|
+
try {
|
|
141
|
+
const args = process.argv.slice(2);
|
|
142
|
+
const cliPath = await ensureCliBinary();
|
|
143
|
+
|
|
144
|
+
// Replace this process with the actual CLI
|
|
145
|
+
const child = spawn(cliPath, args, {
|
|
146
|
+
stdio: 'inherit',
|
|
147
|
+
cwd: process.cwd()
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
child.on('exit', (code) => {
|
|
151
|
+
process.exit(code || 0);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
child.on('error', (error) => {
|
|
155
|
+
console.error('Failed to start electrobun CLI:', error.message);
|
|
156
|
+
process.exit(1);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
} catch (error) {
|
|
160
|
+
console.error('Error:', error.message);
|
|
161
|
+
process.exit(1);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
main();
|
package/debug.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
console.log('process.argv:', process.argv);
|
|
2
|
+
const indexOfElectrobun = process.argv.findIndex((arg) => arg.includes('electrobun'));
|
|
3
|
+
console.log('indexOfElectrobun:', indexOfElectrobun);
|
|
4
|
+
const commandArg = process.argv[indexOfElectrobun + 1] || 'build';
|
|
5
|
+
console.log('commandArg:', commandArg);
|