Skip to content

Latest commit

 

History

History
102 lines (70 loc) · 3.19 KB

CONTRIBUTING.md

File metadata and controls

102 lines (70 loc) · 3.19 KB

Contributing

Setup

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

git clone [email protected]: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 package 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.

To unlink, run the unlink command in the following order:

# First, from the project
npm unlink --no-save radar-sdk-js

# Then in the SDK repo
npm unlink radar-sdk-js

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