Skip to content

Commit

Permalink
feat: init execution-engine library
Browse files Browse the repository at this point in the history
  • Loading branch information
tabkram committed Nov 18, 2023
0 parents commit 8243be4
Show file tree
Hide file tree
Showing 16 changed files with 10,300 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .gitignore
@@ -0,0 +1,24 @@
.DS_Store
*.iml
.idea
.idea/**
report.**.json

# Ignore yarn error logs
**/yarn-error.log

# Ignore js files
**/src/**/*.js
**/src/**/*.js.map

# Node modules
**/node_modules

# Work folders
**/lib
**/dist

# Yarn
.yarn
.yarn-cache/

41 changes: 41 additions & 0 deletions README.md
@@ -0,0 +1,41 @@
# Execution Engine

Execution Engine is a TypeScript library that enables tracing and visualization of code execution workflows in projects with multiple successive and embedded TypeScript modules. Gain insights into the dynamic sequence of code execution by capturing detailed traces in JSON format, easily parseable into graphs.

## Features ✨

- **Code Tracing:** Trace the execution flow of TypeScript code in your project.
- **Visualization:** Generate JSON traces for clear visualization of code execution paths.
- **Versatile Integration:** Seamless integration with projects using TypeScript.

## Installation 📦

```bash
npm install execution-engine
```

## Usage 📚

```typescript
import { ExecutionEngine } from 'execution-engine';

const engine = new ExecutionEngine();

// for sync functions:
const result1 = engine.run((param1) => someResult, [param1Value]);
const function1Output = result1.outputs // The output value returned by the function.

// for async functions:
const result2 = await engine.run(async (param2) => someResult, [param2Value]);
const function2Output = result2.outputs // The output value returned by the function.

//Access the trace information:
const trace = engine.getTrace();
console.log('Trace:', trace);
```

# Contributing 🤝
If you find any issues or have suggestions for improvement, feel free to open an issue or submit a pull request. Contributions are welcome!

# License 📄
This project is licensed under the MIT License - see the LICENSE file for details.
24 changes: 24 additions & 0 deletions jest.config.js
@@ -0,0 +1,24 @@
module.exports = {
roots: ['<rootDir>/src'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
testRegex: '(//.*|(\\.|/)(test|spec))\\.tsx?$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
modulePaths: ['<rootDir>/dist'],
// collectCoverage: true,
// coverageDirectory: 'reports',
// coverageReporters: [['lcov', { projectRoot: '../../' }]],
// testResultsProcessor: 'jest-sonar-reporter',
// reporters: [
// 'default',
// [
// '../../node_modules/jest-html-reporter',
// {
// pageTitle: 'Test Report',
// includeFailureMsg: true,
// includeConsoleLog: true,
// },
// ],
// ],
};

0 comments on commit 8243be4

Please sign in to comment.