@cobol-ts/project-replay-local 0.0.0-stage → 0.0.59
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 +3 -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.local.d.ts +3 -0
- package/dist/src/replay.local.js +11 -0
- package/dist/src/replay.local.js.map +1 -0
- package/dist/src/replay.local.spec.d.ts +1 -0
- package/dist/src/replay.local.spec.js +39 -0
- package/dist/src/replay.local.spec.js.map +1 -0
- package/index.ts +1 -0
- package/package.json +65 -3
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# project-replay-local
|
|
2
|
+
|
|
3
|
+
Local replay planning assembly. Select these local bindings at the application edge; do not import them from portable workflows.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/replay.local';
|
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.local"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.projectReplayPlan = projectReplayPlan;
|
|
4
|
+
const yaml_jsyaml_1 = require("@cobol-ts/yaml-jsyaml");
|
|
5
|
+
const files_node_1 = require("@cobol-ts/files-node");
|
|
6
|
+
const project_oracle_local_1 = require("@cobol-ts/project-oracle-local");
|
|
7
|
+
const project_replay_1 = require("@cobol-ts/project-replay");
|
|
8
|
+
function projectReplayPlan(paths, read = files_node_1.nodeTextFiles.read) {
|
|
9
|
+
return (0, project_replay_1.projectReplayPlanWith)(paths, read, () => (0, project_oracle_local_1.initializeOracleFromPaths)(paths), yaml_jsyaml_1.jsYamlParser);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=replay.local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.local.js","sourceRoot":"","sources":["../../src/replay.local.ts"],"names":[],"mappings":";;AAOA,8CAEC;AATD,uDAAkD;AAClD,qDAAkD;AAElD,yEAAwE;AAExE,6DAA8D;AAE9D,SAAgB,iBAAiB,CAAC,KAAkB,EAAC,OAAuB,0BAAa,CAAC,IAAI;IAC1F,OAAO,IAAA,sCAAqB,EAAC,KAAK,EAAC,IAAI,EAAC,GAAE,EAAE,CAAA,IAAA,gDAAyB,EAAC,KAAK,CAAC,EAAC,0BAAY,CAAC,CAAA;AAC9F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const index_1 = require("../index");
|
|
4
|
+
const project_replay_1 = require("@cobol-ts/project-replay");
|
|
5
|
+
const project_oracle_local_1 = require("@cobol-ts/project-oracle-local");
|
|
6
|
+
const files_node_1 = require("@cobol-ts/files-node");
|
|
7
|
+
const yaml_jsyaml_1 = require("@cobol-ts/yaml-jsyaml");
|
|
8
|
+
jest.mock('@cobol-ts/project-replay', () => ({ projectReplayPlanWith: jest.fn() }));
|
|
9
|
+
jest.mock('@cobol-ts/project-oracle-local', () => ({ initializeOracleFromPaths: jest.fn() }));
|
|
10
|
+
const paths = {
|
|
11
|
+
directory: 'config', projectRoot: 'project', catalogue: 'files.yaml',
|
|
12
|
+
policy: 'generation.yaml', data: 'data.yaml', accumulator: 'accumulator.yaml'
|
|
13
|
+
};
|
|
14
|
+
const plan = jest.mocked(project_replay_1.projectReplayPlanWith);
|
|
15
|
+
const initialize = jest.mocked(project_oracle_local_1.initializeOracleFromPaths);
|
|
16
|
+
beforeEach(() => jest.resetAllMocks());
|
|
17
|
+
test('assembles the replay planner with the local text reader and YAML parser', async () => {
|
|
18
|
+
const events = [{ composition: 'D', date: '2026-01-01', periodicity: 'daily' }];
|
|
19
|
+
plan.mockResolvedValue(events);
|
|
20
|
+
await expect((0, index_1.projectReplayPlan)(paths)).resolves.toBe(events);
|
|
21
|
+
expect(plan).toHaveBeenCalledTimes(1);
|
|
22
|
+
expect(plan).toHaveBeenCalledWith(paths, files_node_1.nodeTextFiles.read, expect.any(Function), yaml_jsyaml_1.jsYamlParser);
|
|
23
|
+
expect(initialize).not.toHaveBeenCalled();
|
|
24
|
+
});
|
|
25
|
+
test('preserves an injected reader and initializes the oracle only when requested', async () => {
|
|
26
|
+
const read = jest.fn(async (_filename) => 'replay configuration');
|
|
27
|
+
const failure = new Error('oracle unavailable');
|
|
28
|
+
initialize.mockRejectedValue(failure);
|
|
29
|
+
plan.mockImplementation(async (_paths, _read, oracle) => {
|
|
30
|
+
expect(initialize).not.toHaveBeenCalled();
|
|
31
|
+
await oracle();
|
|
32
|
+
return [];
|
|
33
|
+
});
|
|
34
|
+
await expect((0, index_1.projectReplayPlan)(paths, read)).rejects.toBe(failure);
|
|
35
|
+
expect(plan).toHaveBeenCalledWith(paths, read, expect.any(Function), yaml_jsyaml_1.jsYamlParser);
|
|
36
|
+
expect(initialize).toHaveBeenCalledTimes(1);
|
|
37
|
+
expect(initialize).toHaveBeenCalledWith(paths);
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=replay.local.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.local.spec.js","sourceRoot":"","sources":["../../src/replay.local.spec.ts"],"names":[],"mappings":";;AAAA,oCAA0C;AAC1C,6DAA8D;AAC9D,yEAAwE;AACxE,qDAAkD;AAClD,uDAAkD;AAGlD,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,GAAG,EAAE,CAAC,CAAC,EAAC,qBAAqB,EAAE,IAAI,CAAC,EAAE,EAAE,EAAC,CAAC,CAAC,CAAA;AACjF,IAAI,CAAC,IAAI,CAAC,gCAAgC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAC,yBAAyB,EAAE,IAAI,CAAC,EAAE,EAAE,EAAC,CAAC,CAAC,CAAA;AAE3F,MAAM,KAAK,GAAiB;IACxB,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY;IACpE,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB;CAChF,CAAA;AACD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,sCAAqB,CAAC,CAAA;AAC/C,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,gDAAyB,CAAC,CAAA;AAEzD,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAA;AAEtC,IAAI,CAAC,yEA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AC,OAAO,CAAC,CAAA;IAClE,MAAM,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,0BAAY,CAAC,CAAA;IAClF,MAAM,CAAC,UAAU,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;IAC3C,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAA;AAClD,CAAC,CAAC,CAAA"}
|
package/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/replay.local'
|
package/package.json
CHANGED
|
@@ -1,6 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cobol-ts/project-replay-local",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"description": "Local replay planning assembly",
|
|
4
|
+
"version": "0.0.59",
|
|
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
|
+
"@cobol-ts/files": "0.0.59",
|
|
21
|
+
"@cobol-ts/files-node": "0.0.59",
|
|
22
|
+
"@cobol-ts/project-context": "0.0.59",
|
|
23
|
+
"@cobol-ts/project-oracle-local": "0.0.59",
|
|
24
|
+
"@cobol-ts/project-replay": "0.0.59",
|
|
25
|
+
"@cobol-ts/yaml-jsyaml": "0.0.59"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@testing-library/jest-dom": "^6.1.4",
|
|
29
|
+
"@types/jest": "^29.0.0",
|
|
30
|
+
"@types/node": "^20.0.0",
|
|
31
|
+
"jest": "^29.0.0",
|
|
32
|
+
"ts-jest": "^29.0.0",
|
|
33
|
+
"typescript": "^5.2.2"
|
|
34
|
+
},
|
|
35
|
+
"eslintConfig": {
|
|
36
|
+
"extends": [
|
|
37
|
+
"react-app",
|
|
38
|
+
"react-app/jest"
|
|
39
|
+
],
|
|
40
|
+
"overrides": [
|
|
41
|
+
{
|
|
42
|
+
"files": [
|
|
43
|
+
"**/*.stories.*"
|
|
44
|
+
],
|
|
45
|
+
"rules": {
|
|
46
|
+
"import/no-anonymous-default-export": "off"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"files": [
|
|
52
|
+
"dist/index.js",
|
|
53
|
+
"dist/index.d.ts",
|
|
54
|
+
"dist/src/",
|
|
55
|
+
"dist/",
|
|
56
|
+
"dist/**/*"
|
|
57
|
+
],
|
|
58
|
+
"keywords": [
|
|
59
|
+
"indexing"
|
|
60
|
+
],
|
|
61
|
+
"license": "MIT",
|
|
62
|
+
"module": "./index.ts",
|
|
63
|
+
"repository": "git@github.com:intellimaintain/intellimaintain.git",
|
|
64
|
+
"scripts": {
|
|
65
|
+
"test": "jest --config jest.config.json --env node",
|
|
66
|
+
"test:watch": "npm run test -- --watch"
|
|
67
|
+
}
|
|
6
68
|
}
|