UNPKG

roc

Version:

Build modern web applications easily

1,577 lines (1,576 loc) 125 kB
{ "type": "Program", "start": 0, "end": 2884, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 76, "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": 59, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 20 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 46, "end": 48, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 9 } }, "local": { "type": "Identifier", "start": 46, "end": 48, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 9 } }, "name": "fs" } } ], "importKind": "value", "source": { "type": "Literal", "start": 54, "end": 58, "loc": { "start": { "line": 3, "column": 15 }, "end": { "line": 3, "column": 19 } }, "value": "fs", "rawValue": "fs", "raw": "'fs'" } }, { "type": "ImportDeclaration", "start": 60, "end": 86, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 67, "end": 72, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 12 } }, "local": { "type": "Identifier", "start": 67, "end": 72, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 12 } }, "name": "chalk" } } ], "importKind": "value", "source": { "type": "Literal", "start": 78, "end": 85, "loc": { "start": { "line": 4, "column": 18 }, "end": { "line": 4, "column": 25 } }, "value": "chalk", "rawValue": "chalk", "raw": "'chalk'" } }, { "type": "ImportDeclaration", "start": 88, "end": 133, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 45 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 97, "end": 112, "loc": { "start": { "line": 6, "column": 9 }, "end": { "line": 6, "column": 24 } }, "imported": { "type": "Identifier", "start": 97, "end": 112, "loc": { "start": { "line": 6, "column": 9 }, "end": { "line": 6, "column": 24 } }, "name": "getAbsolutePath" }, "local": { "type": "Identifier", "start": 97, "end": 112, "loc": { "start": { "line": 6, "column": 9 }, "end": { "line": 6, "column": 24 } }, "name": "getAbsolutePath" } } ], "importKind": "value", "source": { "type": "Literal", "start": 120, "end": 132, "loc": { "start": { "line": 6, "column": 32 }, "end": { "line": 6, "column": 44 } }, "value": "../helpers", "rawValue": "../helpers", "raw": "'../helpers'" } }, { "type": "ImportDeclaration", "start": 134, "end": 198, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 64 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 143, "end": 162, "loc": { "start": { "line": 7, "column": 9 }, "end": { "line": 7, "column": 28 } }, "imported": { "type": "Identifier", "start": 143, "end": 148, "loc": { "start": { "line": 7, "column": 9 }, "end": { "line": 7, "column": 14 } }, "name": "error" }, "local": { "type": "Identifier", "start": 152, "end": 162, "loc": { "start": { "line": 7, "column": 18 }, "end": { "line": 7, "column": 28 } }, "name": "styleError" } }, { "type": "ImportSpecifier", "start": 164, "end": 171, "loc": { "start": { "line": 7, "column": 30 }, "end": { "line": 7, "column": 37 } }, "imported": { "type": "Identifier", "start": 164, "end": 171, "loc": { "start": { "line": 7, "column": 30 }, "end": { "line": 7, "column": 37 } }, "name": "warning" }, "local": { "type": "Identifier", "start": 164, "end": 171, "loc": { "start": { "line": 7, "column": 30 }, "end": { "line": 7, "column": 37 } }, "name": "warning" } } ], "importKind": "value", "source": { "type": "Literal", "start": 179, "end": 197, "loc": { "start": { "line": 7, "column": 45 }, "end": { "line": 7, "column": 63 } }, "value": "../helpers/style", "rawValue": "../helpers/style", "raw": "'../helpers/style'" }, "trailingComments": [ { "type": "Block", "value": " Make sure that we only print some feedback once ", "start": 200, "end": 253, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 53 } }, "range": [ 200, 253 ] } ] }, { "type": "VariableDeclaration", "start": 254, "end": 273, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 19 } }, "declarations": [ { "type": "VariableDeclarator", "start": 258, "end": 272, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 18 } }, "id": { "type": "Identifier", "start": 258, "end": 265, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 11 } }, "name": "onceApp", "leadingComments": null }, "init": { "type": "Literal", "start": 268, "end": 272, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 18 } }, "value": true, "rawValue": true, "raw": "true" }, "leadingComments": null } ], "kind": "let", "leadingComments": [ { "type": "Block", "value": " Make sure that we only print some feedback once ", "start": 200, "end": 253, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 53 } }, "range": [ 200, 253 ] } ], "trailingComments": [ { "type": "Block", "value": "*\n * Gets the application configuration by reading a file.\n *\n * Will give a warning if ROC_CONFIG_PATH has been set since that will then be used as the path to get the configuration\n * file, even if one is provided to the function.\n *\n * Reads configuration files in this manner:\n * 1. Environment variable ROC_CONFIG_PATH.\n * 2. Path given as applicationConfigPath.\n * 3. Default by trying to read \"roc.config.js\" in the current working directory.\n * 4. Return a empty object along with a warning.\n *\n * @param {string} applicationConfigPath - Path to application configuration file. Can be either relative or absolute.\n * @param {string} [directory=process.cwd()] - The directory to resolve realative paths to. By default will use the\n * current working directory.\n * @param {boolean} [debug=false] - If extra information should be printed.\n *\n * @returns {object} - The application configuration object.\n * @throws {Error} - When an invalid path override is specified.\n ", "start": 275, "end": 1257, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 31, "column": 3 } }, "range": [ 275, 1257 ] } ] }, { "type": "ExportNamedDeclaration", "start": 1258, "end": 2749, "loc": { "start": { "line": 32, "column": 0 }, "end": { "line": 71, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 1265, "end": 2749, "loc": { "start": { "line": 32, "column": 7 }, "end": { "line": 71, "column": 1 } }, "id": { "type": "Identifier", "start": 1274, "end": 1294, "loc": { "start": { "line": 32, "column": 16 }, "end": { "line": 32, "column": 36 } }, "name": "getApplicationConfig", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 1295, "end": 1316, "loc": { "start": { "line": 32, "column": 37 }, "end": { "line": 32, "column": 58 } }, "name": "applicationConfigPath" }, { "type": "AssignmentPattern", "start": 1318, "end": 1343, "loc": { "start": { "line": 32, "column": 60 }, "end": { "line": 32, "column": 85 } }, "operator": "=", "left": { "type": "Identifier", "start": 1318, "end": 1327, "loc": { "start": { "line": 32, "column": 60 }, "end": { "line": 32, "column": 69 } }, "name": "directory" }, "right": { "type": "CallExpression", "start": 1330, "end": 1343, "loc": { "start": { "line": 32, "column": 72 }, "end": { "line": 32, "column": 85 } }, "callee": { "type": "MemberExpression", "start": 1330, "end": 1341, "loc": { "start": { "line": 32, "column": 72 }, "end": { "line": 32, "column": 83 } }, "object": { "type": "Identifier", "start": 1330, "end": 1337, "loc": { "start": { "line": 32, "column": 72 }, "end": { "line": 32, "column": 79 } }, "name": "process" }, "property": { "type": "Identifier", "start": 1338, "end": 1341, "loc": { "start": { "line": 32, "column": 80 }, "end": { "line": 32, "column": 83 } }, "name": "cwd" }, "computed": false }, "arguments": [] } }, { "type": "AssignmentPattern", "start": 1345, "end": 1358, "loc": { "start": { "line": 32, "column": 87 }, "end": { "line": 32, "column": 100 } }, "operator": "=", "left": { "type": "Identifier", "start": 1345, "end": 1350, "loc": { "start": { "line": 32, "column": 87 }, "end": { "line": 32, "column": 92 } }, "name": "debug" }, "right": { "type": "Literal", "start": 1353, "end": 1358, "loc": { "start": { "line": 32, "column": 95 }, "end": { "line": 32, "column": 100 } }, "value": false, "rawValue": false, "raw": "false" } } ], "body": { "type": "BlockStatement", "start": 1360, "end": 2749, "loc": { "start": { "line": 32, "column": 102 }, "end": { "line": 71, "column": 1 } }, "body": [ { "type": "VariableDeclaration", "start": 1366, "end": 1466, "loc": { "start": { "line": 33, "column": 4 }, "end": { "line": 33, "column": 104 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1372, "end": 1465, "loc": { "start": { "line": 33, "column": 10 }, "end": { "line": 33, "column": 103 } }, "id": { "type": "Identifier", "start": 1372, "end": 1382, "loc": { "start": { "line": 33, "column": 10 }, "end": { "line": 33, "column": 20 } }, "name": "configPath" }, "init": { "type": "CallExpression", "start": 1385, "end": 1465, "loc": { "start": { "line": 33, "column": 23 }, "end": { "line": 33, "column": 103 } }, "callee": { "type": "Identifier", "start": 1385, "end": 1400, "loc": { "start": { "line": 33, "column": 23 }, "end": { "line": 33, "column": 38 } }, "name": "getAbsolutePath" }, "arguments": [ { "type": "LogicalExpression", "start": 1401, "end": 1453, "loc": { "start": { "line": 33, "column": 39 }, "end": { "line": 33, "column": 91 } }, "left": { "type": "MemberExpression", "start": 1401, "end": 1428, "loc": { "start": { "line": 33, "column": 39 }, "end": { "line": 33, "column": 66 } }, "object": { "type": "MemberExpression", "start": 1401, "end": 1412, "loc": { "start": { "line": 33, "column": 39 }, "end": { "line": 33, "column": 50 } }, "object": { "type": "Identifier", "start": 1401, "end": 1408, "loc": { "start": { "line": 33, "column": 39 }, "end": { "line": 33, "column": 46 } }, "name": "process" }, "property": { "type": "Identifier", "start": 1409, "end": 1412, "loc": { "start": { "line": 33, "column": 47 }, "end": { "line": 33, "column": 50 } }, "name": "env" }, "computed": false }, "property": { "type": "Identifier", "start": 1413, "end": 1428, "loc": { "start": { "line": 33, "column": 51 }, "end": { "line": 33, "column": 66 } }, "name": "ROC_CONFIG_PATH" }, "computed": false }, "operator": "||", "right": { "type": "Identifier", "start": 1432, "end": 1453, "loc": { "start": { "line": 33, "column": 70 }, "end": { "line": 33, "column": 91 } }, "name": "applicationConfigPath" } }, { "type": "Identifier", "start": 1455, "end": 1464, "loc": { "start": { "line": 33, "column": 93 }, "end": { "line": 33, "column": 102 } }, "name": "directory" } ] } } ], "kind": "const" }, { "type": "IfStatement", "start": 1472, "end": 1890, "loc": { "start": { "line": 35, "column": 4 }, "end": { "line": 42, "column": 5 } }, "test": { "type": "LogicalExpression", "start": 1476, "end": 1539, "loc": { "start": { "line": 35, "column": 8 }, "end": { "line": 35, "column": 71 } }, "left": { "type": "LogicalExpression", "start": 1476, "end": 1508, "loc": { "start": { "line": 35, "column": 8 }, "end": { "line": 35, "column": 40 } }, "left": { "type": "Identifier", "start": 1476, "end": 1483, "loc": { "start": { "line": 35, "column": 8 }, "end": { "line": 35, "column": 15 } }, "name": "onceApp" }, "operator": "&&", "right": { "type": "Identifier", "start": 1487, "end": 1508, "loc": { "start": { "line": 35, "column": 19 }, "end": { "line": 35, "column": 40 } }, "name": "applicationConfigPath" } }, "operator": "&&", "right": { "type": "MemberExpression", "start": 1512, "end": 1539, "loc": { "start": { "line": 35, "column": 44 }, "end": { "line": 35, "column": 71 } }, "object": { "type": "MemberExpression", "start": 1512, "end": 1523, "loc": { "start": { "line": 35, "column": 44 }, "end": { "line": 35, "column": 55 } }, "object": { "type": "Identifier", "start": 1512, "end": 1519, "loc": { "start": { "line": 35, "column": 44 }, "end": { "line": 35, "column": 51 } }, "name": "process" }, "property": { "type": "Identifier", "start": 1520, "end": 1523, "loc": { "start": { "line": 35, "column": 52 }, "end": { "line": 35, "column": 55 } }, "name": "env" }, "computed": false }, "property": { "type": "Identifier", "start": 1524, "end": 1539, "loc": { "start": { "line": 35, "column": 56 }, "end": { "line": 35, "column": 71 } }, "name": "ROC_CONFIG_PATH" }, "computed": false } }, "consequent": { "type": "BlockStatement", "start": 1541, "end": 1890, "loc": { "start": { "line": 35, "column": 73 }, "end": { "line": 42, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 1551, "end": 1567, "loc": { "start": { "line": 36, "column": 8 }, "end": { "line": 36, "column": 24 } }, "expression": { "type": "AssignmentExpression", "start": 1551, "end": 1566, "loc": { "start": { "line": 36, "column": 8 }, "end": { "line": 36, "column": 23 } }, "operator": "=", "left": { "type": "Identifier", "start": 1551, "end": 1558, "loc": { "start": { "line": 36, "column": 8 }, "end": { "line": 36, "column": 15 } }, "name": "onceApp" }, "right": { "type": "Literal", "start": 1561, "end": 1566, "loc": { "start": { "line": 36, "column": 18 }, "end": { "line": 36, "column": 23 } }, "value": false, "rawValue": false, "raw": "false" } } }, { "type": "ExpressionStatement", "start": 1576, "end": 1884, "loc": { "start": { "line": 37, "column": 8 }, "end": { "line": 41, "column": 16 } }, "expression": { "type": "CallExpression", "start": 1576, "end": 1883, "loc": { "start": { "line": 37, "column": 8 }, "end": { "line": 41, "column": 15 } }, "callee": { "type": "MemberExpression", "start": 1576, "end": 1587, "loc": { "start": { "line": 37, "column": 8 }, "end": { "line": 37, "column": 19 } }, "object": { "type": "Identifier", "start": 1576, "end": 1583, "loc": { "start": { "line": 37, "column": 8 }, "end": { "line": 37, "column": 15 } }, "name": "console" }, "property": { "type": "Identifier", "start": 1584, "end": 1587, "loc": { "start": { "line": 37, "column": 16 }, "end": { "line": 37, "column": 19 } }, "name": "log" }, "computed": false }, "arguments": [ { "type": "CallExpression", "start": 1601, "end": 1867, "loc": { "start": { "line": 38, "column": 12 }, "end": { "line": 40, "column": 54 } }, "callee": { "type": "Identifier", "start": 1601, "end": 1611, "loc": { "start": { "line": 38, "column": 12 }, "end": { "line": 38, "column": 22 } }, "name": "styleError" }, "arguments": [ { "type": "BinaryExpression", "start": 1612, "end": 1866, "loc": { "start": { "line": 38, "column": 23 }, "end": { "line": 40, "column": 53 } }, "left": { "type": "BinaryExpression", "start": 1612, "end": 1853, "loc": { "start": { "line": 38, "column": 23 }, "end": { "line": 40, "column": 40 } }, "left": { "type": "BinaryExpression", "start": 1612, "end": 1810, "loc": { "start": { "line": 38, "column": 23 }, "end": { "line": 39, "column": 115 } }, "left": { "type": "BinaryExpression", "start": 1612, "end": 1762, "loc": { "start": { "line": 38, "column": 23 }, "end": { "line": 39, "column": 67 } }, "left": { "type": "BinaryExpression", "start": 1612, "end": 1730, "loc": { "start": { "line": 38, "column": 23 }, "end": { "line": 39, "column": 35 } }, "left": { "type": "Literal", "start": 1612, "end": 1692, "loc": { "start": { "line": 38, "column": 23 }, "end": { "line": 38, "column": 103 } }, "value": "You have configured a location for the application configuration file but the ", "rawValue": "You have configured a location for the application configuration file but the ", "raw": "'You have configured a location for the application configuration file but the '" }, "operator": "+", "right": { "type": "Literal", "start": 1707, "end": 1730, "loc": { "start": { "line": 39, "column": 12 }, "end": { "line": 39, "column": 35 } }, "value": "environment variable ", "rawValue": "environment variable ", "raw": "'environment variable '" } }, "operator": "+", "right": { "type": "CallExpression", "start": 1733, "end": 1762, "loc": { "start": { "line": 39, "column": 38 }, "end": { "line": 39, "column": 67 } }, "callee": { "type": "MemberExpression", "start": 1733, "end": 1743, "loc": { "start": { "line": 39, "column": 38 }, "end": { "line": 39, "column": 48 } }, "object": { "type": "Identifier", "start": 1733, "end": 1738, "loc": { "start": { "line": 39, "column": 38 }, "end": { "line": 39, "column": 43 } }, "name": "chalk" }, "property": { "type": "Identifier", "start": 1739, "end": 1743, "loc": { "start": { "line": 39, "column": 44 }, "end": { "line": 39, "column": 48 } }, "name": "bold" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 1744, "end": 1761, "loc": { "start": { "line": 39, "column": 49 }, "end": { "line": 39, "column": 66 } }, "value": "ROC_CONFIG_PATH", "rawValue": "ROC_CONFIG_PATH", "raw": "'ROC_CONFIG_PATH'" } ] } }, "operator": "+", "right": { "type": "Literal", "start": 1765, "end": 1810, "loc": { "start": { "line": 39, "column": 70 }, "end": { "line": 39, "column": 115 } }, "value": " is set and that will be used instead. The ", "rawValue": " is set and that will be used instead. The ", "raw": "' is set and that will be used instead. The '" } }, "operator": "+", "right": { "type": "Literal", "start": 1825, "end": 1853, "loc": { "start": { "line": 40, "column": 12 }, "end": { "line": 40, "column": 40 } }, "value": "path that will be used is ", "rawValue": "path that will be used is ", "raw": "'path that will be used is '" } }, "operator": "+", "right": { "type": "Identifier", "start": 1856, "end": 1866, "loc": { "start": { "line": 40, "column": 43 }, "end": { "line": 40, "column": 53 } }, "name": "configPath" } } ] }, { "type": "Literal", "start": 1878, "end": 1882, "loc": { "start": { "line": 41, "column": 10