My motivation was to learn how to implement a complete module system for JS. It turned out to be less complex than in node.js.
- introduce a new module loading function
include. The new module system can work with both Java Script modules and native ones. - there are several new modules provided in
jsrt_modules: the native modules includesdear_imguiandsciter(TI version) bindings. The JS modules includes a a simplisticfluxmodule for building application with flux architecture. - it can build using either
V8libs orlibnodelibrary(that encompassesV8libs). - integrate
node.jsruntime so all existentnpmmodules are usable. - there is included an almost full fledged application in
projects/Noot. It is a notes editor build on top ofsciterengine. This application makes use offluxmodule. - it uses a naive build system with the command tool and the configuration file in
build/build.jsandbuild/build.jsonrespectively. - contains an experimental integration for
androidbased ontermux.
Warning
Currently I'm building on latest macOS. For other platforms it requires adaptation.
You need to have node.js installed. From build directory run:
node build.js [OPTIONS]Use help option to print all available command options:
node build.js helpcommand options:
DEBUG,RELEASE - Build type
deps-update - Pull and build dependencies before build
v8-build - Build V8 libraries
use-v8 - Build using V8 libraries. WARNING: it is not available at the moment!
clean-build - Clean build directory
clean-all - Clean all, including dependencies
addon-build[sciter|dear_imgui] - Build the specified addon
help - Show command options
When starting from scratch, the typical steps are:
- In
build.jsonedit theconfigurationfield for current build platform. For instance, on macOS Apple Silicon:
"configuration": "macos_arm64",- Update dependencies(i.e. they are specified in
build.jsonindependenciessection) and build:
node build.js deps-updateThis will first fetch all required dependencies in deps directory, and then will build them.
Normally this option has to be run once. If the dependencies are successfully built then the application executable is built.
By default, the build type is Debug. It can be specified using DEBUG|RELEASE option:
node build.js deps-update ReleaseWarning
Building node make take a while, especially for Debug.
- Build the application
node build.js [Release|Debug]There are two options to do the clean-up:
- Remove
build/outputdirectory:
node build.js clean-build- Remove build output and
depsfolder:
node build.js clean-allCurrently there are provided only two addons(bindings) to sciter TIS and
imgui(incomplete! though interesting). However, it's so much fun to create new bindings, provided you have a little C++ knowledge, and leverage them in JS.
node build.js Release addon-build:sciterNew modules should be placed into jsrt_modules sub-folders:
jsrt will load all modules found at these locations during start-up.