Skip to content

Latest commit

 

History

History
93 lines (63 loc) · 3.02 KB

CONTRIBUTING.md

File metadata and controls

93 lines (63 loc) · 3.02 KB

Contributing

Setup

For local development, clone the repository and install all dev dependencies.

git clone git@github.com:radarlabs/radar-sdk-js.git

cd radar-sdk-js

npm install

Tests

To run tests locally, you can run the test command for a single run, or in watch mode.

npm run test

npm run test:watch

Demo App

The easiest way to develop the SDK in a browser environment, is to start up the demo app locally.

This is a small web app that will run on a local server, and serve up the Web SDK as a locally built script tag. Any code changes will be recompiled on-the-fly (will require a browser refresh to take effect).

npm run demo

This will start the demo on http://localhost:9001. The demo app uses express to serve files, and handlebars for rendering views.

Note adding new view templates will require the server to be restarted.

npm-link

If you want to run a local version of the SDK in an ES Module environment, you can use npm link to use the locally built version in your project.

To setup, first link the local version of the Radar SDK

# in /radar-sdk-js
npm run build
npm link

Then in your project that has radar-sdk-js in its package.json

npm link radar-sdk-js

This will point the pakage in your project to use the local version of the SDK.

Note: Make sure you're using the node.js & npm installations in both projects, especially if you're using a node manager like nvm or n.

Versions

There is a built in utility for managing version increments:

npm run bump-version

This will increment the minor version in the necessary places throughout the codebase. This is required before cutting a new release otherwise tests will fail.

This script will also update the version used in documentation throughout the repository.

Releases

This only applies to authorized contributors

New releases are managed via Github Releases.

Creating a new release will start the Github Workflow for managing the release:

  • Run tests
  • Build artifacts
  • Release on npm
  • Deploy new script tags
  • Build Github pages for demo site

Note: All release version should be prefixed with v.

Beta release

To ship a beta release, the version should be suffixed with -beta.<version number>. This can be done with the bump-version command.

npm run bump-version 4.0.1-beta.1

Beta versions should also be set as a pre-release image

Production release

Production releases should not have a -beta suffix, and be set as the latest release. Screenshot 2023-07-05 at 12 31 07 PM