- Node version 18.15.x or later
- NPM 9.x or later
compile
- compiles the TypeScript sources to thelib
directoryclean
- removes all generated code, coverage, and documentation artifactsfull-clean
- runsclean
and removes the localnode_modules
directorytest
- runs the unit teststest-cycle
- starts the cluster and if successful, runs the unit tests. After the cluster will be stopped.coverage
- runs the unit tests and gathers coverage metrics (results found incoverage
directory)coh-up
- starts a two-member Coherence cluster for testing/developing againstcoh-down
- stops the previously started Coherence clusterdist
- creates a test distribution for inspection prior to publish
bin
- various shell scripts that will be called by npmetc
- contains the ProtoBuff .protoc files and other various filessrc
- TypeScript source files and related resourcestest
- contains the library test cases in plain JavaScript
- run
npm install
- this will install the necessary dependencies and compile the grpc artifacts - run
npm run compile
- this compiles theTypescript
sources
- run
npm run coh-up
- this starts a Coherence test Docker container. This instance exposes thegrpc
port1408
and exposes port5005
for java debugging of the Coherence instance. To view the JSON payloads being sent to Coherence, check the docker container log for the instance this command started. - run
npm run test
- this will run all unit tests. You may optionally run the tests individually via an IDE as long as the Coherence container mentioned in the previous step was started. - run
npm run coh-down
when testing is complete and the Coherence test container is no longer needed.
The above can also be shortened to:
npm run test-cycle
- this will start the cluster, run test tests if the cluster start was successful, and then stop the clusternpm run test-cycle-tls
- The same astest-cycle
, but will use TLS
However, if developing new functionality or tests, the manual start of the cluster using coh-up
may be preferred as
it avoids restarting the cluster allowing for quicker development times.
Important! When calling coh-up
, test
, coh-down
, or test-cycle
the LTS version of Coherence will be used (22.06.10
).
To use a later Coherence version, such as 22.03
, prefix the calls with, or export COHERENCE_VERSION=<desired-version>
.
For example:
COHERENCE_VERSION=22.03 npm run test-cycle
- Install
typedoc
globally:npm install -g typescript && npm install -g typedoc
- Run
typedoc
from project root. The Generated documentation will be available in thedocs
directory.
- Currently based on https://google.github.io/styleguide/jsguide#formatting
- Question: How do I use the library locally in another project for testing purposes?
Answer: First, run
npm link
within thecoherence-js-client
project to create a global NPM reference. then, from the project you want to use the library with, runnpm link @oracle/coherence
which will install the library for use with that project