This repository contains a collection of KGrid Knowledge Objects that demonstrate features of the grid, good development practices and useful tools.
Anatomy of this Knowledge Object project.
There are testing and packaging features in this project that require npm, npm is installed with Node.js
npm. Once npm is installed run
npm install at the root of this project.
- collection/ contains one to many directories representing knowledge objects
- naan-name is intended for each knowledge object (e.g. hello-world)
- tests/ is for all of your project test scripts
- etc/ is a sub-directory for miscellaneous project
- docs/ is a sub-directory for more detailed information about these KOs
- dist/ is created and destroyed when running
npm run package
- scripts/ is intended to capture various scripts need for the project (using scripty)
- scriptswin/ windows versions of the scripts
Example Knowledge Objects
- Hello World - Simple KO designed as a starting point. Demostrates a project structure the includes unit testing and scripts to package the KO deposit.
- BMI Calculator - Simple KO designed to calculate BMI based on height and weight. Demostrates passing mulitple attributes.
- Minimum Viable - Simple KO designed demostrate the smallest amount of information needed to get KO
Running Example KOs in an Activator
You can now test the example objects in an activator via a npm script. This script will download the latest released activator and start up the activator using the example repository as it's shelf.
Open a terminal window at the root of the cloned repository and run the following command.
npm run dev
You can create zip file of the Knowledge Object which can be used to deposit to a KGrid Library or load/activate on a KGrid Activator.
npm run package