Skip to content

Latest commit

 

History

History
98 lines (78 loc) · 3.29 KB

CONTRIBUTING.adoc

File metadata and controls

98 lines (78 loc) · 3.29 KB

Contributing

This guide will give you all the necessary information you need to become a successful code contributor!

Setup

To build this project, you will need Node and npm. The best way to install Node is to use nvm (Node Version Manager).

We recommend using the latest long term support (LTS) release of Node. While you can use other versions of Node, this extension is only tested against active LTS releases.

ℹ️
If you feel more comfortable with yarn, you can use it as an alternative to npm

Building

  1. Install all the dependencies

    $ npm install
  2. Build the project

    $ npm run build

    This command will produce a zip file that can be load in Chrome: dist/asciidoctor-browser-extension.zip

  3. Run tests

    $ npm run test

    Testing notes

    The tests suite is run against an Headless instance of Chromium

    When you installed the development dependencies, Puppeteer had automatically installed Chromium for your platform. So you shouldn’t need to manually install Chromium or Chrome in order to run the tests suite.

    It is not recommended to run the test suite as root

    If you’re as root, you’ll see the following error in the console:

    INFO [launcher]: Starting browser ChromeHeadless
    ERROR [launcher]: Cannot start ChromeHeadless
    	ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

    To workaround this issue you can run the following command instead:

    $ npm run test:nosandbox

    It will launch a Chromium instance with the --no-sandbox argument.

  4. Check your code against the code rules. This project is using a code linter to enforce code consistency. To make sure that the code you have contributed follows the code rules, execute the following command:

    $ npm run lint:code

Add-on Linter

Mozilla provides a Node.js package to validate an add-on. You can run the linter with npm:

$ npm run lint:firefox
ℹ️
The linter will inspect the archive produced by npm run build, so make sure the file dist/asciidoctor-browser-extension.zip is present before running this command.

Release

Follow these steps to make a release.

  1. Build and run the tests

  2. Make sure that everything is working fine by loading the extension as an "unpack extension"

  3. Edit the changelog.adoc file

  4. Update the version in app/manifest.json

  5. Commit the changes

  6. Tag the version

  7. Connect to the Chrome Web Store developer dashboard

    1. Update the package

    2. Publish the new version

  8. Connect to the Firefox Add-ons developer dashboard

    1. Update the package

    2. Publish the new version

  9. Connect to the Opera Add-ons developer dashboard

    1. Update the package

    2. Publish the new version

  10. Connect to the Microsoft Partner Center

    1. Update the package

    2. Publish the new version