This guide will give you all the necessary information you need to become a successful code contributor!
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
|
-
Install all the dependencies
$ npm install
-
Build the project
$ npm run build
This command will produce a zip file that can be load in Chrome: dist/asciidoctor-browser-extension.zip
-
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.
-
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
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.
|
Follow these steps to make a release.
-
Build and run the tests
-
Make sure that everything is working fine by loading the extension as an "unpack extension"
-
Edit the
changelog.adoc
file -
Update the version in
app/manifest.json
-
Commit the changes
-
Tag the version
-
Connect to the Chrome Web Store developer dashboard
-
Update the package
-
Publish the new version
-
-
Connect to the Firefox Add-ons developer dashboard
-
Update the package
-
Publish the new version
-
-
Connect to the Opera Add-ons developer dashboard
-
Update the package
-
Publish the new version
-
-
Connect to the Microsoft Partner Center
-
Update the package
-
Publish the new version
-