@codelia/runtime 0.1.1 → 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.
- package/dist/index.cjs +27 -15
- package/dist/index.js +27 -15
- package/package.json +12 -9
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
|
|
669
|
+
const launch = resolveBrowserLaunch(process.platform, url);
|
|
645
670
|
try {
|
|
646
|
-
|
|
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
|
|
650
|
+
const launch = resolveBrowserLaunch(process.platform, url);
|
|
626
651
|
try {
|
|
627
|
-
|
|
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,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codelia/runtime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=20 <25"
|
|
7
|
+
},
|
|
5
8
|
"files": [
|
|
6
9
|
"dist"
|
|
7
10
|
],
|
|
@@ -20,14 +23,14 @@
|
|
|
20
23
|
"typecheck": "tsc --noEmit"
|
|
21
24
|
},
|
|
22
25
|
"dependencies": {
|
|
23
|
-
"@codelia/config": "0.1.
|
|
24
|
-
"@codelia/config-loader": "0.1.
|
|
25
|
-
"@codelia/core": "0.1.
|
|
26
|
-
"@codelia/logger": "0.1.
|
|
27
|
-
"@codelia/model-metadata": "0.1.
|
|
28
|
-
"@codelia/protocol": "0.1.
|
|
29
|
-
"@codelia/shared-types": "0.1.
|
|
30
|
-
"@codelia/storage": "0.1.
|
|
26
|
+
"@codelia/config": "0.1.3",
|
|
27
|
+
"@codelia/config-loader": "0.1.3",
|
|
28
|
+
"@codelia/core": "0.1.3",
|
|
29
|
+
"@codelia/logger": "0.1.3",
|
|
30
|
+
"@codelia/model-metadata": "0.1.3",
|
|
31
|
+
"@codelia/protocol": "0.1.3",
|
|
32
|
+
"@codelia/shared-types": "0.1.3",
|
|
33
|
+
"@codelia/storage": "0.1.3",
|
|
31
34
|
"eventsource-parser": "^3.0.6",
|
|
32
35
|
"oauth4webapi": "^3.8.4",
|
|
33
36
|
"zod": "^4.3.5"
|