UNPKG

backed-cli

Version:

The official command line interface for Backed

1,611 lines (1,610 loc) 886 kB
{ "type": "File", "start": 0, "end": 2634, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 93, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 2634, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 93, "column": 0 } }, "sourceType": "module", "body": [ { "type": "VariableDeclaration", "start": 14, "end": 54, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 40 } }, "declarations": [ { "type": "VariableDeclarator", "start": 20, "end": 53, "loc": { "start": { "line": 2, "column": 6 }, "end": { "line": 2, "column": 39 } }, "id": { "type": "ObjectPattern", "start": 20, "end": 26, "loc": { "start": { "line": 2, "column": 6 }, "end": { "line": 2, "column": 12 } }, "properties": [ { "type": "ObjectProperty", "start": 21, "end": 25, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 11 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 21, "end": 25, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 11 }, "identifierName": "fork" }, "name": "fork" }, "value": { "type": "Identifier", "start": 21, "end": 25, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 11 }, "identifierName": "fork" }, "name": "fork" }, "extra": { "shorthand": true } } ] }, "init": { "type": "CallExpression", "start": 29, "end": 53, "loc": { "start": { "line": 2, "column": 15 }, "end": { "line": 2, "column": 39 } }, "callee": { "type": "Identifier", "start": 29, "end": 36, "loc": { "start": { "line": 2, "column": 15 }, "end": { "line": 2, "column": 22 }, "identifierName": "require" }, "name": "require" }, "arguments": [ { "type": "StringLiteral", "start": 37, "end": 52, "loc": { "start": { "line": 2, "column": 23 }, "end": { "line": 2, "column": 38 } }, "extra": { "rawValue": "child_process", "raw": "'child_process'" }, "value": "child_process" } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 55, "end": 92, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 37 } }, "declarations": [ { "type": "VariableDeclarator", "start": 61, "end": 91, "loc": { "start": { "line": 3, "column": 6 }, "end": { "line": 3, "column": 36 } }, "id": { "type": "Identifier", "start": 61, "end": 69, "loc": { "start": { "line": 3, "column": 6 }, "end": { "line": 3, "column": 14 }, "identifierName": "chokidar" }, "name": "chokidar" }, "init": { "type": "CallExpression", "start": 72, "end": 91, "loc": { "start": { "line": 3, "column": 17 }, "end": { "line": 3, "column": 36 } }, "callee": { "type": "Identifier", "start": 72, "end": 79, "loc": { "start": { "line": 3, "column": 17 }, "end": { "line": 3, "column": 24 }, "identifierName": "require" }, "name": "require" }, "arguments": [ { "type": "StringLiteral", "start": 80, "end": 90, "loc": { "start": { "line": 3, "column": 25 }, "end": { "line": 3, "column": 35 } }, "extra": { "rawValue": "chokidar", "raw": "'chokidar'" }, "value": "chokidar" } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 93, "end": 122, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 29 } }, "declarations": [ { "type": "VariableDeclarator", "start": 99, "end": 121, "loc": { "start": { "line": 4, "column": 6 }, "end": { "line": 4, "column": 28 } }, "id": { "type": "Identifier", "start": 99, "end": 103, "loc": { "start": { "line": 4, "column": 6 }, "end": { "line": 4, "column": 10 }, "identifierName": "path" }, "name": "path" }, "init": { "type": "CallExpression", "start": 106, "end": 121, "loc": { "start": { "line": 4, "column": 13 }, "end": { "line": 4, "column": 28 } }, "callee": { "type": "Identifier", "start": 106, "end": 113, "loc": { "start": { "line": 4, "column": 13 }, "end": { "line": 4, "column": 20 }, "identifierName": "require" }, "name": "require" }, "arguments": [ { "type": "StringLiteral", "start": 114, "end": 120, "loc": { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 27 } }, "extra": { "rawValue": "path", "raw": "'path'" }, "value": "path" } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 123, "end": 162, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 39 } }, "declarations": [ { "type": "VariableDeclarator", "start": 129, "end": 161, "loc": { "start": { "line": 5, "column": 6 }, "end": { "line": 5, "column": 38 } }, "id": { "type": "Identifier", "start": 129, "end": 141, "loc": { "start": { "line": 5, "column": 6 }, "end": { "line": 5, "column": 18 }, "identifierName": "EventEmitter" }, "name": "EventEmitter" }, "init": { "type": "CallExpression", "start": 144, "end": 161, "loc": { "start": { "line": 5, "column": 21 }, "end": { "line": 5, "column": 38 } }, "callee": { "type": "Identifier", "start": 144, "end": 151, "loc": { "start": { "line": 5, "column": 21 }, "end": { "line": 5, "column": 28 }, "identifierName": "require" }, "name": "require" }, "arguments": [ { "type": "StringLiteral", "start": 152, "end": 160, "loc": { "start": { "line": 5, "column": 29 }, "end": { "line": 5, "column": 37 } }, "extra": { "rawValue": "events", "raw": "'events'" }, "value": "events" } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 163, "end": 215, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 52 } }, "declarations": [ { "type": "VariableDeclarator", "start": 169, "end": 214, "loc": { "start": { "line": 6, "column": 6 }, "end": { "line": 6, "column": 51 } }, "id": { "type": "ObjectPattern", "start": 169, "end": 198, "loc": { "start": { "line": 6, "column": 6 }, "end": { "line": 6, "column": 35 } }, "properties": [ { "type": "ObjectProperty", "start": 170, "end": 182, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 19 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 170, "end": 182, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 19 }, "identifierName": "readFileSync" }, "name": "readFileSync" }, "value": { "type": "Identifier", "start": 170, "end": 182, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 19 }, "identifierName": "readFileSync" }, "name": "readFileSync" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 184, "end": 197, "loc": { "start": { "line": 6, "column": 21 }, "end": { "line": 6, "column": 34 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 184, "end": 197, "loc": { "start": { "line": 6, "column": 21 }, "end": { "line": 6, "column": 34 }, "identifierName": "writeFileSync" }, "name": "writeFileSync" }, "value": { "type": "Identifier", "start": 184, "end": 197, "loc": { "start": { "line": 6, "column": 21 }, "end": { "line": 6, "column": 34 }, "identifierName": "writeFileSync" }, "name": "writeFileSync" }, "extra": { "shorthand": true } } ] }, "init": { "type": "CallExpression", "start": 201, "end": 214, "loc": { "start": { "line": 6, "column": 38 }, "end": { "line": 6, "column": 51 } }, "callee": { "type": "Identifier", "start": 201, "end": 208, "loc": { "start": { "line": 6, "column": 38 }, "end": { "line": 6, "column": 45 }, "identifierName": "require" }, "name": "require" }, "arguments": [ { "type": "StringLiteral", "start": 209, "end": 213, "loc": { "start": { "line": 6, "column": 46 }, "end": { "line": 6, "column": 50 } }, "extra": { "rawValue": "fs", "raw": "'fs'" }, "value": "fs" } ] } } ], "kind": "const", "trailingComments": [ { "type": "CommentLine", "value": " const {merge} = require('lodash');", "start": 216, "end": 253, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 37 } } } ] }, { "type": "VariableDeclaration", "start": 254, "end": 294, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 40 } }, "declarations": [ { "type": "VariableDeclarator", "start": 260, "end": 293, "loc": { "start": { "line": 8, "column": 6 }, "end": { "line": 8, "column": 39 } }, "id": { "type": "Identifier", "start": 260, "end": 266, "loc": { "start": { "line": 8, "column": 6 }, "end": { "line": 8, "column": 12 }, "identifierName": "logger" }, "name": "logger", "leadingComments": null }, "init": { "type": "CallExpression", "start": 269, "end": 293, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 8, "column": 39 } }, "callee": { "type": "Identifier", "start": 269, "end": 276, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 8, "column": 22 }, "identifierName": "require" }, "name": "require" }, "arguments": [ { "type": "StringLiteral", "start": 277, "end": 292, "loc": { "start": { "line": 8, "column": 23 }, "end": { "line": 8, "column": 38 } }, "extra": { "rawValue": "backed-logger", "raw": "'backed-logger'" }, "value": "backed-logger" } ] }, "leadingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentLine", "value": " const {merge} = require('lodash');", "start": 216, "end": 253, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 37 } } } ] }, { "type": "VariableDeclaration", "start": 295, "end": 360, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 11, "column": 2 } }, "declarations": [ { "type": "VariableDeclarator", "start": 301, "end": 359, "loc": { "start": { "line": 9, "column": 6 }, "end": { "line": 11, "column": 1 } }, "id": { "type": "Identifier", "start": 301, "end": 305, "loc": { "start": { "line": 9, "column": 6 }, "end": { "line": 9, "column": 10 }, "identifierName": "time" }, "name": "time" }, "init": { "type": "ArrowFunctionExpression", "start": 308, "end": 359, "loc": { "start": { "line": 9, "column": 13 }, "end": { "line": 11, "column": 1 } }, "id": { "type": "Identifier", "start": 301, "end": 305, "loc": { "start": { "line": 9, "column": 6 }, "end": { "line": 9, "column": 10 }, "identifierName": "time" }, "name": "time" }, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 314, "end": 359, "loc": { "start": { "line": 9, "column": 19 }, "end": { "line": 11, "column": 1 } }, "body": [ { "type": "ReturnStatement", "start": 318, "end": 357, "loc": { "start": { "line": 10, "column": 2 }, "end": { "line": 10, "column": 41 } }, "argument": { "type": "CallExpression", "start": 325, "end": 356, "loc": { "start": { "line": 10, "column": 9 }, "end": { "line": 10, "column": 40 } }, "callee": { "type": "MemberExpression", "start": 325, "end": 354, "loc": { "start": { "line": 10, "column": 9 }, "end": { "line": 10, "column": 38 } }, "object": { "type": "NewExpression", "start": 325, "end": 335, "loc": { "start": { "line": 10, "column": 9 }, "end": { "line": 10, "column": 19 } }, "callee": { "type": "Identifier", "start": 329, "end": 333, "loc": { "start": { "line": 10, "column": 13 }, "end": { "line": 10, "column": 17 }, "identifierName": "Date" }, "name": "Date" }, "arguments": [] }, "property": { "type": "Identifier", "start": 336, "end": 354, "loc": { "start": { "line": 10, "column": 20 }, "end": { "line": 10, "column": 38 }, "identifierName": "toLocaleTimeString" }, "name": "toLocaleTimeString" }, "computed": false }, "arguments": [] } } ], "directives": [] } } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 361, "end": 372, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 11 } }, "declarations": [ { "type": "VariableDeclarator", "start": 365, "end": 371, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 10 } }, "id": { "type": "Identifier", "start": 365, "end": 371, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 10 }, "identifierName": "worker" }, "name": "worker" }, "init": null } ], "kind": "let", "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @extends EventEmitter\n ", "start": 374, "end": 406, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 16, "column": 3 } } } ] }, { "type": "Identifier", "start": 407, "end": 2603, "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 91, "column": 1 } }, "id": { "type": "Identifier", "start": 413, "end": 420, "loc": { "start": { "line": 17, "column": 6 }, "end": { "line": 17, "column": 13 }, "identifierName": "Watcher" }, "name": "Watcher", "leadingComments": null }, "superClass": { "type": "Identifier", "start": 429, "end": 441, "loc": { "start": { "line": 17, "column": 22 }, "end": { "line": 17, "column": 34 }, "identifierName": "EventEmitter" }, "name": "EventEmitter" }, "body": { "type": "ClassBody", "start": 442, "end": 2603, "loc": { "start": { "line": 17, "column": 35 }, "end": { "line": 91, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 502, "end": 1292, "loc": { "start": { "line": 22, "column": 2 }, "end": { "line": 46, "column": 3 } }, "computed": false, "key": { "type": "Identifier", "start": 502, "end": 507, "loc": { "start": { "line": 22, "column": 2 }, "end": { "line": 22, "column": 7 }, "identifierName": "watch" }, "name": "watch", "leadingComments": null }, "static": false, "kind": "method", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 508, "end": 514, "loc": { "start": { "line": 22, "column": 8 }, "end": { "line": 22, "column": 14 }, "identifierName": "config" }, "name": "config" } ], "body": { "type": "BlockStatement", "start": 516, "end": 1292, "loc": { "start": { "line": 22, "column": 16 }, "end": { "line": 46, "column": 3 } }, "body": [ { "type": "ReturnStatement", "start": 522, "end": 1288, "loc": { "start": { "line": 23, "column": 4 }, "end": { "line": 45, "column": 7 } }, "argument": { "type": "NewExpression", "start": 529, "end": 1287, "loc": { "start": { "line": 23, "column": 11 }, "end": { "line": 45, "column": 6 } }, "callee": { "type": "Identifier", "start": 533, "end": 540, "loc": { "start": { "line": 23, "column": 15 }, "end": { "line": 23, "column": 22 }, "identifierName": "Promise" }, "name": "Promise" }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 541, "end": 1286, "loc": { "start": { "line": 23, "column": 23 }, "end": { "line": 45, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 542, "end": 549, "loc": { "start": { "line": 23, "column": 24 }, "end": { "line": 23, "column": 31 }, "identifierName": "resolve" }, "name": "resolve" }, { "type": "Identifier", "start": 551, "end": 557, "loc": { "start": { "line": 23, "column": 33 }, "end": { "line": 23, "column": 39 }, "identifierName": "reject" }, "name": "reject" } ], "body": { "type": "BlockStatement", "start": 562, "end": 1286, "loc": { "start": { "line": 23, "column": 44 }, "end": { "line": 45, "column": 5 } }, "body": [ { "type": "IfStatement", "start": 570, "end": 727, "loc": { "start": { "line": 24, "column": 6 }, "end": { "line": 28, "column": 7 } }, "test": { "type": "UnaryExpression", "start": 574, "end": 587, "loc": { "start": { "line": 24, "column": 10 }, "end": { "line": 24, "column": 23 } }, "operator": "!", "prefix": true, "argument": { "type": "MemberExpression", "start": 575, "end": 587, "loc": { "start": { "line": 24, "column": 11 }, "end": { "line": 24, "column": 23 } }, "object": { "type": "Identifier", "start": 575, "end": 581, "loc": { "start": { "line": 24, "column": 11 }, "end": { "line": 24, "column": 17 }, "identifierName": "config" }, "name": "config" }, "property": { "type": "Identifier", "start": 582, "end": 587, "loc": { "start": { "line": 24, "column": 18 }, "end": { "line": 24, "column": 23 }, "identifierName": "watch" }, "name": "watch" }, "computed": false }, "extra": { "parenthesizedArgument": false } }, "consequent": { "type": "BlockStatement", "start": 589, "end": 727, "loc": { "start": { "line": 24, "column": 25 }, "end": { "line": 28, "column": 7 } }, "body": [ { "type": "ExpressionStatement", "start": 599, "end": 631, "loc": { "start": { "line": 25, "column": 8 }, "end": { "line": 25, "column": 40 } }, "expression": { "type": "CallExpression", "start": 599, "end": 630, "loc": { "start": { "line": 25, "column": 8 }, "end": { "line": 25, "column": 39 } }, "callee": { "type": "MemberExpression", "start": 599, "end": 610, "loc": { "start": { "line": 25, "column": 8 }, "end": { "line": 25, "column": 19 } }, "object": { "type": "Identifier", "start": 599, "end": 605, "loc": { "start": { "line": 25, "column": 8 }, "end": { "line": 25, "column": 14 }, "identifierName": "logger" }, "name": "logger" }, "property": { "type": "Identifier", "start": 606, "end": 610, "loc": { "start": { "line": 25, "column": 15 }, "end": { "line": 25, "column": 19 }, "identifierName": "warn" }, "name": "warn" }, "computed": false }, "arguments": [ { "type": "StringLiteral", "start": 611, "end": 629, "loc": { "start": { "line": 25, "column": 20 }, "end": { "line": 25, "column": 38 } }, "extra": { "rawValue": "nothing to watch", "raw": "'nothing to watch'" }, "value": "nothing to watch" } ] } }, { "type": "ExpressionStatement", "start": 640, "end": 667, "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 35 } }, "expression": { "type": "CallExpression", "start": 640, "end": 666, "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 34 } }, "callee": { "type": "Identifier",