1.8.0 â€ĸ Published 4 years ago

maf-cli v1.8.0

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

đŸ“ē MAF SDK Command Line Interface

Development automation for your MAF3 App projects

Commitizen friendly FOSSA Status

NPM

📖 Contents

💾 Install

$ npm i -g maf-cli
$ npm i -D maf-cli Metrological/maf3-sdk
$ touch .mafrc.js
$ maf init
$ maf --tasks

After running maf init all requirements will be created, installed and scaffolded based on the answers you provide. Some tasks have a dependency on a Metrological Dashboard API key. You can get one here.

To use this module with an already existing app, simply move that app out of the MAF3 SDK folder into it's own and run maf init on it.

As a shorthand you could run curl -L git.io/maf-cli | bash from within your project folder. And then run maf init.

Moving from maf3-sdk to maf-cli

If you are accustomed to working with the maf3-sdk then working with the maf-cli should be transparent. A lot of things are now handled for you. You can now depend your project on the maf-cli vs. running your app within the maf3-sdk. All apps from the maf3-sdk are included. As well as any dependencies. Your index.html file is no longer required. Any configuration you might have in there can be copied over to your maffile (.mafrc.js). Declaring your app, categories and ui is no longer required.

⚙ī¸ Configuration

You can configure the MAF CLI via your .mafrc.js file. It has the following (default) options available:

{
  language: `nl` // set the default language of the Store and App
, es6: true // when true all your code will be transpiled (via the Closure Compiler) to ES5 before running and publishing
, autostart: false // when true auto-starts your app when browsing to https://localhost:8443
, store: `YOUR/STORE/ID_HERE` // use this when running the store task for example: metrological/nl/external
}

Additionally, you are able to define your own tasks within your maffile.

const maf = require( 'maf-cli' )

module.exports = {
  language: `nl`
, function hello() {
    console.log( `world` )
  }
}

This can be used to integrate any other tools you might use, or preprocess certain files.

You may also set some environment variables:

LANG=en_US.utf8 # for compatibility reasons, remove if this causes issues for you
TERM=xterm-256color # for compatibility reasons, remove if this causes issues for you
NODE_ENV=production # let's make sure we are equal to production as much as possible
NODE_PORT=8080 # change to your liking
NODE_SECURE_PORT=8443 # change to your liking
DOCS_PORT=9090 # change to your liking
METROLOGICAL_API_KEY="YOUR_API_KEY_HERE" # this is used for publishing your App

â–ļī¸ Usage

$ maf

The default task (run) will run and starts the SDK Server.

To run individual tasks, use maf <task>.

To display the list of build-in tasks, use maf --tasks

For an overview of available options and commands, use maf --help

⌨ī¸ MAF key combinations:

CommandKey
stopShift + Down
play/pauseShift + Up
rewindShift + Left
forwardShift + Right
backBackspace
redF1
greenF2
yellowF3
blueF4
channel upPageUp
channel downPageDown

❌ Issue Submission

Please use GitHub Issues for issue submission.

Known Issues

The build-in proxy service uses xml2json which uses node-expat. On Windows this requires some extra work setting up. Please refer to it's documentation.

✅ Feature requests

Feature requests can be submitted via Issues as well.

Contribute

Feel free to send in any pull requests.

About

The idea for this module came from the desire to take the development of MAF3 apps into the 21st century. To allow for anyone to focus on building the app and less on managing releases and configuring the runtime environment. This module allows for your project to easily depend on the MAF3-SDK and make CI and CD more simple to handle. This is the first iteration of many more to come.

🛠 MAF3-SDK

You can learn more about the MAF3-SDK at it's website, or on GitHub.

For any questions regarding App developement please use the Metrological Helpdesk.

Šī¸ License

MIT

FOSSA Status