UNPKG

roc

Version:

Build modern web applications easily

1,400 lines 175 kB
{ "type": "Program", "start": 0, "end": 2286, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 78, "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": 69, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 30 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 46, "end": 53, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 14 } }, "local": { "type": "Identifier", "start": 46, "end": 53, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 14 } }, "name": "request" } } ], "importKind": "value", "source": { "type": "Literal", "start": 59, "end": 68, "loc": { "start": { "line": 3, "column": 20 }, "end": { "line": 3, "column": 29 } }, "value": "request", "rawValue": "request", "raw": "'request'" } }, { "type": "ImportDeclaration", "start": 70, "end": 92, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 22 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 77, "end": 80, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 10 } }, "local": { "type": "Identifier", "start": 77, "end": 80, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 10 } }, "name": "tar" } } ], "importKind": "value", "source": { "type": "Literal", "start": 86, "end": 91, "loc": { "start": { "line": 4, "column": 16 }, "end": { "line": 4, "column": 21 } }, "value": "tar", "rawValue": "tar", "raw": "'tar'" } }, { "type": "ImportDeclaration", "start": 93, "end": 117, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 24 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 100, "end": 104, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 11 } }, "local": { "type": "Identifier", "start": 100, "end": 104, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 11 } }, "name": "zlib" } } ], "importKind": "value", "source": { "type": "Literal", "start": 110, "end": 116, "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 23 } }, "value": "zlib", "rawValue": "zlib", "raw": "'zlib'" } }, { "type": "ImportDeclaration", "start": 118, "end": 142, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 24 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 125, "end": 129, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 11 } }, "local": { "type": "Identifier", "start": 125, "end": 129, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 11 } }, "name": "temp" } } ], "importKind": "value", "source": { "type": "Literal", "start": 135, "end": 141, "loc": { "start": { "line": 6, "column": 17 }, "end": { "line": 6, "column": 23 } }, "value": "temp", "rawValue": "temp", "raw": "'temp'" }, "trailingComments": [ { "type": "CommentLine", "value": " Automatically track and cleanup files at exit", "start": 144, "end": 192, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 48 } }, "range": [ 144, 192 ] } ] }, { "type": "ExpressionStatement", "start": 193, "end": 206, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 13 } }, "expression": { "type": "CallExpression", "start": 193, "end": 205, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 12 } }, "callee": { "type": "MemberExpression", "start": 193, "end": 203, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 10 } }, "object": { "type": "Identifier", "start": 193, "end": 197, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 4 } }, "name": "temp", "leadingComments": null }, "property": { "type": "Identifier", "start": 198, "end": 203, "loc": { "start": { "line": 9, "column": 5 }, "end": { "line": 9, "column": 10 } }, "name": "track" }, "computed": false, "leadingComments": null }, "arguments": [], "leadingComments": null }, "leadingComments": [ { "type": "CommentLine", "value": " Automatically track and cleanup files at exit", "start": 144, "end": 192, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 48 } }, "range": [ 144, 192 ] } ], "trailingComments": [ { "type": "Block", "value": "*\n * Fetches an array of all the tags for a Github repo, used as possible versions for a template.\n *\n * @param {string} packageName - A package name, expected to match \"username/repo\"\n *\n * @returns {object[]} - Array of tags/versions for the package\n ", "start": 208, "end": 465, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 17, "column": 3 } }, "range": [ 208, 465 ] } ] }, { "type": "ExportNamedDeclaration", "start": 466, "end": 1159, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 41, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 473, "end": 1159, "loc": { "start": { "line": 18, "column": 7 }, "end": { "line": 41, "column": 1 } }, "id": { "type": "Identifier", "start": 482, "end": 493, "loc": { "start": { "line": 18, "column": 16 }, "end": { "line": 18, "column": 27 } }, "name": "getVersions", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 494, "end": 505, "loc": { "start": { "line": 18, "column": 28 }, "end": { "line": 18, "column": 39 } }, "name": "packageName" } ], "body": { "type": "BlockStatement", "start": 507, "end": 1159, "loc": { "start": { "line": 18, "column": 41 }, "end": { "line": 41, "column": 1 } }, "body": [ { "type": "IfStatement", "start": 513, "end": 592, "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 21, "column": 5 } }, "test": { "type": "UnaryExpression", "start": 517, "end": 529, "loc": { "start": { "line": 19, "column": 8 }, "end": { "line": 19, "column": 20 } }, "operator": "!", "prefix": true, "argument": { "type": "Identifier", "start": 518, "end": 529, "loc": { "start": { "line": 19, "column": 9 }, "end": { "line": 19, "column": 20 } }, "name": "packageName" } }, "consequent": { "type": "BlockStatement", "start": 531, "end": 592, "loc": { "start": { "line": 19, "column": 22 }, "end": { "line": 21, "column": 5 } }, "body": [ { "type": "ThrowStatement", "start": 541, "end": 586, "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 53 } }, "argument": { "type": "NewExpression", "start": 547, "end": 585, "loc": { "start": { "line": 20, "column": 14 }, "end": { "line": 20, "column": 52 } }, "callee": { "type": "Identifier", "start": 551, "end": 556, "loc": { "start": { "line": 20, "column": 18 }, "end": { "line": 20, "column": 23 } }, "name": "Error" }, "arguments": [ { "type": "Literal", "start": 557, "end": 584, "loc": { "start": { "line": 20, "column": 24 }, "end": { "line": 20, "column": 51 } }, "value": "No packageName was given.", "rawValue": "No packageName was given.", "raw": "'No packageName was given.'" } ] } } ] }, "alternate": null }, { "type": "ReturnStatement", "start": 598, "end": 1157, "loc": { "start": { "line": 23, "column": 4 }, "end": { "line": 40, "column": 7 } }, "argument": { "type": "NewExpression", "start": 605, "end": 1156, "loc": { "start": { "line": 23, "column": 11 }, "end": { "line": 40, "column": 6 } }, "callee": { "type": "Identifier", "start": 609, "end": 616, "loc": { "start": { "line": 23, "column": 15 }, "end": { "line": 23, "column": 22 } }, "name": "Promise" }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 617, "end": 1155, "loc": { "start": { "line": 23, "column": 23 }, "end": { "line": 40, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 618, "end": 625, "loc": { "start": { "line": 23, "column": 24 }, "end": { "line": 23, "column": 31 } }, "name": "resolve" }, { "type": "Identifier", "start": 627, "end": 633, "loc": { "start": { "line": 23, "column": 33 }, "end": { "line": 23, "column": 39 } }, "name": "reject" } ], "body": { "type": "BlockStatement", "start": 638, "end": 1155, "loc": { "start": { "line": 23, "column": 44 }, "end": { "line": 40, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 648, "end": 1149, "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 39, "column": 11 } }, "expression": { "type": "CallExpression", "start": 648, "end": 1148, "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 39, "column": 10 } }, "callee": { "type": "MemberExpression", "start": 648, "end": 659, "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 19 } }, "object": { "type": "Identifier", "start": 648, "end": 655, "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 15 } }, "name": "request" }, "property": { "type": "Identifier", "start": 656, "end": 659, "loc": { "start": { "line": 24, "column": 16 }, "end": { "line": 24, "column": 19 } }, "name": "get" }, "computed": false }, "arguments": [ { "type": "ObjectExpression", "start": 660, "end": 817, "loc": { "start": { "line": 24, "column": 20 }, "end": { "line": 29, "column": 9 } }, "properties": [ { "type": "Property", "start": 674, "end": 729, "loc": { "start": { "line": 25, "column": 12 }, "end": { "line": 25, "column": 67 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 674, "end": 677, "loc": { "start": { "line": 25, "column": 12 }, "end": { "line": 25, "column": 15 } }, "name": "url" }, "value": { "type": "TemplateLiteral", "start": 679, "end": 729, "loc": { "start": { "line": 25, "column": 17 }, "end": { "line": 25, "column": 67 } }, "expressions": [ { "type": "Identifier", "start": 711, "end": 722, "loc": { "start": { "line": 25, "column": 49 }, "end": { "line": 25, "column": 60 } }, "name": "packageName" } ], "quasis": [ { "type": "TemplateElement", "start": 680, "end": 709, "loc": { "start": { "line": 25, "column": 18 }, "end": { "line": 25, "column": 47 } }, "value": { "raw": "https://api.github.com/repos/", "cooked": "https://api.github.com/repos/" }, "tail": false }, { "type": "TemplateElement", "start": 723, "end": 728, "loc": { "start": { "line": 25, "column": 61 }, "end": { "line": 25, "column": 66 } }, "value": { "raw": "/tags", "cooked": "/tags" }, "tail": true } ] }, "kind": "init" }, { "type": "Property", "start": 743, "end": 807, "loc": { "start": { "line": 26, "column": 12 }, "end": { "line": 28, "column": 13 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 743, "end": 750, "loc": { "start": { "line": 26, "column": 12 }, "end": { "line": 26, "column": 19 } }, "name": "headers" }, "value": { "type": "ObjectExpression", "start": 752, "end": 807, "loc": { "start": { "line": 26, "column": 21 }, "end": { "line": 28, "column": 13 } }, "properties": [ { "type": "Property", "start": 770, "end": 793, "loc": { "start": { "line": 27, "column": 16 }, "end": { "line": 27, "column": 39 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Literal", "start": 770, "end": 782, "loc": { "start": { "line": 27, "column": 16 }, "end": { "line": 27, "column": 28 } }, "value": "User-Agent", "rawValue": "User-Agent", "raw": "'User-Agent'" }, "value": { "type": "Literal", "start": 784, "end": 793, "loc": { "start": { "line": 27, "column": 30 }, "end": { "line": 27, "column": 39 } }, "value": "request", "rawValue": "request", "raw": "'request'" }, "kind": "init" } ] }, "kind": "init" } ] }, { "type": "ArrowFunctionExpression", "start": 819, "end": 1147, "loc": { "start": { "line": 29, "column": 11 }, "end": { "line": 39, "column": 9 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 820, "end": 825, "loc": { "start": { "line": 29, "column": 12 }, "end": { "line": 29, "column": 17 } }, "name": "error" }, { "type": "Identifier", "start": 827, "end": 831, "loc": { "start": { "line": 29, "column": 19 }, "end": { "line": 29, "column": 23 } }, "name": "resp" }, { "type": "Identifier", "start": 833, "end": 837, "loc": { "start": { "line": 29, "column": 25 }, "end": { "line": 29, "column": 29 } }, "name": "body" } ], "body": { "type": "BlockStatement", "start": 842, "end": 1147, "loc": { "start": { "line": 29, "column": 34 }, "end": { "line": 39, "column": 9 } }, "body": [ { "type": "IfStatement", "start": 856, "end": 920, "loc": { "start": { "line": 30, "column": 12 }, "end": { "line": 32, "column": 13 } }, "test": { "type": "Identifier", "start": 860, "end": 865, "loc": { "start": { "line": 30, "column": 16 }, "end": { "line": 30, "column": 21 } }, "name": "error" }, "consequent": { "type": "BlockStatement", "start": 867, "end": 920, "loc": { "start": { "line": 30, "column": 23 }, "end": { "line": 32, "column": 13 } }, "body": [ { "type": "ReturnStatement", "start": 885, "end": 906, "loc": { "start": { "line": 31, "column": 16 }, "end": { "line": 31, "column": 37 } }, "argument": { "type": "CallExpression", "start": 892, "end": 905, "loc": { "start": { "line": 31, "column": 23 }, "end": { "line": 31, "column": 36 } }, "callee": { "type": "Identifier", "start": 892, "end": 898, "loc": { "start": { "line": 31, "column": 23 }, "end": { "line": 31, "column": 29 } }, "name": "reject" }, "arguments": [ { "type": "Identifier", "start": 899, "end": 904, "loc": { "start": { "line": 31, "column": 30 }, "end": { "line": 31, "column": 35 } }, "name": "error" } ] } } ] }, "alternate": null }, { "type": "IfStatement", "start": 934, "end": 1090, "loc": { "start": { "line": 34, "column": 12 }, "end": { "line": 36, "column": 13 } }, "test": { "type": "BinaryExpression", "start": 938, "end": 961, "loc": { "start": { "line": 34, "column": 16 }, "end": { "line": 34, "column": 39 } }, "left": { "type": "MemberExpression", "start": 938, "end": 953, "loc": { "start": { "line": 34, "column": 16 }, "end": { "line": 34, "column": 31 } }, "object": { "type": "Identifier", "start": 938, "end": 942, "loc": { "start": { "line": 34, "column": 16 }, "end": { "line": 34, "column": 20 } }, "name": "resp" }, "property": { "type": "Identifier", "start": 943, "end": 953, "loc": { "start": { "line": 34, "column": 21 }, "end": { "line": 34, "column": 31 } }, "name": "statusCode" }, "computed": false }, "operator": "!==", "right": { "type": "Literal", "start": 958, "end": 961, "loc": { "start": { "line": 34, "column": 36 }, "end": { "line": 34, "column": 39 } }, "value": 200, "rawValue": 200, "raw": "200" } }, "consequent": { "type": "BlockStatement", "start": 963, "end": 1090, "loc": { "start":