Skip to content

sivrad/matrix

Repository files navigation

Matrix Logo

Matrix

The core functionallity of the matrix-service.

npm GitHub Workflow Status codecov GitHub Conventional Commits Commitizen friendly


NOTE: This documentation assumes you are familiar with the matrix-service, if you would like to know more about it, read the documentation.

Installation

yarn add @sivrad/matrix

Usage

Create Matrix Instance

// Import Matrix from this package.
import { Matrix } from '@sivrad/matrix';
// Import a simple JSON file driver.
import { JSONDBDriver } from '@sivrad/matrix';

// Create an instance and pass in the driver.
const mtx = new Matrix(new JSONDBDriver('myfile.json'));

Contributing

These are the steps to contribute to the Matrix Package.

Post Git Clone

Install Dependencies

Install node dependencies with yarn.

yarn

Generate Internal Types

This generates internal types from the JSON schemas from this repo.

yarn generate-types

Building the Package

This script will build the package and transpile the code to Javascript.

yarn build

Additionally, you can just build the src/types/* files with:

yarn build-types

This is usefull if you don't want to transpile into Javascript every time you change something.