@codelia/runtime 0.1.1 → 0.1.2

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/dist/index.cjs CHANGED
@@ -640,23 +640,35 @@ var createOAuthSession = async () => {
640
640
  stop: callbackServer.stop
641
641
  };
642
642
  };
643
+ var resolveBrowserLaunch = (platform, url) => {
644
+ if (platform === "darwin") {
645
+ return {
646
+ command: "open",
647
+ args: [url],
648
+ options: { stdio: "ignore", detached: true }
649
+ };
650
+ }
651
+ if (platform === "win32") {
652
+ return {
653
+ command: "rundll32",
654
+ args: ["url.dll,FileProtocolHandler", url],
655
+ options: {
656
+ stdio: "ignore",
657
+ detached: true,
658
+ windowsHide: true
659
+ }
660
+ };
661
+ }
662
+ return {
663
+ command: "xdg-open",
664
+ args: [url],
665
+ options: { stdio: "ignore", detached: true }
666
+ };
667
+ };
643
668
  var openBrowser = (url) => {
644
- const platform = process.platform;
669
+ const launch = resolveBrowserLaunch(process.platform, url);
645
670
  try {
646
- if (platform === "darwin") {
647
- (0, import_node_child_process.spawn)("open", [url], { stdio: "ignore", detached: true });
648
- return;
649
- }
650
- if (platform === "win32") {
651
- (0, import_node_child_process.spawn)("cmd", ["/c", "start", "", url], {
652
- stdio: "ignore",
653
- shell: true,
654
- windowsHide: true,
655
- detached: true
656
- });
657
- return;
658
- }
659
- (0, import_node_child_process.spawn)("xdg-open", [url], { stdio: "ignore", detached: true });
671
+ (0, import_node_child_process.spawn)(launch.command, launch.args, launch.options);
660
672
  } catch {
661
673
  }
662
674
  };
package/dist/index.js CHANGED
@@ -621,23 +621,35 @@ var createOAuthSession = async () => {
621
621
  stop: callbackServer.stop
622
622
  };
623
623
  };
624
+ var resolveBrowserLaunch = (platform, url) => {
625
+ if (platform === "darwin") {
626
+ return {
627
+ command: "open",
628
+ args: [url],
629
+ options: { stdio: "ignore", detached: true }
630
+ };
631
+ }
632
+ if (platform === "win32") {
633
+ return {
634
+ command: "rundll32",
635
+ args: ["url.dll,FileProtocolHandler", url],
636
+ options: {
637
+ stdio: "ignore",
638
+ detached: true,
639
+ windowsHide: true
640
+ }
641
+ };
642
+ }
643
+ return {
644
+ command: "xdg-open",
645
+ args: [url],
646
+ options: { stdio: "ignore", detached: true }
647
+ };
648
+ };
624
649
  var openBrowser = (url) => {
625
- const platform = process.platform;
650
+ const launch = resolveBrowserLaunch(process.platform, url);
626
651
  try {
627
- if (platform === "darwin") {
628
- spawn("open", [url], { stdio: "ignore", detached: true });
629
- return;
630
- }
631
- if (platform === "win32") {
632
- spawn("cmd", ["/c", "start", "", url], {
633
- stdio: "ignore",
634
- shell: true,
635
- windowsHide: true,
636
- detached: true
637
- });
638
- return;
639
- }
640
- spawn("xdg-open", [url], { stdio: "ignore", detached: true });
652
+ spawn(launch.command, launch.args, launch.options);
641
653
  } catch {
642
654
  }
643
655
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codelia/runtime",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -20,14 +20,14 @@
20
20
  "typecheck": "tsc --noEmit"
21
21
  },
22
22
  "dependencies": {
23
- "@codelia/config": "0.1.1",
24
- "@codelia/config-loader": "0.1.1",
25
- "@codelia/core": "0.1.1",
26
- "@codelia/logger": "0.1.1",
27
- "@codelia/model-metadata": "0.1.1",
28
- "@codelia/protocol": "0.1.1",
29
- "@codelia/shared-types": "0.1.1",
30
- "@codelia/storage": "0.1.1",
23
+ "@codelia/config": "0.1.2",
24
+ "@codelia/config-loader": "0.1.2",
25
+ "@codelia/core": "0.1.2",
26
+ "@codelia/logger": "0.1.2",
27
+ "@codelia/model-metadata": "0.1.2",
28
+ "@codelia/protocol": "0.1.2",
29
+ "@codelia/shared-types": "0.1.2",
30
+ "@codelia/storage": "0.1.2",
31
31
  "eventsource-parser": "^3.0.6",
32
32
  "oauth4webapi": "^3.8.4",
33
33
  "zod": "^4.3.5"