@glassly/cli 2.0.2 → 2.0.3-dev.0
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/package.json +2 -2
- package/src/open-browser.ts +7 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glassly/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3-dev.0",
|
|
4
4
|
"description": "The glassly command: develop, pack, release, and publish Glassly miniapps. Bun-only.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"typecheck": "tsc --noEmit"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@glassly/miniapp-cli": "0.1.1",
|
|
25
|
+
"@glassly/miniapp-cli": "0.1.1-dev.0",
|
|
26
26
|
"commander": "^14.0.2",
|
|
27
27
|
"qrcode": "^1.5.4"
|
|
28
28
|
},
|
package/src/open-browser.ts
CHANGED
|
@@ -34,8 +34,13 @@ export async function openBrowser(url: string): Promise<boolean> {
|
|
|
34
34
|
// as a failure. But others (`xdg-open`) can stay attached to the browser, so
|
|
35
35
|
// don't block the login flow waiting for exit: assume success once a short
|
|
36
36
|
// window passes without an error/early failure so polling can start.
|
|
37
|
-
child
|
|
37
|
+
// The timer must stay referenced: with the child unref'd above, it is the
|
|
38
|
+
// only thing keeping the event loop alive while login awaits this promise.
|
|
39
|
+
// Unref'ing it too let the runtime exit before polling ever started.
|
|
38
40
|
const timer = setTimeout(() => done(true), 500);
|
|
39
|
-
|
|
41
|
+
child.on("close", (code) => {
|
|
42
|
+
clearTimeout(timer);
|
|
43
|
+
done(code === 0);
|
|
44
|
+
});
|
|
40
45
|
});
|
|
41
46
|
}
|