Skip to content

Latest commit

 

History

History
80 lines (58 loc) · 2.69 KB

hacking.adoc

File metadata and controls

80 lines (58 loc) · 2.69 KB

Hacking

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.js >= 8.11 and npm (we recommend nvm to manage multiple active Node.js versions).

Note
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
Important

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’s not recommended, but if your are running the tests suite as root, you will 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.

This project is using a code linter to enforce code consistency. To make sure that the code you have contributed, follow 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
Note
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

  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 developper dashboard

    1. Update the package

    2. Publish the new version

  8. Connect to the Firefox Add-ons developper dashboard

    1. Update the package

    2. Publish the new version

  9. Connect to the Opera Add-ons developper dashboard

    1. Update the package

    2. Publish the new version