Framework Developer Guide
Great open-source software is a result of the collaboration of enthusiastic developers. Anyone can help Neutralino by contributing code and reporting bugs. This document explains how to start contributing Neutralinojs.
Note that this guide is for contributors. If you are getting started with Neutralinojs app development, you can start from here.
#
Setup and build the framework#
Cloning the repositoryFirst, clone the main repository.
#
Installing compilation tools and dependencies#
LinuxNo need for separate compilers because Linux distributions usually have GNU C/C++ compilers installed already.
Install GTK, WebKit, other libraries with the following command.
#
Debian#
Fedora#
Arch#
WindowsInstall the latest Visual Studio IDE with Windows SDK. The Neutralinojs compilation process will use the MSVC C++ compiler (aka cl.exe
).
info
How to activate Windows 10 SDK: While installing it in the Visual Studio Installer, go to tab Workloads, section "Desktop & Mobile" and select "Desktop development with C++". On the right in "Installation details" > "Desktop development with C++" > "Optional", make sure "Windows 10 SDK" is checked.
#
macOSInstall Xcode Command Line Tools.
#
Compile the Neutralinojs framework.Run the following script in order to build the framework binaries.
info
You need to have the Python interpreter (version 3.x) installed to run this script.
Neutralinojs uses BuildZri C++ build automation tool to generate binaries on local development computers and CI/CD servers. Read the BuildZri documentation to learn more about CLI options and configuration.
#
Setup and build the clientNeutralinojs apps communicate with the Neutralinojs process via a WebSocket connection. This WebSocket connection gets initiated by the Neutralinojs client.
Clone the client repository to the same directory where you downloaded the main repository.
Install developer dependencies.
#
Executing the test appThe main repository has a simple test application that you can use during development related activities. You can enter the following command from the main repository to build and update the test app's client.
Now run the newly compiled test app with the following command.
- Linux
- macOS
- Windows
#
TestingTesting is a crucial part in every development activity. Every pull request in the main codebase will trigger the following automated tests.
- Builds on Linux, macOS, and Windows with x64 machines.
- Integration test suite.
However, you can run our integration test suite from your local computer too with the following command from the main codebase's directory.
It's always good to run the test suite for the module you've updated with the following command.
info
If you need to run tests for the extensions
module, make sure to enter npm install
from
./bin/extensions/sampleextension
first.
The above command will run test only for the given module.
#
Project directory structure#
FrameworkSource: github.com/neutralinojs/neutralinojs
api
: The native API implementation and controllers. Written in REST API style.auth
: Authentication and permissions-related logic.bin
: Test app source code.lib
: Third-party libraries source files.server
: WebSocket/HTTP communication endpoints.spec
: Integration/API test suite.scripts
: Contains automation scripts to build the framework, generate release notes, update the client library, and buildresources.neu
for the test app.
#
Client librarySource: github.com/neutralinojs/neutralino.js
src/api
: JavaScript API frontend and implementaion.src/browser
: Browser-related API implementation.src/ws
: WebSocket client implementaion.scripts
: Contains automation scripts to generate release notes.
#
Contribution guidelinesBefore, contributing to the codebase, please check the following things.
- Discuss the feature/improvement/bug-fix with the Neutralinojs team via GitHub discussions.
- Get familiar with the code style. Write your code according to the Neutralinojs code style guide.
- Become familiar with all modules in the codebase.
- Avoid adding new features to only one platform.
Thanks for helping us to make Neutralinojs better!