@backtest-kit/ui 12.5.0 → 12.7.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/build/index.cjs +8 -3
- package/build/index.mjs +8 -3
- package/package.json +3 -3
- package/types.d.ts +2 -1
package/build/index.cjs
CHANGED
|
@@ -4955,10 +4955,15 @@ const METHOD_NAME_SERVE = "serve.serve";
|
|
|
4955
4955
|
const METHOD_NAME_GET_ROUTER = "serve.getRouter";
|
|
4956
4956
|
const MAX_CONNECTIONS = 1000;
|
|
4957
4957
|
const SOCKET_TIMEOUT = 60 * 10 * 1000;
|
|
4958
|
-
const serveInternal = functoolsKit.singleshot((host = CC_WWWROOT_HOST, port = CC_WWWROOT_PORT) => {
|
|
4958
|
+
const serveInternal = functoolsKit.singleshot((host = CC_WWWROOT_HOST, port = CC_WWWROOT_PORT, callback) => {
|
|
4959
4959
|
const server = new http.Server(router$1);
|
|
4960
4960
|
server.listen(port, host).addListener("listening", () => {
|
|
4961
4961
|
console.log(`Listening on http://${host}:${port}`);
|
|
4962
|
+
callback && callback();
|
|
4963
|
+
});
|
|
4964
|
+
server.addListener("error", (err) => {
|
|
4965
|
+
console.error("Server error:", err);
|
|
4966
|
+
callback && callback(err);
|
|
4962
4967
|
});
|
|
4963
4968
|
server.maxConnections = MAX_CONNECTIONS;
|
|
4964
4969
|
server.setTimeout(SOCKET_TIMEOUT);
|
|
@@ -4967,13 +4972,13 @@ const serveInternal = functoolsKit.singleshot((host = CC_WWWROOT_HOST, port = CC
|
|
|
4967
4972
|
serveInternal.clear();
|
|
4968
4973
|
};
|
|
4969
4974
|
});
|
|
4970
|
-
function serve(host, port, cwd = process.cwd()) {
|
|
4975
|
+
function serve(host, port, cwd = process.cwd(), callback) {
|
|
4971
4976
|
ioc.loggerService.log(METHOD_NAME_SERVE, {
|
|
4972
4977
|
host,
|
|
4973
4978
|
port,
|
|
4974
4979
|
});
|
|
4975
4980
|
serveSubject.next(cwd);
|
|
4976
|
-
return serveInternal(host, port);
|
|
4981
|
+
return serveInternal(host, port, callback);
|
|
4977
4982
|
}
|
|
4978
4983
|
function getRouter() {
|
|
4979
4984
|
ioc.loggerService.log(METHOD_NAME_GET_ROUTER);
|
package/build/index.mjs
CHANGED
|
@@ -4934,10 +4934,15 @@ const METHOD_NAME_SERVE = "serve.serve";
|
|
|
4934
4934
|
const METHOD_NAME_GET_ROUTER = "serve.getRouter";
|
|
4935
4935
|
const MAX_CONNECTIONS = 1000;
|
|
4936
4936
|
const SOCKET_TIMEOUT = 60 * 10 * 1000;
|
|
4937
|
-
const serveInternal = singleshot((host = CC_WWWROOT_HOST, port = CC_WWWROOT_PORT) => {
|
|
4937
|
+
const serveInternal = singleshot((host = CC_WWWROOT_HOST, port = CC_WWWROOT_PORT, callback) => {
|
|
4938
4938
|
const server = new http.Server(router$1);
|
|
4939
4939
|
server.listen(port, host).addListener("listening", () => {
|
|
4940
4940
|
console.log(`Listening on http://${host}:${port}`);
|
|
4941
|
+
callback && callback();
|
|
4942
|
+
});
|
|
4943
|
+
server.addListener("error", (err) => {
|
|
4944
|
+
console.error("Server error:", err);
|
|
4945
|
+
callback && callback(err);
|
|
4941
4946
|
});
|
|
4942
4947
|
server.maxConnections = MAX_CONNECTIONS;
|
|
4943
4948
|
server.setTimeout(SOCKET_TIMEOUT);
|
|
@@ -4946,13 +4951,13 @@ const serveInternal = singleshot((host = CC_WWWROOT_HOST, port = CC_WWWROOT_PORT
|
|
|
4946
4951
|
serveInternal.clear();
|
|
4947
4952
|
};
|
|
4948
4953
|
});
|
|
4949
|
-
function serve(host, port, cwd = process.cwd()) {
|
|
4954
|
+
function serve(host, port, cwd = process.cwd(), callback) {
|
|
4950
4955
|
ioc.loggerService.log(METHOD_NAME_SERVE, {
|
|
4951
4956
|
host,
|
|
4952
4957
|
port,
|
|
4953
4958
|
});
|
|
4954
4959
|
serveSubject.next(cwd);
|
|
4955
|
-
return serveInternal(host, port);
|
|
4960
|
+
return serveInternal(host, port, callback);
|
|
4956
4961
|
}
|
|
4957
4962
|
function getRouter() {
|
|
4958
4963
|
ioc.loggerService.log(METHOD_NAME_GET_ROUTER);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backtest-kit/ui",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.7.0",
|
|
4
4
|
"description": "Full-stack UI framework for visualizing cryptocurrency trading signals, backtests, and real-time market data. React dashboard with candlestick charts, signal tracking, and risk analysis.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Petr Tripolsky",
|
|
@@ -92,11 +92,11 @@
|
|
|
92
92
|
"ccxt": "4.5.24",
|
|
93
93
|
"touch": "3.1.1",
|
|
94
94
|
"worker-testbed": "2.0.0",
|
|
95
|
-
"backtest-kit": "12.
|
|
95
|
+
"backtest-kit": "12.7.0",
|
|
96
96
|
"markdown-it": "14.1.0"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
|
-
"backtest-kit": "^12.
|
|
99
|
+
"backtest-kit": "^12.7.0",
|
|
100
100
|
"markdown-it": "^14.1.0",
|
|
101
101
|
"ccxt": "^4.5.24",
|
|
102
102
|
"typescript": "^5.0.0"
|
package/types.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import * as backtest_kit from 'backtest-kit';
|
|
|
3
3
|
import { CandleInterval, NotificationModel, IStorageSignalRow, ILogEntry, IPublicSignalRow, IRuntimeInfo } from 'backtest-kit';
|
|
4
4
|
import * as functools_kit from 'functools-kit';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type CallbackFn = (error?: Error) => void;
|
|
7
|
+
declare function serve(host?: string, port?: number, cwd?: string, callback?: CallbackFn): () => void;
|
|
7
8
|
declare function getRouter(): http.RequestListener;
|
|
8
9
|
|
|
9
10
|
interface ILogger {
|