Skip to content
Snippets Groups Projects
local-development.md 9.50 KiB

Local Development

This document serves to give tips and tricks on how to run Renovate locally to add features or fix bugs. Please submit PRs to improve it if you think anything is unclear or you can think of something that should be added.

General notes

We are currently migrating to typescript, so please write all new files as ts files and feel free to help us to convert existing files.

If you have to modify existing js files, please use modern esm imports and exports. We will transpile them to commonjs on build.

Install

Prerequisites

For local development some dependencies are required.

  • git
  • nodejs ^10.13.0 || ^12.0.0
  • yarn ^1.17.0
  • c++ compiler
  • python ^2.7 with mock library

Python 2.7 is required in development in order to support installing with node-gyp, which does not yet support Python 3. mock is used by Renovate in production and is now part of the Python standard library, but only from 3.3 onwards.

Linux

You can use the following commands for Ubuntu.

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install -y git python-minimal build-essential nodejs yarn

Windows

The following steps work to set up a brand new Windows 10 installation for developing Renovate. If you already have some components installed, you can naturally skip them.

  • Install git. Make sure you've configured your username and email.

  • Install Node.js LTS

  • In an Administrator PowerShell prompt, run npm install -global npm and then npm --add-python-to-path='true' --debug install --global windows-build-tools

  • Install Yarn

  • Install mock for Python:

    • curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
    • python get-pip.py
    • rm get-pip.py
    • python -m pip install mock

    Verify you have everything installed with appropriate versions, e.g.:

    PS C:\Windows\system32> git --version
    git version 2.23.0.windows.1
    PS C:\Windows\system32> node --version
    v10.16.3
    PS C:\Windows\system32> yarn --version
    1.19.0
    PS C:\Windows\system32> python --version
    Python 2.7.16
    PS C:\Windows\system32> python -c "import mock; print(mock.__version__)"
    3.0.5

Fork and Clone

If you will contribute to the project, you should first "fork" the main project using the GitHub Website and then clone your fork locally.

Install dependencies

We use yarn so run yarn install to install dependencies instead of npm install.