@quantform/core 0.7.0-beta.42 → 0.7.0-beta.44
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/internal/script.d.ts.map +1 -1
- package/dist/cli/internal/script.js +2 -1
- package/dist/replay/index.d.ts +1 -0
- package/dist/replay/index.d.ts.map +1 -1
- package/dist/replay/index.js +1 -0
- package/dist/replay/use-replay-manager.d.ts +16 -0
- package/dist/replay/use-replay-manager.d.ts.map +1 -1
- package/dist/replay/use-replay-manager.js +1 -0
- package/dist/replay/when-replay-finished.d.ts +2 -0
- package/dist/replay/when-replay-finished.d.ts.map +1 -0
- package/dist/replay/when-replay-finished.js +15 -0
- package/package.json +1 -1
- package/src/cli/internal/script.ts +2 -0
- package/src/replay/index.ts +1 -0
- package/src/replay/use-replay-manager.ts +1 -0
- package/src/replay/when-replay-finished.ts +20 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../src/cli/internal/script.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAU,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../src/cli/internal/script.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAU,MAAM,aAAa,CAAC;AAKjD,qBAAa,MAAM;IAEf,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,UAAU,EAAE;IAGvC,GAAG;CA0BV"}
|
|
@@ -37,6 +37,7 @@ const path_1 = require("path");
|
|
|
37
37
|
const rxjs_1 = require("rxjs");
|
|
38
38
|
const core_1 = require("../../core");
|
|
39
39
|
const module_1 = require("../../module");
|
|
40
|
+
const replay_1 = require("../../replay");
|
|
40
41
|
const workspace_1 = require("./workspace");
|
|
41
42
|
class Script {
|
|
42
43
|
constructor(name, dependencies) {
|
|
@@ -50,7 +51,7 @@ class Script {
|
|
|
50
51
|
const { act } = yield module.awake();
|
|
51
52
|
return yield act(() => {
|
|
52
53
|
process.stdin.resume();
|
|
53
|
-
return (0, rxjs_1.firstValueFrom)((0, rxjs_1.merge)(script.onAwake().pipe((0, rxjs_1.last)()), (0, rxjs_1.fromEvent)(process, 'exit'), (0, rxjs_1.fromEvent)(process, 'SIGINT'), (0, rxjs_1.fromEvent)(process, 'SIGUSR1'), (0, rxjs_1.fromEvent)(process, 'SIGUSR2'), (0, rxjs_1.fromEvent)(process, 'uncaughtException')).pipe((0, rxjs_1.take)(1), (0, rxjs_1.switchMap)(it => { var _a; return (_a = script.onExit()) !== null && _a !== void 0 ? _a : (0, rxjs_1.of)(it); }), (0, rxjs_1.finalize)(() => process.exit(0))));
|
|
54
|
+
return (0, rxjs_1.firstValueFrom)((0, rxjs_1.merge)(script.onAwake().pipe((0, rxjs_1.last)()), (0, replay_1.whenReplayFinished)().pipe((0, rxjs_1.last)()), (0, rxjs_1.fromEvent)(process, 'exit'), (0, rxjs_1.fromEvent)(process, 'SIGINT'), (0, rxjs_1.fromEvent)(process, 'SIGUSR1'), (0, rxjs_1.fromEvent)(process, 'SIGUSR2'), (0, rxjs_1.fromEvent)(process, 'uncaughtException')).pipe((0, rxjs_1.take)(1), (0, rxjs_1.switchMap)(it => { var _a; return (_a = script.onExit()) !== null && _a !== void 0 ? _a : (0, rxjs_1.of)(it); }), (0, rxjs_1.finalize)(() => process.exit(0))));
|
|
54
55
|
});
|
|
55
56
|
});
|
|
56
57
|
}
|
package/dist/replay/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './use-replay-options';
|
|
|
4
4
|
export * from './use-replay-storage';
|
|
5
5
|
export * from './use-replay-storage-buffer';
|
|
6
6
|
export * from './use-replay-manager';
|
|
7
|
+
export * from './when-replay-finished';
|
|
7
8
|
export * from './replay';
|
|
8
9
|
export * from './replay-guard';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/replay/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/replay/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
package/dist/replay/index.js
CHANGED
|
@@ -20,5 +20,6 @@ __exportStar(require("./use-replay-options"), exports);
|
|
|
20
20
|
__exportStar(require("./use-replay-storage"), exports);
|
|
21
21
|
__exportStar(require("./use-replay-storage-buffer"), exports);
|
|
22
22
|
__exportStar(require("./use-replay-manager"), exports);
|
|
23
|
+
__exportStar(require("./when-replay-finished"), exports);
|
|
23
24
|
__exportStar(require("./replay"), exports);
|
|
24
25
|
__exportStar(require("./replay-guard"), exports);
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { dependency } from '../use-hash';
|
|
3
3
|
export declare const useReplayManager: () => {
|
|
4
|
+
stream: Observable<[{
|
|
5
|
+
size(): number;
|
|
6
|
+
peek(): {
|
|
7
|
+
timestamp: number;
|
|
8
|
+
payload: any;
|
|
9
|
+
};
|
|
10
|
+
dequeue(): {
|
|
11
|
+
timestamp: number;
|
|
12
|
+
payload: any;
|
|
13
|
+
};
|
|
14
|
+
completed(): boolean;
|
|
15
|
+
fetchNextPage(from: number, to: number): Promise<void>;
|
|
16
|
+
}, {
|
|
17
|
+
timestamp: number;
|
|
18
|
+
payload: any;
|
|
19
|
+
}]>;
|
|
4
20
|
timestamp(): number;
|
|
5
21
|
stop(): void;
|
|
6
22
|
tryContinue: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-replay-manager.d.ts","sourceRoot":"","sources":["../../src/replay/use-replay-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,UAAU,EAAW,MAAM,MAAM,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAW,MAAM,eAAe,CAAC;AAOpD,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"use-replay-manager.d.ts","sourceRoot":"","sources":["../../src/replay/use-replay-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,UAAU,EAAW,MAAM,MAAM,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAW,MAAM,eAAe,CAAC;AAOpD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;mBASqC,MAAM;iBAAW,GAAG;;;;;0BAsE5D,UAAU,EAAE;mBAA2B,MAAM;;;CAkBrE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"when-replay-finished.d.ts","sourceRoot":"","sources":["../../src/replay/when-replay-finished.ts"],"names":[],"mappings":"AAMA,wBAAgB,kBAAkB,uCAajC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.whenReplayFinished = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const use_execution_mode_1 = require("../use-execution-mode");
|
|
6
|
+
const use_replay_manager_1 = require("./use-replay-manager");
|
|
7
|
+
function whenReplayFinished() {
|
|
8
|
+
const { isReplay } = (0, use_execution_mode_1.useExecutionMode)();
|
|
9
|
+
if (!isReplay) {
|
|
10
|
+
return new rxjs_1.Subject().asObservable();
|
|
11
|
+
}
|
|
12
|
+
const { stream } = (0, use_replay_manager_1.useReplayManager)();
|
|
13
|
+
return (0, rxjs_1.from)(stream).pipe((0, rxjs_1.last)(), (0, rxjs_1.map)(() => true));
|
|
14
|
+
}
|
|
15
|
+
exports.whenReplayFinished = whenReplayFinished;
|
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
|
|
13
13
|
import { core } from '@lib/core';
|
|
14
14
|
import { Dependency, Module } from '@lib/module';
|
|
15
|
+
import { whenReplayFinished } from '@lib/replay';
|
|
15
16
|
|
|
16
17
|
import { buildDirectory } from './workspace';
|
|
17
18
|
|
|
@@ -33,6 +34,7 @@ export class Script {
|
|
|
33
34
|
return firstValueFrom(
|
|
34
35
|
merge(
|
|
35
36
|
script.onAwake().pipe(last()),
|
|
37
|
+
whenReplayFinished().pipe(last()),
|
|
36
38
|
fromEvent(process, 'exit'),
|
|
37
39
|
fromEvent(process, 'SIGINT'),
|
|
38
40
|
fromEvent(process, 'SIGUSR1'),
|
package/src/replay/index.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { from, last, map, Subject } from 'rxjs';
|
|
2
|
+
|
|
3
|
+
import { useExecutionMode } from '@lib/use-execution-mode';
|
|
4
|
+
|
|
5
|
+
import { useReplayManager } from './use-replay-manager';
|
|
6
|
+
|
|
7
|
+
export function whenReplayFinished() {
|
|
8
|
+
const { isReplay } = useExecutionMode();
|
|
9
|
+
|
|
10
|
+
if (!isReplay) {
|
|
11
|
+
return new Subject<boolean>().asObservable();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { stream } = useReplayManager();
|
|
15
|
+
|
|
16
|
+
return from(stream).pipe(
|
|
17
|
+
last(),
|
|
18
|
+
map(() => true)
|
|
19
|
+
);
|
|
20
|
+
}
|