electrobun 0.0.19-beta.36 → 0.0.19-beta.39

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 +45 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrobun",
3
- "version": "0.0.19-beta.36",
3
+ "version": "0.0.19-beta.39",
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
@@ -162,17 +162,21 @@ async function ensureCoreDependencies() {
162
162
  const distPath = join(ELECTROBUN_DEP_PATH, 'dist');
163
163
  mkdirSync(distPath, { recursive: true });
164
164
 
165
- await tar.x({
166
- file: tempFile,
167
- cwd: distPath,
168
- preservePaths: false,
169
- strip: 0,
170
- // Add Windows-specific options for more robust extraction
171
- ...(OS === 'win' && {
172
- noMtime: true,
173
- preserveOwner: false,
174
- }),
175
- });
165
+ // Use Windows native tar.exe on Windows due to npm tar library issues
166
+ if (OS === 'win') {
167
+ console.log('Using Windows native tar.exe for reliable extraction...');
168
+ execSync(`tar -xf "${tempFile}" -C "${distPath}"`, {
169
+ stdio: 'inherit',
170
+ cwd: distPath
171
+ });
172
+ } else {
173
+ await tar.x({
174
+ file: tempFile,
175
+ cwd: distPath,
176
+ preservePaths: false,
177
+ strip: 0,
178
+ });
179
+ }
176
180
 
177
181
  // Clean up temp file
178
182
  unlinkSync(tempFile);
@@ -181,10 +185,23 @@ async function ensureCoreDependencies() {
181
185
  const mainJsPath = join(ELECTROBUN_DEP_PATH, 'dist', 'main.js');
182
186
  if (!existsSync(mainJsPath)) {
183
187
  console.error('Warning: main.js was not extracted properly');
188
+ console.error('This may be caused by Windows Defender or antivirus software quarantining .js files');
189
+ console.error('Try temporarily disabling real-time protection or adding an exclusion for the electrobun directory');
190
+
184
191
  // List what was actually extracted for debugging
185
192
  try {
186
193
  const extractedFiles = readdirSync(join(ELECTROBUN_DEP_PATH, 'dist'));
187
194
  console.log('Extracted files:', extractedFiles);
195
+
196
+ // Check if API directory exists but is empty
197
+ const apiPath = join(ELECTROBUN_DEP_PATH, 'dist', 'api');
198
+ if (existsSync(apiPath)) {
199
+ const apiFiles = readdirSync(apiPath);
200
+ console.log('API directory contents:', apiFiles);
201
+ if (apiFiles.length === 0) {
202
+ console.error('API directory is empty - this confirms antivirus is likely quarantining script files');
203
+ }
204
+ }
188
205
  } catch (e) {
189
206
  console.error('Could not list extracted files');
190
207
  }
@@ -251,17 +268,23 @@ async function ensureCEFDependencies() {
251
268
 
252
269
  // Extract to dist directory
253
270
  console.log('Extracting CEF dependencies...');
254
- await tar.x({
255
- file: tempFile,
256
- cwd: join(ELECTROBUN_DEP_PATH, 'dist'),
257
- preservePaths: false,
258
- strip: 0,
259
- // Add Windows-specific options for more robust extraction
260
- ...(OS === 'win' && {
261
- noMtime: true,
262
- preserveOwner: false,
263
- }),
264
- });
271
+ const cefDistPath = join(ELECTROBUN_DEP_PATH, 'dist');
272
+
273
+ // Use Windows native tar.exe on Windows due to npm tar library issues
274
+ if (OS === 'win') {
275
+ console.log('Using Windows native tar.exe for reliable extraction...');
276
+ execSync(`tar -xf "${tempFile}" -C "${cefDistPath}"`, {
277
+ stdio: 'inherit',
278
+ cwd: cefDistPath
279
+ });
280
+ } else {
281
+ await tar.x({
282
+ file: tempFile,
283
+ cwd: cefDistPath,
284
+ preservePaths: false,
285
+ strip: 0,
286
+ });
287
+ }
265
288
 
266
289
  // Clean up temp file
267
290
  unlinkSync(tempFile);