The ontotext-yasgui project contains the ontotext-yasgui-web-component wrapper around the YASGUI library allowing easy reusing by simply embedding the custom html tag in any web project be it vanilla javascript or based on any of the popular SPA frameworks. This component also extends the YASGUI API and serves as a facade behind which customizations can be implemented without affecting the client projects.
The component is heavily used in the Ontotext's GraphDB Workbench. All extensions and customizations made on top of the original YASGUI library came as requirements during integration of the library in the GraphDB Workbench UI.
This project is composed by following sub-projects:
- Yasgui;
- ontotext-yasgui-web-component;
- cypress. - An automated testing project.
A workspace with the latest version of the original source code of the
Yasgui library with all needed customizations.
After a build, the yasgui.min.js and yasgui.min.css artefacts are copied into
ontotext-yasgui-web-component.
A workspace with the implementation of a custom web component which wraps the Yasgui library and
provides a common interface for unobtrusive customizations via configurations and hooks;
A project with automated e2e tests for the ontotext-yasgui-web-component.
Read Development guide before starting any development in this project. Below are some first steps helping to get started:
git clone https://github.com/Ontotext-AD/ontotext-yasgui.git
npm install
-
Execute the
npm run buildcommand. The command executes the following tasks:- Builds the
Yasguicomponent; - Copies the built
yasgui.min.jsandyasgui.min.cssartefacts intoontotext-yasgui-web-componentproject; - Builds the
ontotext-yasgui-web-componentproject. The component is built in thedistfolder in theontotext-yasgui-web-component.
- Builds the
-
A development server can be run by executing the
npm run startcommand. This will run a simple web server and deploy a sample web page with theontotext-yasgui-web-componentinside. The server supports a watch mode, and a live reload of the web browser. -
The automated tests can be run by executing one of the following commands:
npm run cy:runfor headless tests execution.
npm run cy:openfor opening the cypress dashboard.The development web server must be started before running the automated cypress tests.
-
The code quality is monitored with eslint. Executing the
npm run lintcommand will perform a code lint check. And running thenpm run lint:fixcommand will execute a code lint check as well as an automatic problems fixing where possible and reporting the rest. -
The
ontotext-yasgui-web-componentis regularly published as a package in the NPM registry. This is done via automated CI. -
Execute the
npm run cleancommand. This command will delete:
- Parent project
- node_modules of parent project
- ontotext-yasgui-web-component project
- ontotext-yasgui-web-component/dist
- ontotext-yasgui-web-component/loader
- ontotext-yasgui-web-component/node_modules
- ontotext-yasgui-web-component/www
- Yasgui project
- Yasgui/node_modules
- Yasgui/build
- Yasgui/packages/utils/node_modules
- Yasgui/packages/utils/build
- Yasgui/packages/yasgui/node_modules
- Yasgui/packages/yasgui/build
- Yasgui/packages/yasqe/node_modules
- Yasgui/packages/yasqe/build
- Yasgui/packages/yasr/node_modules
- Yasgui/packages/yasr/build
After execution of this command the project will be in a state same as it was just cloned from the repository.
For development purposes the minification of the yasgui can be skipped by setting the
minimizeproperty tofalseof the optimization configuration in Yasgui/webpack/config.ts file.
After the ontotext-yasgui-web-component is built, then it can be used in every supported by
stenciljs framework or in vanilla javascript applications. Read
Usage guide for details how to use it.
TODO: Describe the process in details