Skip to content
Snippets Groups Projects
README.md 2.44 KiB
Newer Older
mathias.chouet's avatar
mathias.chouet committed
# JaLHyd - Javascript Library For Hydraulics
See also [developers documentation](https://gitlab.irstea.fr/cassiopee/jalhyd/blob/master/DEVELOPERS.md)
mathias.chouet's avatar
mathias.chouet committed
## Build and release
mathias.chouet's avatar
mathias.chouet committed
### Requirements
mathias.chouet's avatar
mathias.chouet committed
 * nodejs
mathias.chouet's avatar
mathias.chouet committed
### Install dependencies
mathias.chouet's avatar
mathias.chouet committed
```sh
npm install
```
mathias.chouet's avatar
mathias.chouet committed
### Run unit tests using Jasmine
mathias.chouet's avatar
mathias.chouet committed
Debugging might not be possible because of circular dependencies generated by typescript compiler
mathias.chouet's avatar
mathias.chouet committed
```sh
npm run jasmine
```
mathias.chouet's avatar
mathias.chouet committed
### Compile (es2015 modules)
This is the preferred way of compiling, notably for usage in Web apps (ngHyd)
mathias.chouet's avatar
mathias.chouet committed
```sh
npm run build
```
mathias.chouet's avatar
mathias.chouet committed
### Compile for Node.js (commonjs modules)
Use this if you want to write a CLI application in JS or TS, that will be executed by Node.js (see examples in `/boilerplate`)
```sh
npm run build-node
```
mathias.chouet's avatar
mathias.chouet committed
### Generate release package (es2015 modules)
mathias.chouet's avatar
mathias.chouet committed
```sh
npm run package
```
mathias.chouet's avatar
mathias.chouet committed
### Generate release package for Node.js (commonjs modules)

```sh
npm run package-node
```
mathias.chouet's avatar
mathias.chouet committed
### Flag suspicious language usage
mathias.chouet's avatar
mathias.chouet committed
```sh
npm run lint
```
mathias.chouet's avatar
mathias.chouet committed

mathias.chouet's avatar
mathias.chouet committed
### Generate typedoc
mathias.chouet's avatar
mathias.chouet committed

mathias.chouet's avatar
mathias.chouet committed
```sh
npm run doc
```
mathias.chouet's avatar
mathias.chouet committed

mathias.chouet's avatar
mathias.chouet committed

### Generate UML diagram

The tsviz package can be used for drawing class diagram of the current code.

mathias.chouet's avatar
mathias.chouet committed
To install tsviz:
```sh
npm install -g tsviz
```

There's currently a bug on debian like distribution due to a wrong declaration of graphviz path in the code: https://github.com/joaompneves/tsviz/issues/5
To work around, you can create a link to the good path: `sudo ln -s /usr/bin/dot /usr/local/bin/dot` 

mathias.chouet's avatar
mathias.chouet committed
To draw the diagram:
```sh
npm run viz
```

## Release policy

Use [semantic versioning](https://semver.org/).

Mathias Chouet's avatar
Mathias Chouet committed
**When releasing a Cassiopee (NgHyd) version along with a JaLHyd version, it's discouraged to execute release steps manually, see "Release Policy / Release Script" in [NgHyd's README.md](https://gitlab.irstea.fr/cassiopee/nghyd/blob/master/README.md)**

Before releasing a new stable version, one should complete the following files
mathias.chouet's avatar
mathias.chouet committed
 - `CHANGELOG.md`
Mathias Chouet's avatar
Mathias Chouet committed
 - `package.json` (update "version", or use `npm version`)

Every stable version should be tagged with both
 - a tag stating compatibility with NgHyd, of the form `nghyd_X.Y.Z`
 - the `stable` tag

Mathias Chouet's avatar
Mathias Chouet committed
The `stable` tag should be set **after** the NgHyd compatibility tag, so that `git describe` returns `stable` (latest tag). There should be **at least 1s** between the two tag commands, so that date sorting is not confused.

Here are the steps to follow for an example **4.5.0** version
mathias.chouet's avatar
mathias.chouet committed
```sh
Mathias Chouet's avatar
Mathias Chouet committed
npm version 4.5.0
# commit changes

mathias.chouet's avatar
mathias.chouet committed
git tag -fa nghyd_4.5.0
Mathias Chouet's avatar
Mathias Chouet committed
sleep 1
mathias.chouet's avatar
mathias.chouet committed
git tag -fa stable
git push --tags --force
```