This repository follows the same contribution guidelines and code of conduct as the main DAML repository.
This project uses NPM to manage the dependencies and the environment of scripts handling the build lifecycle.
Before you start coding, install the dependencies:
npm install
Once this is done you can run the full build:
npm test
The full build consists of:
- downloading the Ledger API ProtoBuffer service definitions from Digital Asset's Bintray,
- generating the gRPC stubs,
- running the TypeScript compilation, and finally
- running the tests using Mocha.
Steps 1 and 2 are executed only if the proto
and src/generated
directories are not available locally.
To force these build phases to run again (e.g. because the bindings now depend on a new version of the gRPC Ledger API definitions), run the following before re-running npm test
:
rm -rf proto src/generated
- use Node.js version 8 or 10
- be a part of the
digitalasset
organization on GitHub npm login
beforenpm publish
The following steps are to be followed in order to release a new version of the bindings:
- Choose a new version number
<version>
(the0.x
release series does not uphold semantic versioning) - Create the branch
release-<version>
- Change the title of the unreleased section in the changelog to the chosen
<version>
- Run the command
npm version --no-git-tag-version <version>
- Commit the outstanding changes with the message
Prepare release <version>
- Open a pull request with the title "Release <version>", have it reviewed, squashed and merged
- After the pull request has been squashed and merged, pull the master locally and check it out
- Tag the commit resulting from step 6 with the name
v<version>
(e.g.v0.8.2
) - Push the tag created in the previous step
- Publish with
npm publish
To publish the documentation, start from where you left off and then:
- Create the documentation for the release with
npm run release-docs
- Checkout the
gh-pages
branch - Add the generated documentation to this branch (i.e. move them from the
docs
folder to the repository root) - Update the
latest
symbolic link to point to the new docs - Commit with the message
<version>
and push it