opalserve 3.1.1 → 3.2.1
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/README.md +38 -7
- package/dist/cli/commands/add.d.ts +7 -0
- package/dist/cli/commands/add.d.ts.map +1 -0
- package/dist/cli/commands/add.js +79 -0
- package/dist/cli/commands/add.js.map +1 -0
- package/dist/cli/commands/default.d.ts +7 -0
- package/dist/cli/commands/default.d.ts.map +1 -0
- package/dist/cli/commands/default.js +75 -0
- package/dist/cli/commands/default.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +2 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +107 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +43 -4
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/link.d.ts +11 -0
- package/dist/cli/commands/link.d.ts.map +1 -0
- package/dist/cli/commands/link.js +135 -0
- package/dist/cli/commands/link.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +7 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +46 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/start.d.ts +1 -0
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +13 -0
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/editors/base.d.ts +23 -0
- package/dist/cli/editors/base.d.ts.map +1 -0
- package/dist/cli/editors/base.js +75 -0
- package/dist/cli/editors/base.js.map +1 -0
- package/dist/cli/editors/claude.d.ts +8 -0
- package/dist/cli/editors/claude.d.ts.map +1 -0
- package/dist/cli/editors/claude.js +31 -0
- package/dist/cli/editors/claude.js.map +1 -0
- package/dist/cli/editors/cline.d.ts +14 -0
- package/dist/cli/editors/cline.d.ts.map +1 -0
- package/dist/cli/editors/cline.js +32 -0
- package/dist/cli/editors/cline.js.map +1 -0
- package/dist/cli/editors/cursor.d.ts +8 -0
- package/dist/cli/editors/cursor.d.ts.map +1 -0
- package/dist/cli/editors/cursor.js +14 -0
- package/dist/cli/editors/cursor.js.map +1 -0
- package/dist/cli/editors/index.d.ts +14 -0
- package/dist/cli/editors/index.d.ts.map +1 -0
- package/dist/cli/editors/index.js +34 -0
- package/dist/cli/editors/index.js.map +1 -0
- package/dist/cli/editors/types.d.ts +33 -0
- package/dist/cli/editors/types.d.ts.map +1 -0
- package/dist/cli/editors/types.js +2 -0
- package/dist/cli/editors/types.js.map +1 -0
- package/dist/cli/index.js +43 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/utils/browser.d.ts +7 -0
- package/dist/utils/browser.d.ts.map +1 -0
- package/dist/utils/browser.js +34 -0
- package/dist/utils/browser.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Open a URL in the user's default browser. Returns true if a child was
|
|
3
|
+
* spawned, false if we deliberately skipped (CI, non-interactive, opt-out).
|
|
4
|
+
* Failures are swallowed — opening a browser is best-effort UX, not critical.
|
|
5
|
+
*/
|
|
6
|
+
export declare function openInBrowser(url: string): boolean;
|
|
7
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/utils/browser.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAmBlD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { platform } from 'node:os';
|
|
3
|
+
/**
|
|
4
|
+
* Open a URL in the user's default browser. Returns true if a child was
|
|
5
|
+
* spawned, false if we deliberately skipped (CI, non-interactive, opt-out).
|
|
6
|
+
* Failures are swallowed — opening a browser is best-effort UX, not critical.
|
|
7
|
+
*/
|
|
8
|
+
export function openInBrowser(url) {
|
|
9
|
+
if (process.env.OPALSERVE_NO_BROWSER === '1')
|
|
10
|
+
return false;
|
|
11
|
+
if (process.env.CI)
|
|
12
|
+
return false;
|
|
13
|
+
if (process.env.NODE_ENV === 'test')
|
|
14
|
+
return false;
|
|
15
|
+
if (!process.stdout.isTTY)
|
|
16
|
+
return false;
|
|
17
|
+
try {
|
|
18
|
+
const plat = platform();
|
|
19
|
+
if (plat === 'darwin') {
|
|
20
|
+
spawn('open', [url], { detached: true, stdio: 'ignore' }).unref();
|
|
21
|
+
}
|
|
22
|
+
else if (plat === 'win32') {
|
|
23
|
+
spawn('cmd', ['/c', 'start', '""', url], { detached: true, stdio: 'ignore' }).unref();
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
spawn('xdg-open', [url], { detached: true, stdio: 'ignore' }).unref();
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/utils/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,GAAG;QAAE,OAAO,KAAK,CAAC;IAC3D,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE;QAAE,OAAO,KAAK,CAAC;IACjC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IAClD,IAAI,CAAC,OAAO,CAAC,MAA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