@web-auto/webauto 0.1.2 → 0.1.3

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.
@@ -86,7 +86,7 @@ async function startConsole(noDaemon = false) {
86
86
  const env = { ...process.env };
87
87
  if (noDaemon) env.WEBAUTO_NO_DAEMON = '1';
88
88
 
89
- const child = spawn('electron', [DIST_MAIN], {
89
+ const child = spawn('npx', ['electron', DIST_MAIN], {
90
90
  cwd: APP_ROOT,
91
91
  env,
92
92
  stdio: 'inherit',
package/bin/webauto.mjs CHANGED
@@ -261,7 +261,16 @@ async function runInDir(dir, cmd, args) {
261
261
  }
262
262
 
263
263
  function checkDesktopConsoleDeps() {
264
- return exists(path.join(ROOT, 'apps', 'desktop-console', 'node_modules', 'electron'));
264
+ // Check for electron in various locations:
265
+ // 1. Global npm root (when installed globally alongside webauto)
266
+ // 2. Package's own node_modules
267
+ // 3. apps/desktop-console/node_modules (local dev)
268
+ const globalRoot = path.resolve(ROOT, '..', '..');
269
+ return (
270
+ exists(path.join(globalRoot, 'electron')) ||
271
+ exists(path.join(ROOT, 'node_modules', 'electron')) ||
272
+ exists(path.join(ROOT, 'apps', 'desktop-console', 'node_modules', 'electron'))
273
+ );
265
274
  }
266
275
 
267
276
  function checkDesktopConsoleBuilt() {
@@ -333,11 +342,15 @@ async function uiConsole({ build, install, checkOnly }) {
333
342
  }
334
343
 
335
344
  if (!okDeps) {
336
- if (!install && !build) {
345
+ // For global install, okDeps is always true since we check global electron
346
+ // For local dev, require explicit --install or --build
347
+ if (!isGlobalInstall() && !install && !build) {
337
348
  console.error('❌ missing apps/desktop-console/node_modules. Run: npm --prefix apps/desktop-console install');
338
349
  process.exit(2);
339
350
  }
340
- await runInDir(path.join(ROOT, 'apps', 'desktop-console'), npmBin(), ['install']);
351
+ if (!isGlobalInstall()) {
352
+ await runInDir(path.join(ROOT, 'apps', 'desktop-console'), npmBin(), ['install']);
353
+ }
341
354
  }
342
355
 
343
356
  if (!okUiBuilt) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@web-auto/webauto",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "webauto": "bin/webauto.mjs"
@@ -93,4 +93,4 @@
93
93
  "tsx": "^4.16.5",
94
94
  "typescript": "^5.9.3"
95
95
  }
96
- }
96
+ }