wave-code 1.1.1 → 1.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.
package/bin/wave-code.js
CHANGED
|
@@ -21,6 +21,15 @@ if (process.argv.slice(2).some((a) => versionArgs.includes(a))) {
|
|
|
21
21
|
process.exit(0);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
// Electron RUN_AS_NODE (desktop/vscode bundled runtime) leaves
|
|
25
|
+
// `process.versions.electron` set, so yargs' hideBin() mis-detects the
|
|
26
|
+
// process as a bundled Electron app (bin index 0 instead of 1) and keeps the
|
|
27
|
+
// script path in argv → `Unknown argument: <script>`. Mark the process as the
|
|
28
|
+
// default Electron app so yargs parses argv exactly like plain node would.
|
|
29
|
+
if (process.versions.electron && process.env.ELECTRON_RUN_AS_NODE === "1") {
|
|
30
|
+
process.defaultApp = true;
|
|
31
|
+
}
|
|
32
|
+
|
|
24
33
|
// Import and start the CLI (single-file esbuild bundle — avoids Node's
|
|
25
34
|
// per-import node_modules resolution at startup, ~5s -> ~0.6s module load).
|
|
26
35
|
// React's production build is selected at compile time (esbuild define
|