This repo uses conventional commits formatted messages.
Basically, it means that your commit messages should be atomic and prepended with the type of change it introduces.
This is used for creating CHANGELOG.md and the changelog object used by the JavaScript worker version.
For example
fix: Off by one error in output
feat: Support multilayer files
docs: Update installation instructions for Windows
Other commit types are e.g. perf
, refactor
, test
and build
.
Scopes in conventional commits is appended to the commit type.
We use the scopes js
and python
, for example
fix(js): Check that error handler is a function
docs(python): Update Python documentation
- Commit everything with conventional commit messages
- Install
standard-version
by runningnpm i
- Run
npm run release -- --dry-run
to run standard-version- Double check the output and that the
bumpFiles
has been updated
- Double check the output and that the
- Run
npm run release
(Note: do not amend the release commit, the tag will point to the wrong commit!) - Run
git push --follow-tags
Building requires Emscripten.
In short:
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
We also need Infomap to extract the command line arguments for Infomap Online.
To build:
- Follow the release workflow before building
- Install deps with
npm i
- Run
make js-worker
- This creates
build/js/infomap.worker.js
- Copies the worker to
interfaces/js/src/worker
- Runs
npm run build
which bundles the worker with the js source files and copies them todist
- Copies the js README.md to the root
- This creates
- To test, run
make js-test
- Runs
npm pack
and extracts thetgz
file. - Copies
packages/dist/index.js
toexamples/js/
. - Replaces the script source from the CDN to the local
./index.js
.
- Runs
- Run
npm publish
- Optionally run
make js-clean
- Optionally run
Building requires Swig and Sphinx
On macOS, install with brew install swig
and brew install sphinx-doc
.
To build:
- Follow the release workflow before building
- Run
make python
- Runs
swig
- Creates
package-meta.py
- Copies python package files to
build/py
- Runs
- To test the build, run
make py-test
- Test publish with
make pypitest-publish
- Install in a clean environment
pip3 --no-cache-dir install --index-url https://test.pypi.org/simple/ infomap
- Install in a clean environment
- Run
make pypi-dist
- Publish with
make pypi-publish
Generate documentation:
- Follow the release workflow before generating documentation
- Run
make py-doc
which generates the documentation for Github pages. The front page is generated fromREADME.rst
- Commit the documentation with a
docs(python)
scoped commit.