- File issues.
- Edit/write documentation.
- Submit pull requests.
- Test in different environments.
- Raise awareness.
Following tools are getting used:
TypeScript
as primary language - https://www.typescriptlang.org/compodoc
for API documentation - https://compodoc.app/Jasmine
for test cases - https://jasmine.github.io/Karma
for running test cases in browsers - http://karma-runner.github.io/webpack
for build - https://webpack.js.org/nodejs
during development - https://nodejs.org/npm
for dependency management, packaging and distribution - https://www.npmjs.com/git
for version control - https://git-scm.com/
Instructions on setting up development environment:
- Install
node
andnpm
- https://nodejs.org/ - Checkout code from GitHub - you may fork the code first into your GitHub account.
- Use
npm i
to install dependencies:$ npm i
<Project Folder>
├── LICENSE.md
├── README.md
├── bin/ -- Scripts invoked from `npm` tasks
├── bundles/ -- Generated code browsers
├── esm5/ -- Generated ES5 modules
├── esm6/ -- Generated ES6 modules
├── index.d.ts
├── karma.conf.js
├── package-lock.json
├── package.json
├── rabbitmq/
│ └── Dockerfile -- This builds a docker image that is used to run test cases
├── spec/ -- These test cases run both for nodejs (using just Jasmine) and Chrome (Jasmine/Karma)
│ ├── helpers/
│ └── unit/ -- Test cases using Jasmine
├── src/ -- Typescript sources
├── tsconfig.json
└── webpack.config.js
- A Stomp broker is used for running the tests. I have been using RabbitMQ.
- Edit
spec/helpers/stomp.service.factory.ts
as per your setup. Defaults should work for as RabbitMQ default setup on localhost. - Please note that in RabbitMQ you will need to enable Stomp and WebStomp plugins.
- By default RabbitMQ WebStomp will treat messages a text, you will need to tell
it is use binary frames:
$ echo 'web_stomp.ws_frame = binary' >> /etc/rabbitmq/rabbitmq.conf
- A RabbitMQ Dockerfile is provided with necessary plugins and configuration. To use it, run:
$ docker build -t myrabbitmq rabbitmq/ # Needed only once $ docker run -d -p 15674:15674 myrabbitmq # to start the broker
Key npm tasks:
clean - Remove generated built artifacts
build-tsc - Internally used by `npm run build`
build-webpack - Internally used by `npm run build`
build - Build three variants - ES5, ES6, and UMD
karma - Run tests in browsers
lint - run tslint
- Checkout a new branch of
develop
. - Make code changes (src/specs)
- Build:
$ npm run build
- Run tests:
- To run tests using Headless Chrome:
$ npm run karma
- To run code style check
$ npm run lint
- To run tests using Headless Chrome:
- Documentation is generated centrally for
stompjs
andrx-stomp
. Follow required https://compodoc.app/ standards in comments.
- Please exclude generated files from the commit
(
bundles
,esm5
andesm6
) folders. These will be generated during merge and release process. - Please ensure that following passes successfully:
$ npm run lint $ npm run karma
- Please follow GitHub guidelines to raise a PR against
develop
branch. - GitHub actions will run tests against a freshly installed RabbitMQ.
- Raise an issue if you are unclear.