Skip to content

Latest commit

 

History

History
83 lines (58 loc) · 3.14 KB

CONTRIBUTING.md

File metadata and controls

83 lines (58 loc) · 3.14 KB

Contributing to AVR8js

First of all, thank you for considering contributing to AVR8js! Please go over these guidelines to ensure that your contribution lands successfully.

How to Contribute

Before starting to work on a new feature, please file an issue to discuss the implementation.

Setting-up Your Environment

The source code is written in the TypeScript language, a typed extension of JavaScript.

In addition, we use the following tools:

  • prettier to keep the code pretty
  • eslint to keep the code consistent and clean
  • editorconfig to keep indentation consistent across different editors
  • jest for the unit tests

If you open this project with Visual Studio Code, you will be prompted to install the relevant extensions for these tools.

Finally, we recommend using Wallaby.js to run the tests automatically as you write the code. It should work out of the box with this repo, without any extra configuration. You can also run the tests manually, from the commandline (see below).

Running the Demo Project

The demo project allows you to edit Arduino code, compile it, and run it in the simulator. It also simulates 2 LEDs connected to pins 12 and 13 (PB4 and PB5). To run it, simply execute

npm start

Then go to http://localhost:1234/ to interact with the project.

The demo project is packaged using parcel and uses the Monaco Editor for the interactive code editor, and the Wokwi Elements library for displaying the LEDs.

Running The Tests

Run the tests once:

npm test

Run the tests of the files you modified since last commit (watch mode):

npm run test:watch

Reference Material

The following datasheets can be useful when working on new AVR8js features or fixing existing code:

Coding Guidelines

Please make sure to follow these guidelines when contributing code:

  1. You include a relevant test case. Ideally the test case would fail before your code changes, and pass after implementing the change.
  2. Your commit messages should follow the conventional commits standard, e.g.: feat(instruction): implement EICALL, EIJMP
  3. The contributed code has to be compatible with the MIT license. If your work incoporates some third-party code, please make sure that their license is compatible and that you credit appropriately.

Thank you!