dgraph-compiler/README.md

66 lines
3.3 KiB
Markdown
Raw Permalink Normal View History

2023-09-05 19:30:37 -05:00
# DGraph Compiler
This project involves a NodeJS Command Line Interface (CLI) designed to parse and process files generated by Obsidian Discourse Graphs. The primary goal is to create a text-based markdown artifact that represents the entire graph in a comprehensible format.
The CLI consumes graph files and produces an "artifact" which is a text-based representation of the graph's structure, relationships, and contained data. This process is referred to as compiling and includes updates for the user while parsing components, displaying specific errors and warnings as needed. Compilation relies on configurable parameters which define how the graph should be processed, allowing for customization and adaptability.
The project's future roadmap includes incorporating Git for version control of graph elements, configuration parameters, and compiled artifacts. This addition aims to enhance collaboration and tracking of changes in the graph.
Additionally, the project aims to integrate the DGF (DAO Governance Framework) to facilitate decentralized governance over the compilation script, configuration parameters, and other components. This step empowers communities to collectively manage the evolution of the project.
*The current version of the project operates only on a local directory and lacks any governance mechanisms defined by DGF. This simplification serves to assist with the prototyping process as we work towards a MVP for proof of concept.*
## Contributing
To contribute to the project, please follow these steps:
1. Fork the repository
2. Create a new branch for your changes
3. Make your changes and commit them
4. Push your changes to your fork
5. Submit a pull request
## Scripts
- `build:once` - Compiles the TypeScript code once.
- `build:watch` - Compiles the TypeScript code and watches for changes.
- `start` - Starts the application.
- `start:debug` - Starts the application with debugging enabled on port `9229`.
## Setting up for Development
To set up the project for development, follow these steps:
1. Clone the repository to your local machine.
2. Install the project dependencies by running `npm install`.
3. Transpile the TypeScript into JavaScript using one of the following options.
- Run `npm run build:once` to compile the TypeScript code once.
- Run `npm run build:watch` to compile the TypeScript code and watch for changes.
4. Develop and debug the project using either the npm script or the launch configuration in VSCode.
#### Developing the Application with Nodemon
- `npm run start:debug`
- *Note: If using build:watch you will need to run this command in a second terminal*
#### Developing the application with VSCode Debugger
1. Copy the below code into `.vscode/launch.json` at the root directory of the project.
2. Launch the VScode debugger by
- Pressing the F5 shortcut key
- From the toolbar, select Run > Start Debugging
- From the Debugging sidebar, select the green play button
```jsonc
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"name": "Debug with nodemon",
"request": "launch",
"runtimeExecutable": "nodemon",
"runtimeArgs": [
"--inspect=9229",
"--watch",
"dist",
"dist/index.js"
]
}
]
}
```