The repository contains multiple projects that use web technologies to visualize KLighD generated diagrams.
This repository contains a monorepo for different KLighD related, web-based packages. The packages are seperated in two types:
- Packages that produce usable applications are placed in the
applications
folder. - Packages that serve as library code are placed in the
packages
folder.
Package name | Type | Description |
---|---|---|
@kieler/klighd-core | library | Core package to visualize KLighD generated diagrams. Based on Sprotty. |
@kieler/klighd-interactive | library | Support module for klighd-core to interactively apply constraints to the diagram. |
@kieler/klighd-cli | application | CLI and web-server to visualize diagrams in the browser using klighd-core`. |
klighd-vscode | application | Visual Studio Code extension that uses klighd-core to add diagram support to VS Code. Should be used by other extensions to visualize their KLighD generated diagrams. |
klighd-vscode | KlighD |
---|---|
0.1.0–0.2.1 | 2.1.0 |
0.3.0–0.4.2 | 2.2.0 |
0.5.0 | 3.0.2 |
Moreover, the default branches of both repositories should be compatible but might experience regression.
Development of this project requires Node.js v16.x and yarn v1.x.
Developing the klighd-vscode
extension requires an extension that has a dependency on
klighd-vscode
and provides a language client with KLighD
synthesis capabilities. A good candidate for development is the kieler.keith-vscode
(under development)
extension.
Furthermore, development of the klighd-cli
requires a language server with
KLighD synthesis capabilities. The server can either be started
separately, using a socket for communication, or placed as a jar named language-server.jar
in the
applications/klighd-cli folder.
Developing a language server that uses KLighD to fulfill all requirements to be usable with these applications is no easy task. Until the distribution of KLighD and documentation about building your own language server is improved, feel free to seek advice from a member of the KIELER working group.
An example for a simple language server with KLighD synthesis support can be found here. Configuration for the build process using Maven Tycho can be found here. The VS Code extension for this language server can be found here.
All scripts that are available at the monorepo root. Run a script with
yarn <script>
. More specific scripts may be provided by each package.
Script name | Description |
---|---|
clean | Removes all build results in each package. |
lint | Runs eslint in all packages to identify style problems. |
build | Builds all packages for production. |
watch | Builds all packages for development in watch mode. |
package | Builds and packages supported packages for distribution. E.g. creates a klighd-vscode.vsix file and creates self-contained CLI binaries. |
distribute | Builds and publishes configured application builds. (Script name "publish" is preserved for publishing packages ) |
- Fulfill the requirements above.
- Run
yarn
in the monorepo root to install all dependencies (if not already done). - (only on the first build:) Run
yarn build
to first do a sequential build to link the internal dependencies. - Run
yarn watch
in the monorepo root to watch all packages for changes. - Run
yarn start
oryarn socket
in the applications/klighd-cli folder to start a web-server, serving the standalone view.yarn start
uses alanguage-server.jar
file placed in theklighd-cli
folder.yarn socket
uses a socket connection (default port 5007) to connect to the LS.
- Navigate to
http://localhost:8000?source=file:///<path-to-diagram-file>
in your browser to inspect the standalone view.
- Fulfill the requirements above.
- Run
yarn
in the monorepo root to install all dependencies (if not already done). - Run
yarn package
- The packaged CLI can be found in applications/klighd-cli/bin with a version for each platform.
The self-contained CLI does not contain a language server to make it more flexible for different
language servers. Run klighd-{os} -h
for information on how to provide a language server for the
CLI.
We recommend VS Code to develop the VS Code extension to make use of the provided launch tasks. The following steps have are required to start developing.
- Fulfill the requirements above.
- Install all workspace recommended extensions.
- Run
yarn
in the monorepo root to install all dependencies (if not already done). - Run the "Launch VS Code Extension" launch configuration. This also runs a task to watch all packages.
- A VS Code instance with the
klighd-vscode
extension should be started. - After changes to your files, run the "Reload Window" command in your dev VS Code instance.
- Fulfill the requirements above.
- Run
yarn
in the monorepo root to install all dependencies (if not already done). - Run
yarn package
- Run
code --install-extension applications/klighd-vscode/klighd-vscode.vsix