Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Local Development Setup

ottobib edited this page Oct 16, 2020 · 1 revision

Objective

This article is meant for the following objectives:

  1. Adding new features
  2. Starting unit tests
  3. Include local repo to a different node project

Clone the clams-ml Repo

Clone clams-ml to your machine.

git clone https://github.com/openclams/clams-ml.git

If you want to contribute new features, then please create your own branch, and make an pull request for the dev branch when you are finished.

Build

Go in to the root folder of the node project, to install missing packages

npm install

Afterwards you can build the project.

npm run build

Development in different Project

If you want to test your new features in a different app then use the following command to pack the clams-ml project.

npm pack

This generates an archive clams-ml-x.y.z.tgz.

Next, change to the directory of your node project, where you want to use clams-ml, and add the path of the tgz file in the package.json.

"devDependencies": {
     "clams": "some/path/clams-ml/clams-x.y.z.tgz"
}

Now call

npm install

in your node project to load the clams package from your local repo.

If you continuously develop new features, then you might need to increase the version number of clams-ml in its package.json and npm pack clams-mlagain. When you do this, the archive will have a different version, hence you also need to adapt the path in the package.json your node project, and perform npm install again.

Unit Testing

Clams uses the mocha and chai package for unit testing Unit tests are stored in the src/lib/tests directory, and have the usual *.spec.ts file ending.

You can execute the tests as follwos:

npm run test

Clone this wiki locally