Menu

Developer Guide

Cheng JIANG Jacques Couderc

Welcome to the wiki of Sky, here is the developper guide!

Recommanded IDEs

  • vscode
  • webstorm

Development

Contributing

You are welcome to contribute to this project. Feel free to take part in the development of the Sky app (ask for user permission beforehand).
If you find a bug and want to report it or suggest a new feature, please file a ticket.

Set up a working environment

  • install npm or yarn (yarn is better), nvm
  • nvm use
  • clone this project
  • svn checkout --username=USERNAME svn+ssh://USERNAME@svn.code.sf.net/p/sky-gl02/code/ sky-gl02-code
  • yarn OR npm install
  • develop and commit

Adding a new command to the app

Each command is located in a js file in the subcmds directory
To add a new command you must add a new file in this directory using the following structure :

const command = {
    name: '<command name>',
    description: "<command description>"
};

const alias = '<command name alias>';

const arguments = {
    // Eventual arguments for the command
};

const options = {
    // Eventual options for the command
};

const action = (args, opts, logger) => {
    // Code executed once the command is typed
};

module.exports = {
    alias,
    command,
    arguments,
    options,
    action
};

Dependencies

The project uses the following packages :

  • caporal
  • cli-table3
  • vega, vega-lite, vega-embed
  • walk
  • js-beautify
  • chalk
  • dayjs
  • mkdirp
  • object-path
  • ora

mocha and chai are used to write the unit tests. Any new features should have its own unit test.
nodeunit is not used in this project since the package is no longer maintained.

Caveats

  1. To export files in PNG, you need to have node-gyp installed which requires python2.7, g++ OR VScode build tool...

  2. vega requires some system dependencies like libcairo2-dev libjpeg-dev libgif-dev on ubuntu, you need to install them by yourself. On ubuntu, you can install them bu running:
    bash sudo apt install libcairo2-dev libjpeg-dev libgif-dev

Build && Compile && Test

compile to generate an executable

npm run build
# it will generate executables for linux, win and  macos. See the executable in ./bin

unit test

npm run test
# now there is no test

Compile && Test

compile

npm run build

# it will generate executables for linux, win and  macos. See the executable in ./bin

cross-system compile

TARGET_OS=win npm run build
TARGET_OS=linux npm run build
TARGET_OS=osx npm run build

unit test

npm run test

MongoDB Logo MongoDB