aidebuild
Builds multi-language packages and related documentation
Description
This packages provides utilities to develop multi-language modular tools for web based applications.
-
It is based on the npmjs package system and on the git versioning system.
-
This and all related packages are distributed under CECILL-C (a GNU GPL compatible licence adapted also to European regulation rules) and CC-BY (for the documentation and media resources) licences.
Manifest
This open-ended packages target who knows programming and how to install software, using command line terminal, to avoid any non necessary opaque, when not spurious, user interface overload.
What is shared here is essentially existing software usage: hours of foraging and testing in order to find the best tools and best tool's options is simply horded in the documented scripts and makefile.
Focus is put on the documentation: good developers write the documentation before the code, explicitizing what is to be done, before doing it, don't they? Several standard existing software are summoned via make actions to this end.
Another way to save time is to have scripted the generation of certain files (e.g., the README); nothing clever, just avoiding copy-paste time and mistake when the package evolves.
It also offers an alternative to non pythonolic (i.e., Python addicted), but agnostic developers that are not frighten of using the best adapted language for their purpose.
Technical choices
The code is expected to be a set of C/C++ and JavaScript source files, while a Python wrapper is available.
- JavaScript for web development.
- C/C++ for efficient parts of the code
- Python to allow a maximal number of person to use it.
As a web service, it implements a local node.js server, and wrap C/C++ code using the node-addon-api, as defined the aideweb package.
The documentation uses markdown syntax and JsDoc tags, with the jsdoc mechanism and the docdash theme. Documentation generation includes source files normalization (i.e., beautifying or uncrustification), multi-language documentation generation and production of images or PDF from LaTeX formula or latex or libreoffice drawing files.
Coding rules
A few simple coding rules allows multi-language development to be smooth and easy.
Notion of factory
When object oriented programming is not necessary, static methods are encapsulated in "factories", i.e., group of functions, accessible via the factory name, e.g., aidesys::regexMatch(string, regex); in C++ or slugstring.fill(dictionary); in JavaScript, thus without class object instance.
-
Naming conventions:
- Factory names are all in lower-case.
- Static method names are verbs, in lower-case. Compounded names use the camelCase convention.
- Static methods parameters names are nouns. Compounded parameters names hyphenation use the underscore
_hyphen, including JSON tuples data names.
-
Parameters type:
- Boolean
bool, integerint(oruintif unsigned),double(for floating point values) andstringare the used scalar values (i.e. literals). - Otherwise, parameters are objects, defined via classes.
- Boolean
Notion of Classes
-
For multi-language call, classes better use:
- Parameter-less constructor (which is fine also for internal language use).
- Setters: i.e.,
set(value)method to set the whole object, andset(name, value)to set an object parameter. - Getters: i.e.,
get(name)orgetName()method to get an object parameter orisName()to get a boolean value parameter.- The
at(name)method does not create a default value while theget(name)may create an entry for this parameter (in coherence with a subscript[]operator. - The object
size()orcount()methods are not prefixed by get in coherence with the main usage.
- The
- Casters: e.g.,
asString()to get the whole representation as a string (with similar convention for other convention).
-
Naming conventions:
- Class names are nouns, instance names are verbs. Compounded names use the camelCase convention, methods parameters are nouns, using underscore
_hyphen. - The
toString()method is prohibited, because of Python wrapping.
- Class names are nouns, instance names are verbs. Compounded names use the camelCase convention, methods parameters are nouns, using underscore
Package repository
- Package files: https://gitlab.inria.fr/line/aide-group/aidebuild
- Package documentation: https://line.gitlabpages.inria.fr/aide-group/aidebuild
- Source files: https://gitlab.inria.fr/line/aide-group/aidebuild/-/tree/master/src
- Saved on softwareherirage.org
- Version
2.1.0 - License
CECILL-C
Installation
User simple installation
npm install git+https://gitlab.inria.fr/line/aide-group/aidebuild.git
Co-developper installation
- See the related documentation
Please refer to the installation guide for installation.
Usage
npm script usage
npm install --quiet : installs all package dependencies and sources.
npm run build: builds the different compiled, documentation and test files.
npm test : runs functional and non-regression tests.
npm run clean: cleans installation files.
Dependencies
- cligui2: ClI-GUI but better. Beautiful graphical interface on command line
- docdash: A clean, responsive documentation template theme for JSDoc 3 inspired by lodash and minami
- js-beautify: beautifier.io for node
- jsdoc: An API documentation generator for JavaScript.
- uglify-js: JavaScript parser, mangler/compressor and beautifier toolkit
Author
- Thierry ViƩville thierry.vieville@inria.fr