UNPKG

roc

Version:

Build modern web applications easily

1,732 lines (1,731 loc) 82.1 kB
{ "type": "Program", "start": 0, "end": 1475, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 45, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 37, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 37 } }, "specifiers": [], "source": { "type": "Literal", "start": 7, "end": 36, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 36 } }, "value": "source-map-support/register", "rawValue": "source-map-support/register", "raw": "'source-map-support/register'" } }, { "type": "ImportDeclaration", "start": 39, "end": 77, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 38 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 48, "end": 53, "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 14 } }, "imported": { "type": "Identifier", "start": 48, "end": 53, "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 14 } }, "name": "spawn" }, "local": { "type": "Identifier", "start": 48, "end": 53, "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 14 } }, "name": "spawn" } } ], "importKind": "value", "source": { "type": "Literal", "start": 61, "end": 76, "loc": { "start": { "line": 3, "column": 22 }, "end": { "line": 3, "column": 37 } }, "value": "child_process", "rawValue": "child_process", "raw": "'child_process'" }, "trailingComments": [ { "type": "Block", "value": "*\n * Executes a command string.\n *\n * Quite simple in its current state and should be expected to change in the future.\n * Can manage multiple commands if they are divided by either & or &&. Important that there is spacing on both sides.\n *\n * @param {string} command - A command string that should run.\n * @returns {Promise} - A promise that is resolved when all the commands are completed.\n ", "start": 79, "end": 476, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 13, "column": 3 } }, "range": [ 79, 476 ] } ] }, { "type": "ExportNamedDeclaration", "start": 477, "end": 606, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 17, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 484, "end": 606, "loc": { "start": { "line": 14, "column": 7 }, "end": { "line": 17, "column": 1 } }, "id": { "type": "Identifier", "start": 493, "end": 500, "loc": { "start": { "line": 14, "column": 16 }, "end": { "line": 14, "column": 23 } }, "name": "execute", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 501, "end": 508, "loc": { "start": { "line": 14, "column": 24 }, "end": { "line": 14, "column": 31 } }, "name": "command" } ], "body": { "type": "BlockStatement", "start": 510, "end": 606, "loc": { "start": { "line": 14, "column": 33 }, "end": { "line": 17, "column": 1 } }, "body": [ { "type": "VariableDeclaration", "start": 516, "end": 562, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 50 } }, "declarations": [ { "type": "VariableDeclarator", "start": 522, "end": 561, "loc": { "start": { "line": 15, "column": 10 }, "end": { "line": 15, "column": 49 } }, "id": { "type": "Identifier", "start": 522, "end": 538, "loc": { "start": { "line": 15, "column": 10 }, "end": { "line": 15, "column": 26 } }, "name": "parallelCommands" }, "init": { "type": "CallExpression", "start": 541, "end": 561, "loc": { "start": { "line": 15, "column": 29 }, "end": { "line": 15, "column": 49 } }, "callee": { "type": "MemberExpression", "start": 541, "end": 554, "loc": { "start": { "line": 15, "column": 29 }, "end": { "line": 15, "column": 42 } }, "object": { "type": "Identifier", "start": 541, "end": 548, "loc": { "start": { "line": 15, "column": 29 }, "end": { "line": 15, "column": 36 } }, "name": "command" }, "property": { "type": "Identifier", "start": 549, "end": 554, "loc": { "start": { "line": 15, "column": 37 }, "end": { "line": 15, "column": 42 } }, "name": "split" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 555, "end": 560, "loc": { "start": { "line": 15, "column": 43 }, "end": { "line": 15, "column": 48 } }, "value": {}, "rawValue": {}, "raw": "/ & /", "regex": { "pattern": " & ", "flags": "" } } ] } } ], "kind": "const" }, { "type": "ReturnStatement", "start": 567, "end": 604, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 41 } }, "argument": { "type": "CallExpression", "start": 574, "end": 603, "loc": { "start": { "line": 16, "column": 11 }, "end": { "line": 16, "column": 40 } }, "callee": { "type": "Identifier", "start": 574, "end": 585, "loc": { "start": { "line": 16, "column": 11 }, "end": { "line": 16, "column": 22 } }, "name": "executeNext" }, "arguments": [ { "type": "Identifier", "start": 586, "end": 602, "loc": { "start": { "line": 16, "column": 23 }, "end": { "line": 16, "column": 39 } }, "name": "parallelCommands" } ] } } ] }, "leadingComments": [ { "type": "Block", "value": "*\n * Executes a command string.\n *\n * Quite simple in its current state and should be expected to change in the future.\n * Can manage multiple commands if they are divided by either & or &&. Important that there is spacing on both sides.\n *\n * @param {string} command - A command string that should run.\n * @returns {Promise} - A promise that is resolved when all the commands are completed.\n ", "start": 79, "end": 476, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 13, "column": 3 } }, "range": [ 79, 476 ] } ], "trailingComments": [] }, "specifiers": [], "source": null, "leadingComments": [ { "type": "Block", "value": "*\n * Executes a command string.\n *\n * Quite simple in its current state and should be expected to change in the future.\n * Can manage multiple commands if they are divided by either & or &&. Important that there is spacing on both sides.\n *\n * @param {string} command - A command string that should run.\n * @returns {Promise} - A promise that is resolved when all the commands are completed.\n ", "start": 79, "end": 476, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 13, "column": 3 } }, "range": [ 79, 476 ] } ] }, { "type": "FunctionDeclaration", "start": 608, "end": 845, "loc": { "start": { "line": 19, "column": 0 }, "end": { "line": 25, "column": 1 } }, "id": { "type": "Identifier", "start": 617, "end": 628, "loc": { "start": { "line": 19, "column": 9 }, "end": { "line": 19, "column": 20 } }, "name": "executeNext" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 629, "end": 645, "loc": { "start": { "line": 19, "column": 21 }, "end": { "line": 19, "column": 37 } }, "name": "parallelCommands" } ], "body": { "type": "BlockStatement", "start": 647, "end": 845, "loc": { "start": { "line": 19, "column": 39 }, "end": { "line": 25, "column": 1 } }, "body": [ { "type": "VariableDeclaration", "start": 653, "end": 698, "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 20, "column": 49 } }, "declarations": [ { "type": "VariableDeclarator", "start": 659, "end": 697, "loc": { "start": { "line": 20, "column": 10 }, "end": { "line": 20, "column": 48 } }, "id": { "type": "Identifier", "start": 659, "end": 670, "loc": { "start": { "line": 20, "column": 10 }, "end": { "line": 20, "column": 21 } }, "name": "syncCommand" }, "init": { "type": "CallExpression", "start": 673, "end": 697, "loc": { "start": { "line": 20, "column": 24 }, "end": { "line": 20, "column": 48 } }, "callee": { "type": "MemberExpression", "start": 673, "end": 695, "loc": { "start": { "line": 20, "column": 24 }, "end": { "line": 20, "column": 46 } }, "object": { "type": "Identifier", "start": 673, "end": 689, "loc": { "start": { "line": 20, "column": 24 }, "end": { "line": 20, "column": 40 } }, "name": "parallelCommands" }, "property": { "type": "Identifier", "start": 690, "end": 695, "loc": { "start": { "line": 20, "column": 41 }, "end": { "line": 20, "column": 46 } }, "name": "shift" }, "computed": false }, "arguments": [] } } ], "kind": "const" }, { "type": "IfStatement", "start": 703, "end": 813, "loc": { "start": { "line": 21, "column": 4 }, "end": { "line": 23, "column": 5 } }, "test": { "type": "Identifier", "start": 707, "end": 718, "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 21, "column": 19 } }, "name": "syncCommand" }, "consequent": { "type": "BlockStatement", "start": 720, "end": 813, "loc": { "start": { "line": 21, "column": 21 }, "end": { "line": 23, "column": 5 } }, "body": [ { "type": "ReturnStatement", "start": 730, "end": 807, "loc": { "start": { "line": 22, "column": 8 }, "end": { "line": 22, "column": 85 } }, "argument": { "type": "CallExpression", "start": 737, "end": 806, "loc": { "start": { "line": 22, "column": 15 }, "end": { "line": 22, "column": 84 } }, "callee": { "type": "MemberExpression", "start": 737, "end": 748, "loc": { "start": { "line": 22, "column": 15 }, "end": { "line": 22, "column": 26 } }, "object": { "type": "Identifier", "start": 737, "end": 744, "loc": { "start": { "line": 22, "column": 15 }, "end": { "line": 22, "column": 22 } }, "name": "Promise" }, "property": { "type": "Identifier", "start": 745, "end": 748, "loc": { "start": { "line": 22, "column": 23 }, "end": { "line": 22, "column": 26 } }, "name": "all" }, "computed": false }, "arguments": [ { "type": "ArrayExpression", "start": 749, "end": 805, "loc": { "start": { "line": 22, "column": 27 }, "end": { "line": 22, "column": 83 } }, "elements": [ { "type": "CallExpression", "start": 750, "end": 773, "loc": { "start": { "line": 22, "column": 28 }, "end": { "line": 22, "column": 51 } }, "callee": { "type": "Identifier", "start": 750, "end": 760, "loc": { "start": { "line": 22, "column": 28 }, "end": { "line": 22, "column": 38 } }, "name": "runCommand" }, "arguments": [ { "type": "Identifier", "start": 761, "end": 772, "loc": { "start": { "line": 22, "column": 39 }, "end": { "line": 22, "column": 50 } }, "name": "syncCommand" } ] }, { "type": "CallExpression", "start": 775, "end": 804, "loc": { "start": { "line": 22, "column": 53 }, "end": { "line": 22, "column": 82 } }, "callee": { "type": "Identifier", "start": 775, "end": 786, "loc": { "start": { "line": 22, "column": 53 }, "end": { "line": 22, "column": 64 } }, "name": "executeNext" }, "arguments": [ { "type": "Identifier", "start": 787, "end": 803, "loc": { "start": { "line": 22, "column": 65 }, "end": { "line": 22, "column": 81 } }, "name": "parallelCommands" } ] } ] } ] } } ] }, "alternate": null }, { "type": "ReturnStatement", "start": 818, "end": 843, "loc": { "start": { "line": 24, "column": 4 }, "end": { "line": 24, "column": 29 } }, "argument": { "type": "CallExpression", "start": 825, "end": 842, "loc": { "start": { "line": 24, "column": 11 }, "end": { "line": 24, "column": 28 } }, "callee": { "type": "MemberExpression", "start": 825, "end": 840, "loc": { "start": { "line": 24, "column": 11 }, "end": { "line": 24, "column": 26 } }, "object": { "type": "Identifier", "start": 825, "end": 832, "loc": { "start": { "line": 24, "column": 11 }, "end": { "line": 24, "column": 18 } }, "name": "Promise" }, "property": { "type": "Identifier", "start": 833, "end": 840, "loc": { "start": { "line": 24, "column": 19 }, "end": { "line": 24, "column": 26 } }, "name": "resolve" }, "computed": false }, "arguments": [] } } ] } }, { "type": "FunctionDeclaration", "start": 847, "end": 1474, "loc": { "start": { "line": 27, "column": 0 }, "end": { "line": 44, "column": 1 } }, "id": { "type": "Identifier", "start": 856, "end": 866, "loc": { "start": { "line": 27, "column": 9 }, "end": { "line": 27, "column": 19 } }, "name": "runCommand" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 867, "end": 878, "loc": { "start": { "line": 27, "column": 20 }, "end": { "line": 27, "column": 31 } }, "name": "syncCommand" } ], "body": { "type": "BlockStatement", "start": 880, "end": 1474, "loc": { "start": { "line": 27, "column": 33 }, "end": { "line": 44, "column": 1 } }, "body": [ { "type": "VariableDeclaration", "start": 886, "end": 933, "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 51 } }, "declarations": [ { "type": "VariableDeclarator", "start": 892, "end": 932, "loc": { "start": { "line": 28, "column": 10 }, "end": { "line": 28, "column": 50 } }, "id": { "type": "Identifier", "start": 892, "end": 904, "loc": { "start": { "line": 28, "column": 10 }, "end": { "line": 28, "column": 22 } }, "name": "syncCommands" }, "init": { "type": "CallExpression", "start": 907, "end": 932, "loc": { "start": { "line": 28, "column": 25 }, "end": { "line": 28, "column": 50 } }, "callee": { "type": "MemberExpression", "start": 907, "end": 924, "loc": { "start": { "line": 28, "column": 25 }, "end": { "line": 28, "column": 42 } }, "object": { "type": "Identifier", "start": 907, "end": 918, "loc": { "start": { "line": 28, "column": 25 }, "end": { "line": 28, "column": 36 } }, "name": "syncCommand" }, "property": { "type": "Identifier", "start": 919, "end": 924, "loc": { "start": { "line": 28, "column": 37 }, "end": { "line": 28, "column": 42 } }, "name": "split" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 925, "end": 931, "loc": { "start": { "line": 28, "column": 43 }, "end": { "line": 28, "column": 49 } }, "value": {}, "rawValue": {}, "raw": "/ && /", "regex": { "pattern": " && ", "flags": "" } } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 938, "end": 975, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 41 } }, "declarations": [ { "type": "VariableDeclarator", "start": 944, "end": 974, "loc": { "start": { "line": 29, "column": 10 }, "end": { "line": 29, "column": 40 } }, "id": { "type": "Identifier", "start": 944, "end": 951, "loc": { "start": { "line": 29, "column": 10 }, "end": { "line": 29, "column": 17 } }, "name": "command" }, "init": { "type": "CallExpression", "start": 954, "end": 974, "loc": { "start": { "line": 29, "column": 20 }, "end": { "line": 29, "column": 40 } }, "callee": { "type": "MemberExpression", "start": 954, "end": 972, "loc": { "start": { "line": 29, "column": 20 }, "end": { "line": 29, "column": 38 } }, "object": { "type": "Identifier", "start": 954, "end": 966, "loc": { "start": { "line": 29, "column": 20 }, "end": { "line": 29, "column": 32 } }, "name": "syncCommands" }, "property": { "type": "Identifier", "start": 967, "end": 972, "loc": { "start": { "line": 29, "column": 33 }, "end": { "line": 29, "column": 38 } }, "name": "shift" }, "computed": false }, "arguments": [] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 980, "end": 1016, "loc": { "start": { "line": 30, "column": 4 }, "end": { "line": 30, "column": 40 } }, "declarations": [ { "type": "VariableDeclarator", "start": 986, "end": 1015, "loc": { "start": { "line": 30, "column": 10 }, "end": { "line": 30, "column": 39 } }, "id": { "type": "Identifier", "start": 986, "end": 991, "loc": { "start": { "line": 30, "column": 10 }, "end": { "line": 30, "column": 15 } }, "name": "parts" }, "init": { "type": "CallExpression", "start": 994, "end": 1015, "loc": { "start": { "line": 30, "column": 18 }, "end": { "line": 30, "column": 39 } }, "callee": { "type": "MemberExpression", "start": 994, "end": 1007, "loc": { "start": { "line": 30, "column": 18 }, "end": { "line": 30, "column": 31 } }, "object": { "type": "Identifier", "start": 994, "end": 1001, "loc": { "start": { "line": 30, "column": 18 }, "end": { "line": 30, "column": 25 } }, "name": "command" }, "property": { "type": "Identifier", "start": 1002, "end": 1007, "loc": { "start": { "line": 30, "column": 26 }, "end": { "line": 30, "column": 31 } }, "name": "split" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 1008, "end": 1014, "loc": { "start": { "line": 30, "column": 32 }, "end": { "line": 30, "column": 38 } }, "value": {}, "rawValue": {}, "raw": "/\\s+/g", "regex": { "pattern": "\\s+", "flags": "g" } } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 1021, "end": 1042, "loc": { "start": { "line": 31, "column": 4 }, "end": { "line": 31, "column": 25 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1027, "end": 1041, "loc": { "start": { "line": 31, "column": 10 }, "end": { "line": 31, "column": 24 } }, "id": { "type": "Identifier", "start": 1027, "end": 1030, "loc": { "start": { "line": 31, "column": 10 }, "end": { "line": 31, "column": 13 } }, "name": "cmd" }, "init": { "type": "MemberExpression", "start": 1033, "end": 1041, "loc": { "start": { "line": 31, "column": 16 }, "end": { "line": 31, "column": 24 } }, "object": { "type": "Identifier", "start": 1033, "end": 1038, "loc": { "start": { "line": 31, "column": 16 }, "end": { "line": 31, "column": 21 } }, "name": "parts" }, "property": { "type": "Literal", "start": 1039, "end": 1040, "loc": { "start": { "line": 31, "column": 22 }, "end": { "line": 31, "column": 23 } }, "value": 0, "rawValue": 0, "raw": "0" }, "computed": true } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 1047, "end": 1075, "loc": { "start": { "line": 32, "column": 4 }, "end": { "line": 32, "column": 32 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1053, "end": 1074, "loc": { "start": { "line": 32, "column": 10 }, "end": { "line": 32, "column": 31 } }, "id": { "type": "Identifier", "start": 1053, "end": 1057, "loc": { "start": { "line": 32, "column": 10 }, "end": { "line": 32, "column": 14 } }, "name": "args" }, "init": { "type": "CallExpression", "start": 1060, "end": 1074, "loc": { "start": { "line": 32, "column": 17 }, "end": { "line": 32, "column": 31 } }, "callee": { "type": "MemberExpression", "start": 1060, "end": 1071, "loc": { "start": { "line": 32, "column": 17 }, "end": { "line": 32, "column": 28 } }, "object": { "type": "Identifier", "start": 1060, "end": 1065, "loc": { "start": { "line": 32, "column": 17 }, "end": { "line": 32, "column": 22 } }, "name": "parts" }, "property": { "type": "Identifier", "start": 1066, "end": 1071, "loc": { "start": { "line": 32, "column": 23 }, "end": { "line": 32, "column": 28 } }, "name": "slice" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 1072, "end": 1073, "loc": { "start": { "line": 32, "column": 29 }, "end": { "line": 32, "column": 30 } }, "value": 1, "rawValue": 1, "raw": "1" } ] } } ], "kind": "const" }, { "type": "ReturnStatement", "start": 1080, "end": 1472, "loc": { "start": { "line": 33, "column": 4 }, "end": { "line": 43, "column": 7 } }, "argument": { "type": "NewExpression", "start": 1087, "end": 1471, "loc": { "start": { "line": 33, "column": 11 }, "end": { "line": 43, "column": 6 } }, "callee": { "type": "Identifier", "start": 1091, "end": 1098, "loc": { "start": { "line": 33, "column": 15 }, "end": { "line": 33, "column": 22 } }, "name": "Promise" }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 1099, "end": 1470, "loc": { "start": { "line": 33, "column": 23 }, "end": { "line": 43, "column": 5