From 91d233f51f3aca090ac3819f1727cc175ff454db Mon Sep 17 00:00:00 2001 From: Akram Date: Tue, 12 Dec 2023 16:20:32 +0100 Subject: [PATCH] docs: update github pages for bette documentation --- README.md | 8 ++++---- docs/README.md | 13 ++++++++----- examples/README.md | 23 +++++++++++++++++++++++ examples/usage2.json | 34 +++++++++++++++++----------------- 4 files changed, 52 insertions(+), 26 deletions(-) create mode 100644 examples/README.md diff --git a/README.md b/README.md index 66c0b84..d51dd69 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Execution Engine [![execution-engine on npm](https://img.shields.io/npm/v/execution-engine.svg?logo=npm&label=NPM+package&color=limegreen)](https://www.npmjs.com/package/execution-engine) -![npm](https://img.shields.io/npm/dm/execution-engine?color=limegreen) +[![npm](https://img.shields.io/npm/dm/execution-engine?color=limegreen)](https://www.npmjs.com/package/execution-engine) [![install size](https://packagephobia.com/badge?p=execution-engine)](https://packagephobia.com/result?p=execution-engine) [![Github repo](https://img.shields.io/badge/github-grey?logo=github)](https://github.com/tabkram/execution-engine) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) @@ -139,17 +139,17 @@ Explore the comprehensive __[documentation](https://tabkram.github.io/execution- For a detailed list of changes, enhancements, and bug fixes, please refer to our [Changelog](CHANGELOG.md). -# Contributing 🤝 +## 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! Before getting started, please read our [Contribution Guidelines](CONTRIBUTING.md). -# Community 👥 +## Community 👥 Love `execution-engine` ? Give our repo a star ⭐ ⬆️. -# License 📄 +## License 📄 This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. diff --git a/docs/README.md b/docs/README.md index 89445d5..cfa18fa 100644 --- a/docs/README.md +++ b/docs/README.md @@ -12,6 +12,7 @@ A TypeScript library for tracing and visualizing code execution workflows - [ExecutionTimer](#executiontimer) - [TraceableExecution](#traceableexecution) - [ExecutionEngine](#executionengine) + - [EngineTask with @engine and @run Decorators](#enginetask-with-engine-and-run-decorators) ## Installation 📦 @@ -49,8 +50,9 @@ console.log('Trace:', trace); You can: -- view the **complete code** in [examples/usage.ts](examples/usage.ts) -- inspect the **trace output** in [examples/usage.json](examples/usage.json). +- view the **complete code** in [usage.ts](https://github.com/tabkram/execution-engine/blob/main/examples/usage.ts) +- inspect the **trace output** + in [usage.json](https://github.com/tabkram/execution-engine/blob/main/examples/usage.json). - visualize the **trace graph** using the json-to-graph online tool. [→ See the result ←](https://tabkram.github.io/json-to-graph/?data=https://raw.githubusercontent.com/tabkram/execution-engine/main/examples/usage.json) @@ -83,8 +85,9 @@ console.log("Trace:", trace); You can: -- view the **complete code** in [examples/usage2.ts](examples/usage2.ts) -- inspect the **trace output** in [examples/usage2.json](examples/usage2.json) +- view the **complete code** in [usage2.ts](https://github.com/tabkram/execution-engine/blob/main/examples/usage2.ts) +- inspect the **trace output** + in [usage2.json](https://github.com/tabkram/execution-engine/blob/main/examples/usage2.json) - visualize the **trace graph** using the json-to-graph online tool. [→ See the result ←](https://tabkram.github.io/json-to-graph/?data=https://raw.githubusercontent.com/tabkram/execution-engine/main/examples/usage2.json) @@ -104,7 +107,7 @@ The __[ExecutionEngine](./ExecutionEngine.md)__ enhances traceable execution by capturing additional relevant information. It builds upon the functionality of [TraceableExecution](./TraceableExecution.md). -### EngineTask Class and @engine/@run Decorators +### EngineTask with @engine and @run Decorators The __[EngineTask](./EngineTask.md)__ class works in conjunction with the `@engine` decorator and the `@run` decorator to integrate the ExecutionEngine into your classes, providing tracing capabilities for methods. diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..f6f54d3 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,23 @@ +# Execution Engine Examples + +| Example Code | Trace Output | Trace Graph | +|----------------------------------------|--------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [authentication.ts](authentication.ts) | [authentication.json](authentication.json) | [Graph Results](https://tabkram.github.io/json-to-graph/?data=https://raw.githubusercontent.com/tabkram/execution-engine/main/examples/authentication.json) | +| [car.ts](car.ts) | [car.json](car.json) | [Graph Results](https://tabkram.github.io/json-to-graph/?data=https://raw.githubusercontent.com/tabkram/execution-engine/main/examples/car.json) | +| [weather.ts](weather.ts) | [weather.json](weather.json) | [Graph Results](https://tabkram.github.io/json-to-graph/?data=https://raw.githubusercontent.com/tabkram/execution-engine/main/examples/weather.json) | +| [usage.ts](usage.ts) | [usage.json](usage.json) | [Graph Results](https://tabkram.github.io/json-to-graph/?data=https://raw.githubusercontent.com/tabkram/execution-engine/main/examples/usage.json) | +| [usage2.ts](usage2.ts) | [usage2.json](usage2.json) | [Graph Results](https://tabkram.github.io/json-to-graph/?data=https://raw.githubusercontent.com/tabkram/execution-engine/main/examples/usage2.json) | + +### Basic Usage + +- **[usage.ts](usage.ts)**: is a fundamental example of using the `ExecutionEngine`. + +- **[authentication.ts](authentication.ts):** illustrates the sequential execution of functions, providing a detailed trace for each step of the workflow. + +- **[car.ts](car.ts)**: an advanced example showcasing the ability to orchestrate intricate tasks simultaneously and hierarchically. + +### Decorators-based Usage + +- **[usage2.ts](usage2.ts)**: an alternative usage of the `ExecutionEngine` that illustrates the integration of decorators (`@engine` and `@run`) for a more organized and class-based approach. + +- **[weather.ts](weather.ts)**: Advanced example with custom parameters, demonstrating the Execution Engine's versatility in handling complex workflows through decorators (`@engine` and `@run`) within TypeScript classes. \ No newline at end of file diff --git a/examples/usage2.json b/examples/usage2.json index f52466b..1d34af4 100644 --- a/examples/usage2.json +++ b/examples/usage2.json @@ -1,45 +1,45 @@ [ { "data": { - "id": "bound myMethod1_1702207617652_13a5a286-3150-4950-b67a-8e03a797b770", - "label": "bound myMethod1", + "id": "myMethod1_1702221511695_bae140a3-b63d-4c15-b9b1-b21b1bfb25b5", + "label": "myMethod1", "inputs": [ "param1" ], "outputs": "result1 for param1", - "startTime": "2023-12-10T11:26:57.652Z", - "endTime": "2023-12-10T11:26:57.653Z", - "duration": 0.40799999237060547, - "elapsedTime": "0.408 ms", + "startTime": "2023-12-10T15:18:31.695Z", + "endTime": "2023-12-10T15:18:31.695Z", + "duration": 0.2722501754760742, + "elapsedTime": "0.272 ms", "parallel": false, "abstract": false, - "createTime": "2023-12-10T11:26:57.653Z" + "createTime": "2023-12-10T15:18:31.696Z" }, "group": "nodes" }, { "data": { - "id": "bound myMethod2_1702207617653_daeb25cd-1822-48d8-9744-a460bfe9f82f", - "label": "bound myMethod2", + "id": "myMethod2_1702221511696_4f21ad45-7d8d-4291-bb8a-b4de667bf6ae", + "label": "myMethod2", "inputs": [ "param2" ], "outputs": "result2 for param2", - "startTime": "2023-12-10T11:26:57.653Z", - "endTime": "2023-12-10T11:26:57.653Z", - "duration": 0.2049999237060547, - "elapsedTime": "0.205 ms", + "startTime": "2023-12-10T15:18:31.696Z", + "endTime": "2023-12-10T15:18:31.696Z", + "duration": 0.23508310317993164, + "elapsedTime": "0.235 ms", "parallel": false, "abstract": false, - "createTime": "2023-12-10T11:26:57.653Z" + "createTime": "2023-12-10T15:18:31.696Z" }, "group": "nodes" }, { "data": { - "id": "bound myMethod1_1702207617652_13a5a286-3150-4950-b67a-8e03a797b770->bound myMethod2_1702207617653_daeb25cd-1822-48d8-9744-a460bfe9f82f", - "source": "bound myMethod1_1702207617652_13a5a286-3150-4950-b67a-8e03a797b770", - "target": "bound myMethod2_1702207617653_daeb25cd-1822-48d8-9744-a460bfe9f82f", + "id": "myMethod1_1702221511695_bae140a3-b63d-4c15-b9b1-b21b1bfb25b5->myMethod2_1702221511696_4f21ad45-7d8d-4291-bb8a-b4de667bf6ae", + "source": "myMethod1_1702221511695_bae140a3-b63d-4c15-b9b1-b21b1bfb25b5", + "target": "myMethod2_1702221511696_4f21ad45-7d8d-4291-bb8a-b4de667bf6ae", "parallel": false }, "group": "edges"