@cobol-ts/cli-replay 0.0.0-stage → 0.0.57
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 +11 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/src/replay.command.spec.d.ts +1 -0
- package/dist/src/replay.command.spec.js +20 -0
- package/dist/src/replay.command.spec.js.map +1 -0
- package/dist/src/replay.d.ts +6 -0
- package/dist/src/replay.js +18 -0
- package/dist/src/replay.js.map +1 -0
- package/index.ts +1 -0
- package/package.json +63 -3
package/README.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# @cobol-ts/cli-replay
|
|
2
|
+
|
|
3
|
+
Historical replay command adapter. Commander registration and output belong here; project capabilities remain in the corresponding project library.
|
|
4
|
+
|
|
5
|
+
`replay plan` delegates ordering of observed executions to `projectReplayPlan` and prints the date and composition; `--json` emits the structured plan. It does not decode records, execute CEL or modify published observations.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
yarn cobolts -d modules/examples/init replay plan --json
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
See the [CLI reference](../cobolts/README.md) for the complete command options.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/replay';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./src/replay"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const commander_1 = require("commander");
|
|
4
|
+
const project_replay_local_1 = require("@cobol-ts/project-replay-local");
|
|
5
|
+
const replay_1 = require("./replay");
|
|
6
|
+
jest.mock('@cobol-ts/project-replay-local', () => ({ projectReplayPlan: jest.fn() }));
|
|
7
|
+
const paths = { projectRoot: 'project', directory: 'project/.cobolts', catalogue: 'files.yaml', policy: 'generation.yaml', data: 'data.yaml', accumulator: 'accumulator.yaml' };
|
|
8
|
+
const plan = [{ date: '2026-01-01', composition: 'daily', periodicity: 'daily' }, { date: '2026-01-31', composition: 'monthly', periodicity: 'monthly' }];
|
|
9
|
+
test.each([false, true])('formats the ordered replay plan (json=%s)', async (json) => {
|
|
10
|
+
const options = { directory: 'project' };
|
|
11
|
+
const resolvePaths = jest.fn(async () => paths), output = jest.fn();
|
|
12
|
+
jest.mocked(project_replay_local_1.projectReplayPlan).mockResolvedValueOnce(plan);
|
|
13
|
+
const root = new commander_1.Command();
|
|
14
|
+
(0, replay_1.addReplay)(root, { paths: resolvePaths, output }, () => options);
|
|
15
|
+
await root.parseAsync(['replay', 'plan', ...(json ? ['--json'] : [])], { from: 'user' });
|
|
16
|
+
expect(resolvePaths).toHaveBeenCalledWith(options);
|
|
17
|
+
expect(project_replay_local_1.projectReplayPlan).toHaveBeenCalledWith(paths);
|
|
18
|
+
expect(output.mock.calls).toEqual(json ? [[JSON.stringify(plan, null, 2)]] : plan.map(event => [`${event.date} ${event.composition}`]));
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=replay.command.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.command.spec.js","sourceRoot":"","sources":["../../src/replay.command.spec.ts"],"names":[],"mappings":";;AAAA,yCAAiC;AAEjC,yEAAgE;AAChE,qCAAkC;AAElC,IAAI,CAAC,IAAI,CAAC,gCAAgC,EAAC,GAAE,EAAE,CAAA,CAAC,EAAC,iBAAiB,EAAC,IAAI,CAAC,EAAE,EAAE,EAAC,CAAC,CAAC,CAAA;AAC/E,MAAM,KAAK,GAAU,EAAC,WAAW,EAAC,SAAS,EAAC,SAAS,EAAC,kBAAkB,EAAC,SAAS,EAAC,YAAY,EAAC,MAAM,EAAC,iBAAiB,EAAC,IAAI,EAAC,WAAW,EAAC,WAAW,EAAC,kBAAkB,EAAC,CAAA;AACzK,MAAM,IAAI,GAAC,CAAC,EAAC,IAAI,EAAC,YAAY,EAAC,WAAW,EAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAC,EAAC,EAAC,IAAI,EAAC,YAAY,EAAC,WAAW,EAAC,SAAS,EAAC,WAAW,EAAC,SAAS,EAAC,CAAC,CAAA;AACxI,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,EAAC,IAAI,CAAC,CAAC,CAAC,2CAA2C,EAAC,KAAK,EAAC,IAAI,EAAA,EAAE;IAC5E,MAAM,OAAO,GAAC,EAAC,SAAS,EAAC,SAAS,EAAC,CAAA;IACnC,MAAM,YAAY,GAAC,IAAI,CAAC,EAAE,CAAC,KAAK,IAAE,EAAE,CAAA,KAAK,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5D,IAAI,CAAC,MAAM,CAAC,wCAAiB,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;IAC1D,MAAM,IAAI,GAAC,IAAI,mBAAO,EAAE,CAAA;IACxB,IAAA,kBAAS,EAAC,IAAI,EAAC,EAAC,KAAK,EAAC,YAAY,EAAC,MAAM,EAAC,EAAC,GAAE,EAAE,CAAA,OAAO,CAAC,CAAA;IACvD,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAC,MAAM,EAAC,GAAG,CAAC,IAAI,CAAA,CAAC,CAAA,CAAC,QAAQ,CAAC,CAAA,CAAC,CAAA,EAAE,CAAC,CAAC,EAAC,EAAC,IAAI,EAAC,MAAM,EAAC,CAAC,CAAA;IAC9E,MAAM,CAAC,YAAY,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAA;IAClD,MAAM,CAAC,wCAAiB,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAA;IACrD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAA,CAAC,CAAA,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAC,IAAI,EAAC,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC,CAAA,IAAI,CAAC,GAAG,CAAC,KAAK,CAAA,EAAE,CAAA,CAAC,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAA;AACnI,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addReplay = addReplay;
|
|
4
|
+
const project_replay_local_1 = require("@cobol-ts/project-replay-local");
|
|
5
|
+
function addReplay(root, services, options) {
|
|
6
|
+
root.command('replay').description('Inspect the configured historical execution order')
|
|
7
|
+
.command('plan').description('List observed production executions in replay order')
|
|
8
|
+
.option('--json', 'Emit the ordered plan as JSON')
|
|
9
|
+
.action(async ({ json }) => {
|
|
10
|
+
const plan = await (0, project_replay_local_1.projectReplayPlan)(await services.paths(options()));
|
|
11
|
+
if (json)
|
|
12
|
+
services.output(JSON.stringify(plan, null, 2));
|
|
13
|
+
else
|
|
14
|
+
for (const event of plan)
|
|
15
|
+
services.output(`${event.date} ${event.composition}`);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=replay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.js","sourceRoot":"","sources":["../../src/replay.ts"],"names":[],"mappings":";;AAIA,8BASC;AAXD,yEAAgE;AAEhE,SAAgB,SAAS,CAAC,IAAa,EAAE,QAA0D,EAAE,OAAyB;IAC1H,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,mDAAmD,CAAC;SAClF,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,qDAAqD,CAAC;SAClF,MAAM,CAAC,QAAQ,EAAE,+BAA+B,CAAC;SACjD,MAAM,CAAC,KAAK,EAAE,EAAC,IAAI,EAAmB,EAAE,EAAE;QACvC,MAAM,IAAI,GAAG,MAAM,IAAA,wCAAiB,EAAC,MAAM,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;QACrE,IAAI,IAAI;YAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;;YACnD,KAAK,MAAM,KAAK,IAAI,IAAI;gBAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC,CAAA;IACxF,CAAC,CAAC,CAAA;AACV,CAAC"}
|
package/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/replay'
|
package/package.json
CHANGED
|
@@ -1,6 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cobol-ts/cli-replay",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"description": "Historical replay command adapter",
|
|
4
|
+
"version": "0.0.57",
|
|
5
|
+
"main": "dist/index",
|
|
6
|
+
"types": "dist/index",
|
|
7
|
+
"browserslist": {
|
|
8
|
+
"development": [
|
|
9
|
+
"last 1 chrome version",
|
|
10
|
+
"last 1 firefox version",
|
|
11
|
+
"last 1 safari version"
|
|
12
|
+
],
|
|
13
|
+
"production": [
|
|
14
|
+
">0.2%",
|
|
15
|
+
"not dead",
|
|
16
|
+
"not op_mini all"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"commander": "^12.1.0",
|
|
21
|
+
"@cobol-ts/cli-common": "0.0.57",
|
|
22
|
+
"@cobol-ts/project-replay": "0.0.57",
|
|
23
|
+
"@cobol-ts/project-replay-local": "0.0.57"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"typescript": "^5.2.2",
|
|
27
|
+
"@testing-library/jest-dom": "^6.1.4",
|
|
28
|
+
"@types/jest": "^29.0.0",
|
|
29
|
+
"@types/node": "^20.0.0",
|
|
30
|
+
"jest": "^29.0.0",
|
|
31
|
+
"ts-jest": "^29.0.0"
|
|
32
|
+
},
|
|
33
|
+
"eslintConfig": {
|
|
34
|
+
"extends": [
|
|
35
|
+
"react-app",
|
|
36
|
+
"react-app/jest"
|
|
37
|
+
],
|
|
38
|
+
"overrides": [
|
|
39
|
+
{
|
|
40
|
+
"files": [
|
|
41
|
+
"**/*.stories.*"
|
|
42
|
+
],
|
|
43
|
+
"rules": {
|
|
44
|
+
"import/no-anonymous-default-export": "off"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"files": [
|
|
50
|
+
"dist/index.js",
|
|
51
|
+
"dist/index.d.ts",
|
|
52
|
+
"dist/src/",
|
|
53
|
+
"dist/",
|
|
54
|
+
"dist/**/*"
|
|
55
|
+
],
|
|
56
|
+
"keywords": [
|
|
57
|
+
"indexing"
|
|
58
|
+
],
|
|
59
|
+
"license": "MIT",
|
|
60
|
+
"module": "./index.ts",
|
|
61
|
+
"repository": "git@github.com:intellimaintain/intellimaintain.git",
|
|
62
|
+
"scripts": {
|
|
63
|
+
"test": "jest --config jest.config.json --env node",
|
|
64
|
+
"test:watch": "npm run test -- --watch"
|
|
65
|
+
}
|
|
6
66
|
}
|