-
Notifications
You must be signed in to change notification settings - Fork 29
Development Guide
This section contains information on creating a Source Module. Please read through this section thoroughly to get a better understanding of the Source Modules system and how to create your own Source Module.
Table of Contents
- Getting Started
- File Structure
-
Creating a New Module
- Creating a Bundle
- Creating a Tab
- Writing Documentation
- Developer Documentation (TODO)
- Pull Requests (TODO)
This subsection of the page contains information about all the scripts used currently in the Source Modules project. To run a script, at the root directory of your copy of the Source Modules code repository on your local development machine, run the following command in your favourite shell's command-line interface.
yarn run <script>
Script | Description |
---|---|
build |
Transpile modules' files from src folder to build folder as well as generates API documentation. |
build:docs |
Generates the Source Modules' API documentation. |
build:modules |
Transpile modules' files from src folder to build folder. |
create |
Run the module generator command-line app to create a new Source Module bundle or tab. |
lint |
Check code for errors. |
lint:fix |
Check and automatically fix code errors. |
test |
Run all unit tests once. |
test:watch |
Run all unit tests, watch files for changes and rerun tests related to changed files. |
As with the other Source Academy code repositories, we practice KISS and DRY within the code repository. In addition to that, we practice additional constraints to keep the code base consistent. These constraints will be automatically identified and highlighted to the developer when the lint
script is executed.
For VSCode users, we recommend that you install and use the ESLint VSCode extension here as it will help to highlight code that do not conform to the ESLint rules in real time, eliminating the need to execute
yarn run lint
regularly.
In the Source Modules project, we have opted to use Airbnb's JavaScript code linting rules that were converted to support TypeScript. This is because the linting rules by Airbnb is one of the most commonnly used around, and it bills itself as "a mostly reasonable approach to JavaScript". And their linting rules are popular because they are simple, sensible, and beautifully consistent. An exhaustive list of the enforced rules and their explanations can be found here.
- Home
- Overview
- System Implementation
-
Development Guide
- Getting Started
- Repository Structure
-
Creating a New Module
- Creating a Bundle
- Creating a Tab
- Writing Documentation
- Developer Documentation (TODO)
- Build System
- Source Modules
- FAQs
Try out Source Academy here.
Check out the Source Modules generated API documentation here.