@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',
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
351
|
+
if (!isGlobalInstall()) {
|
|
352
|
+
await runInDir(path.join(ROOT, 'apps', 'desktop-console'), npmBin(), ['install']);
|
|
353
|
+
}
|
|
341
354
|
}
|
|
342
355
|
|
|
343
356
|
if (!okUiBuilt) {
|