tuturuuu 0.20.0 → 0.20.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/dist/cli/browser.d.ts +14 -0
- package/dist/cli/browser.d.ts.map +1 -1
- package/dist/cli/browser.js +30 -13
- package/dist/cli/browser.js.map +1 -1
- package/package.json +4 -4
package/dist/cli/browser.d.ts
CHANGED
|
@@ -2,6 +2,20 @@ export interface OpenBrowserCommand {
|
|
|
2
2
|
args: string[];
|
|
3
3
|
command: string;
|
|
4
4
|
}
|
|
5
|
+
interface BrowserChild {
|
|
6
|
+
once(event: 'error', listener: () => void): void;
|
|
7
|
+
once(event: 'spawn', listener: () => void): void;
|
|
8
|
+
unref(): void;
|
|
9
|
+
}
|
|
10
|
+
interface BrowserDependencies {
|
|
11
|
+
getPlatform(): NodeJS.Platform;
|
|
12
|
+
spawnProcess(command: string, args: string[], options: {
|
|
13
|
+
detached: true;
|
|
14
|
+
stdio: 'ignore';
|
|
15
|
+
}): BrowserChild;
|
|
16
|
+
}
|
|
5
17
|
export declare function getOpenBrowserCommand(targetPlatform: NodeJS.Platform, url: string): OpenBrowserCommand;
|
|
18
|
+
export declare function openBrowserWithDependencies(url: string, dependencies: BrowserDependencies): Promise<boolean>;
|
|
6
19
|
export declare function openBrowser(url: string): Promise<boolean>;
|
|
20
|
+
export {};
|
|
7
21
|
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/cli/browser.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,MAAM,CAAC,QAAQ,EAC/B,GAAG,EAAE,MAAM,GACV,kBAAkB,CAUpB;AAED,
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/cli/browser.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,YAAY;IACpB,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACjD,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACjD,KAAK,IAAI,IAAI,CAAC;CACf;AAED,UAAU,mBAAmB;IAC3B,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC;IAC/B,YAAY,CACV,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE;QAAE,QAAQ,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,QAAQ,CAAA;KAAE,GAC3C,YAAY,CAAC;CACjB;AAED,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,MAAM,CAAC,QAAQ,EAC/B,GAAG,EAAE,MAAM,GACV,kBAAkB,CAUpB;AAED,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,mBAAmB,GAChC,OAAO,CAAC,OAAO,CAAC,CA0BlB;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,oBAKtC"}
|
package/dist/cli/browser.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getOpenBrowserCommand = getOpenBrowserCommand;
|
|
4
|
+
exports.openBrowserWithDependencies = openBrowserWithDependencies;
|
|
4
5
|
exports.openBrowser = openBrowser;
|
|
5
6
|
const node_child_process_1 = require("node:child_process");
|
|
6
7
|
const node_os_1 = require("node:os");
|
|
@@ -13,18 +14,34 @@ function getOpenBrowserCommand(targetPlatform, url) {
|
|
|
13
14
|
}
|
|
14
15
|
return { command: 'xdg-open', args: [url] };
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
const { command, args } = getOpenBrowserCommand(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
function openBrowserWithDependencies(url, dependencies) {
|
|
18
|
+
const { command, args } = getOpenBrowserCommand(dependencies.getPlatform(), url);
|
|
19
|
+
return new Promise((resolve) => {
|
|
20
|
+
let settled = false;
|
|
21
|
+
const settle = (result) => {
|
|
22
|
+
if (settled)
|
|
23
|
+
return;
|
|
24
|
+
settled = true;
|
|
25
|
+
resolve(result);
|
|
26
|
+
};
|
|
27
|
+
try {
|
|
28
|
+
const child = dependencies.spawnProcess(command, args, {
|
|
29
|
+
detached: true,
|
|
30
|
+
stdio: 'ignore',
|
|
31
|
+
});
|
|
32
|
+
child.once('error', () => settle(false));
|
|
33
|
+
child.once('spawn', () => settle(true));
|
|
34
|
+
child.unref();
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
settle(false);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function openBrowser(url) {
|
|
42
|
+
return openBrowserWithDependencies(url, {
|
|
43
|
+
getPlatform: node_os_1.platform,
|
|
44
|
+
spawnProcess: (command, args, options) => (0, node_child_process_1.spawn)(command, args, options),
|
|
45
|
+
});
|
|
29
46
|
}
|
|
30
47
|
//# sourceMappingURL=browser.js.map
|
package/dist/cli/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/cli/browser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/cli/browser.ts"],"names":[],"mappings":";;;;;AAAA,2DAA2C;AAC3C,qCAAmC;AAsBnC,+BACE,c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M,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,qBAA4B,GAAW;IACrC,OAAO,2BAA2B,CAAC,GAAG,EAAE;QACtC,WAAW,EAAE,kBAAQ;QACrB,YAAY,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,0BAAK,EAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC;KACxE,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tuturuuu",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"description": "Official TypeScript/JavaScript SDK for the Tuturuuu platform",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Tuturuuu",
|
|
@@ -104,9 +104,9 @@
|
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
106
|
"@tuturuuu/devbox": "0.3.1",
|
|
107
|
-
"@tuturuuu/internal-api": "0.
|
|
108
|
-
"@tuturuuu/types": "0.
|
|
109
|
-
"@tuturuuu/utils": "0.
|
|
107
|
+
"@tuturuuu/internal-api": "0.29.1",
|
|
108
|
+
"@tuturuuu/types": "0.27.0",
|
|
109
|
+
"@tuturuuu/utils": "0.24.2",
|
|
110
110
|
"yaml": "^2.9.0",
|
|
111
111
|
"zod": "^4.4.3"
|
|
112
112
|
},
|