This file provides some details useful during development.
The project is hosted on GitHub:
To clone it:
cd ${HOME}/Work
git clone https://github.com/micro-os-plus/hello-world-qemu-template-xpack.git \
hello-world-qemu-template-xpack.git
To clone the development branch:
git clone --branch xpack-develop \
https://github.com/micro-os-plus/hello-world-qemu-template-xpack.git \
hello-world-qemu-template-xpack.git
A recent xpm, which is a portable Node.js command line application.
The package is both an xPack (used by xpm
) and a Node.js module (for
running tests).
To be accepted as a template by xpm init
, a project must:
- be an xPack (have a
package.json
with anxpack
property - have a property called
main
inpackage.json
, pointing to a JavaScript file that can be consumed byrequire()
- the main file must export a class called
XpmInitTemplate
- an instances of this class must have a
run()
method.
The template receives via the context
:
- a
log
object - the new project
config.name
, either given explicitly via--name
or inferred from the folder name - a map of
config.properties
, given explicitly via--property name=value
Apart from the unused master
branch, there are two active branches:
xpack
, with the latest stable versionxpack-develop
, with the current development version
All development is done in the xpack-develop
branch, and contributions via
Pull Requests should be directed to this branch.
When new releases are published, the xpack-develop
branch is merged
into xpack
.
Normally the tests should consume the template via xpm init
, but
this goes through the global repo in the home folder, and requires to
uninstall the xPack, to be sure that the latest version is used.
To perform the tests, run the usual npm sequence:
cd hello-world-qemu-template-xpack.git
npm install
npm run test-all
- none so far.
All available tests are also performed on GitHub Actions, as the CI on Push workflow.
The module uses ECMAScript 6 class definitions.
As style, it uses the JavaScript Standard Style, automatically checked at each commit via Travis CI.
Known and accepted exceptions:
- none.
To manually fix compliance with the style guide (where possible):
% npm run fix
> @micro-os-plus/[email protected] fix
> standard --fix
The documentation metadata follows the JSdoc tags.
To enforce checking at file level, add the following comments right after
the use strict
:
'use strict'
/* eslint valid-jsdoc: "error" */
/* eslint max-len: [ "error", 80, { "ignoreUrls": true } ] */
Note: be sure C style comments are used, C++ styles are not parsed by ESLint.