# All files / dist/cli index.js

18.67% Statements 14/75
0% Branches 0/37
0% Functions 0/9
18.87% Lines 10/53

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    2404x
    4x

    4x

    4x

    4x

    4x

    4x

    4x

    4x

    4x
     var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.logHelp=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _chalk=_interopRequireDefault(require("chalk"));
    var _inquirer=_interopRequireDefault(require("inquirer"));
    var _logger=require("../systemTools/logger");
    var _workspace=require("../projectTools/workspace");
    var _projectGenerator=require("../projectTools/projectGenerator");
    var _templateTools=require("../templateTools");
    var _target=require("../platformTools/target");
    var _pluginTools=require("../pluginTools");
    var _platformTools=require("../platformTools");
    var _buildHooks=require("../projectTools/buildHooks");

    var COMMANDS={
    start:{
    fn:_workspace.listWorkspaces},

    build:{},
    export:{},
    app:{},
    new:{
    fn:_projectGenerator.createNewProject,
    desc:'Creates new project',
    params:['mono','ci']},

    help:{
    fn:logHelp},

    configure:{},
    switch:{},
    link:{},
    platform:{
    desc:'Manages native platform projects',
    subCommands:{
    eject:{
    fn:_platformTools.platformEject},

    list:{
    fn:_platformTools.platformList},

    connect:{
    fn:_platformTools.platformConnect},

    configure:{
    fn:_platformTools.platformConfigure}}},

    run:{},
    package:{},
    deploy:{},
    target:{
    desc:'Manages simulators and emulators',
    subCommands:{
    launch:{
    fn:_target.targetLaunch},

    list:{
    fn:_target.targetList}}},

    plugin:{
    desc:'Manages all plugins',
    subCommands:{
    add:{
    fn:_pluginTools.pluginAdd},

    list:{
    fn:_pluginTools.pluginList},

    update:{
    fn:_pluginTools.pluginUpdate}}},

    log:{},
    hooks:{},
    status:{},
    fix:{},
    clean:{},
    tool:{},
    template:{
    desc:'Manages rnv and project templates',
    subCommands:{
    add:{
    fn:_templateTools.templateAdd},

    list:{
    fn:_templateTools.templateList},

    apply:{
    fn:_templateTools.templateApply}}},

    debug:{},
    crypto:{},
    workspace:{
    subCommands:{
    list:{
    fn:_workspace.listWorkspaces}}}};

    var run=function run(c){var _cmd$subCommands;
    (0,_logger.logTask)('cli');

    var cmd=COMMANDS[c.command];
    var cmdFn=cmd==null?void 0:cmd.fn;
    var subCmd=cmd==null?void 0:(_cmd$subCommands=cmd.subCommands)==null?void 0:_cmd$subCommands[c.subCommand];
    var subCmdFn=subCmd==null?void 0:subCmd.fn;

    if(cmd){
    if(c.subCommand==='help'){
    return _execCommandHep(c,cmd);
    }
    if(cmdFn){
    if(subCmdFn){
    return subCmdFn(c);
    }
    return cmdFn(c);
    }
    if(subCmdFn){
    return subCmdFn(c);
    }
    return _handleUnknownSubCommand(c);
    }
    return _handleUnknownCommand(c);
    };

    var _execCommandHep=function _execCommandHep(c,cmd){var opts,subCommands;return _regenerator.default.async(function _execCommandHep$(_context){while(1){switch(_context.prev=_context.next){case 0:
    opts='';
    subCommands='';

    if(cmd.subCommands){
    subCommands='\nSub Commands: \n';
    subCommands+=Object.keys(cmd.subCommands).join(', ');
    subCommands+='\n';
    }

    if(cmd.params){
    opts='Options:\n';
    opts+=(cmd.params||[]).reduce(function(t,v){return t+"--"+v+"\n";},'');
    }

    console.log("\nCommand: "+
    c.command+"\n\nDescription: "+

    cmd.desc+".\n"+
    subCommands+"\n"+
    opts+"\nMore info at "+
    _chalk.default.blue("https://renative.org/docs/rnv-"+c.command)+"\n");return _context.abrupt("return",

    Promise.resolve());case 6:case"end":return _context.stop();}}});};

    var _handleUnknownSubCommand=function _handleUnknownSubCommand(c){var _COMMANDS$c$command;var cmds,_ref,subCommand;return _regenerator.default.async(function _handleUnknownSubCommand$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:
    (0,_logger.logTask)('_handleUnknownSubCommand');
    (0,_logger.logWarning)("cli: Command "+_chalk.default.white.bold(c.command)+" does not support method "+_chalk.default.white.bold(c.subCommand)+"!");

    cmds=(_COMMANDS$c$command=COMMANDS[c.command])==null?void 0:_COMMANDS$c$command.subCommands;_context2.next=5;return _regenerator.default.awrap(

    _inquirer.default.prompt({
    type:'list',
    name:'subCommand',
    message:'Pick a subCommand',
    choices:Object.keys(cmds)}));case 5:_ref=_context2.sent;subCommand=_ref.subCommand;

    c.subCommand=subCommand;return _context2.abrupt("return",
    run(c));case 9:case"end":return _context2.stop();}}});};

    var _handleUnknownCommand=function _handleUnknownCommand(c){var _ref2,command;return _regenerator.default.async(function _handleUnknownCommand$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:
    (0,_logger.logTask)('_handleUnknownCommand');
    (0,_logger.logWarning)("cli: Command "+_chalk.default.white.bold(c.command)+" not supported!");_context3.next=4;return _regenerator.default.awrap(
    _inquirer.default.prompt({
    type:'list',
    name:'command',
    message:'Pick a command',
    choices:Object.keys(COMMANDS)}));case 4:_ref2=_context3.sent;command=_ref2.command;

    c.command=command;return _context3.abrupt("return",
    run(c));case 8:case"end":return _context3.stop();}}});};

    var logHelp=function logHelp(){
    var cmdsString='';
    for(var key in COMMANDS){
    cmdsString+=key+", ";
    }

    console.log("\n"+
    _chalk.default.bold.white('COMMANDS:')+"\n\n"+

    cmdsString+"\n\n"+

    _chalk.default.bold.white('OPTIONS:')+"\n\n'-i, --info', 'Show full debug info'\n'-u, --update', 'Force update dependencies (iOS only)'\n'-p, --platform <value>', 'Select specific platform' // <ios|android|web|...>\n'-c, --appConfigID <value>', 'Select specific appConfigID' // <ios|android|web|...>\n'-t, --target <value>', 'Select specific simulator' // <.....>\n'-d, --device [value]', 'Select connected device'\n'-s, --scheme <value>', 'Select build scheme' // <Debug | Release>\n'-f, --filter <value>', 'Filter Value'\n'-l, --list', 'Return list of items related to command' // <alpha|beta|prod>\n'-r, --reset', 'Also perform reset'\n'-b, --blueprint', 'Blueprint for targets'\n'-h, --host <value>', 'Custom Host IP'\n'-x, --exeMethod <value>', 'Executable method in buildHooks'\n'-P, --port <value>', 'Custom Port'\n'-H, --help', 'Help'\n'-D, --debug', 'enable remote debugger'\n'--hosted', 'Run in a hosted environment (skip bundleAssets)'\n'--debugIp <value>', '(optional) overwrite the ip to which the remote debugger will connect'\n");

    };exports.logHelp=logHelp;var _default=

    run;exports.default=_default;
    //# sourceMappingURL=index.js.map