Skip to contents

Development

Prerequisites

Installation

Install dependencies for R:

# install.packages("devtools")
devtools::install_dev_deps()

Install dependencies for JavaScript:

npm install

Building

Build the JS/CSS bundle (outputs to inst/htmlwidgets):

npm run build

Then load (devtools::load_all()) or reinstall the package.

These generated files should be added in their own separate commit, preferably only once per branch.

Testing

Run R tests:

devtools::test()

# With test coverage (requires DT)
# install.packages("DT")
covr::report()

Run JavaScript tests:

npm test

# With test coverage
npm run test:cover

# Update test snapshots
npm run test:update

Linting and Formatting

Lint and format the JS/CSS:

npm run lint
npm run format