cmd2app
cmd2app - Convert you command line client to electron app. =================
Last updated 2 years ago by l842891024 .
ISC · Original npm · Tarball
$ cnpm install cmd2app 
SYNC missed versions from official npm registry.

cmd2app - Convert you command line client to electron app.

Install

(sudo) npm install cmd2app -g

How to convert?

  • Complete your command line client.

  • Add some field to package.json to describe your command line client.

    All options as follow example.

    /* package.json */
    {
        "name": "cmd2app example",
        // ...
        "cmd2app" : {
            "repository": "https://github.com/gomeplusFED/meixin-h5-proxy",  // your repo address
            "title": "美信H5 CDN代理模块", // title your want to show
            "bin": ["proxy", "test"], // bin entrance
            "globalOptions": { // global options
                "dir": { // option detail
                    "desc": "the catalog to be proxyed" // option desc
                },
                "port": {
                    "desc": "http portal, default 80"
                },
                "ports": {
                    "desc": "https portal, default 443"
                },
                "foreign": {
                    "desc": "public dependencies path"
                },
                "path": {
                    "desc": "middle path,default /m/app/src"
                },
                "raw": {
                    "desc": "raw path"
                }
            },
            "command": { // command
                "new": { // key
                    "params": [{ //parmas
                        "desc": "repo address" // params desc
                    }, {
                        "desc": "local path"
                    }],
                    "options": { // command options
                        "con": {
                            "desc": "con desc"
                        },
                        "abc": {
                            "desc": "abc desc"
                        }
                    },
                    "desc": "this is test cmd" // command desc
                },
                "test": {
                    "params": [{
                        "desc": "test params"
                    }],
                    "options": {
                        "dir": "the catalog to be proxyed"
                    },
                    "desc": "# create a new app with an official repo"
                }
            }
        }
    }
    

    For example.

    bin + global options

    proxy --dir="/c" --path="/b" --foreign="/a" --port=8011

    proxy -> bin
    dir/path/foreign/port -> global options

    bin + global options + command + command options

    proxy --port=8001 new a b --con=123

    proxy -> bin
    port -> global option
    new -> command
    a -> command params 1
    b -> command params 2
    con -> command option

  • Use cmd2app to build your app.

    (sudo) npm install cmd2app -g
    
    cmd2app new [author/repo] [path]
    
    cd [path] && npm install
    
    electron [path]/src/main/app.babel.js # you should global install electron
    
    Note:
    • Final file not a full app, it's just source code what can run by electron.

    • If you want run your app, you should install electron environment, and use some package tools to package your app, like electron-builder / electron-packager and so on.

    • Also, you can wrap your app further to a plugin for FET. FET is a plugin plataform, you can easily wrap your app to a plugin. More in here

Some images .

  • Main

    main1

  • With all options

    main2

  • Run

    main3

  • Run result

    main4

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 97
Dependencies (43)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |