UNPKG

roc

Version:

Build modern web applications easily

1,907 lines (1,906 loc) 590 kB
{ "type": "Program", "start": 0, "end": 6645, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 189, "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": 65, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 26 } }, "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": 64, "loc": { "start": { "line": 3, "column": 15 }, "end": { "line": 3, "column": 25 } }, "value": "fs-extra", "rawValue": "fs-extra", "raw": "'fs-extra'" } }, { "type": "ImportDeclaration", "start": 66, "end": 90, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 24 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 73, "end": 77, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 11 } }, "local": { "type": "Identifier", "start": 73, "end": 77, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 11 } }, "name": "path" } } ], "importKind": "value", "source": { "type": "Literal", "start": 83, "end": 89, "loc": { "start": { "line": 4, "column": 17 }, "end": { "line": 4, "column": 23 } }, "value": "path", "rawValue": "path", "raw": "'path'" } }, { "type": "ImportDeclaration", "start": 91, "end": 129, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 38 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 100, "end": 105, "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 14 } }, "imported": { "type": "Identifier", "start": 100, "end": 105, "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 14 } }, "name": "spawn" }, "local": { "type": "Identifier", "start": 100, "end": 105, "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 14 } }, "name": "spawn" } } ], "importKind": "value", "source": { "type": "Literal", "start": 113, "end": 128, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 5, "column": 37 } }, "value": "child_process", "rawValue": "child_process", "raw": "'child_process'" } }, { "type": "ImportDeclaration", "start": 130, "end": 162, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 32 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 137, "end": 145, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 15 } }, "local": { "type": "Identifier", "start": 137, "end": 145, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 15 } }, "name": "inquirer" } } ], "importKind": "value", "source": { "type": "Literal", "start": 151, "end": 161, "loc": { "start": { "line": 6, "column": 21 }, "end": { "line": 6, "column": 31 } }, "value": "inquirer", "rawValue": "inquirer", "raw": "'inquirer'" } }, { "type": "ImportDeclaration", "start": 163, "end": 193, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 30 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 170, "end": 177, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 14 } }, "local": { "type": "Identifier", "start": 170, "end": 177, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 14 } }, "name": "replace" } } ], "importKind": "value", "source": { "type": "Literal", "start": 183, "end": 192, "loc": { "start": { "line": 7, "column": 20 }, "end": { "line": 7, "column": 29 } }, "value": "replace", "rawValue": "replace", "raw": "'replace'" } }, { "type": "ImportDeclaration", "start": 194, "end": 220, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 201, "end": 206, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 12 } }, "local": { "type": "Identifier", "start": 201, "end": 206, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 12 } }, "name": "chalk" } } ], "importKind": "value", "source": { "type": "Literal", "start": 212, "end": 219, "loc": { "start": { "line": 8, "column": 18 }, "end": { "line": 8, "column": 25 } }, "value": "chalk", "rawValue": "chalk", "raw": "'chalk'" } }, { "type": "ImportDeclaration", "start": 222, "end": 274, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 52 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 231, "end": 234, "loc": { "start": { "line": 10, "column": 9 }, "end": { "line": 10, "column": 12 } }, "imported": { "type": "Identifier", "start": 231, "end": 234, "loc": { "start": { "line": 10, "column": 9 }, "end": { "line": 10, "column": 12 } }, "name": "get" }, "local": { "type": "Identifier", "start": 231, "end": 234, "loc": { "start": { "line": 10, "column": 9 }, "end": { "line": 10, "column": 12 } }, "name": "get" } }, { "type": "ImportSpecifier", "start": 236, "end": 247, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 25 } }, "imported": { "type": "Identifier", "start": 236, "end": 247, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 25 } }, "name": "getVersions" }, "local": { "type": "Identifier", "start": 236, "end": 247, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 25 } }, "name": "getVersions" } } ], "importKind": "value", "source": { "type": "Literal", "start": 255, "end": 273, "loc": { "start": { "line": 10, "column": 33 }, "end": { "line": 10, "column": 51 } }, "value": "./helpers/github", "rawValue": "./helpers/github", "raw": "'./helpers/github'" } }, { "type": "ImportDeclaration", "start": 275, "end": 327, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 52 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 284, "end": 299, "loc": { "start": { "line": 11, "column": 9 }, "end": { "line": 11, "column": 24 } }, "imported": { "type": "Identifier", "start": 284, "end": 299, "loc": { "start": { "line": 11, "column": 9 }, "end": { "line": 11, "column": 24 } }, "name": "validRocProject" }, "local": { "type": "Identifier", "start": 284, "end": 299, "loc": { "start": { "line": 11, "column": 9 }, "end": { "line": 11, "column": 24 } }, "name": "validRocProject" } } ], "importKind": "value", "source": { "type": "Literal", "start": 307, "end": 326, "loc": { "start": { "line": 11, "column": 32 }, "end": { "line": 11, "column": 51 } }, "value": "./helpers/general", "rawValue": "./helpers/general", "raw": "'./helpers/general'" } }, { "type": "ImportDeclaration", "start": 328, "end": 407, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 79 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 337, "end": 356, "loc": { "start": { "line": 12, "column": 9 }, "end": { "line": 12, "column": 28 } }, "imported": { "type": "Identifier", "start": 337, "end": 342, "loc": { "start": { "line": 12, "column": 9 }, "end": { "line": 12, "column": 14 } }, "name": "error" }, "local": { "type": "Identifier", "start": 346, "end": 356, "loc": { "start": { "line": 12, "column": 18 }, "end": { "line": 12, "column": 28 } }, "name": "styleError" } }, { "type": "ImportSpecifier", "start": 358, "end": 365, "loc": { "start": { "line": 12, "column": 30 }, "end": { "line": 12, "column": 37 } }, "imported": { "type": "Identifier", "start": 358, "end": 365, "loc": { "start": { "line": 12, "column": 30 }, "end": { "line": 12, "column": 37 } }, "name": "warning" }, "local": { "type": "Identifier", "start": 358, "end": 365, "loc": { "start": { "line": 12, "column": 30 }, "end": { "line": 12, "column": 37 } }, "name": "warning" } }, { "type": "ImportSpecifier", "start": 367, "end": 376, "loc": { "start": { "line": 12, "column": 39 }, "end": { "line": 12, "column": 48 } }, "imported": { "type": "Identifier", "start": 367, "end": 376, "loc": { "start": { "line": 12, "column": 39 }, "end": { "line": 12, "column": 48 } }, "name": "important" }, "local": { "type": "Identifier", "start": 367, "end": 376, "loc": { "start": { "line": 12, "column": 39 }, "end": { "line": 12, "column": 48 } }, "name": "important" } }, { "type": "ImportSpecifier", "start": 378, "end": 380, "loc": { "start": { "line": 12, "column": 50 }, "end": { "line": 12, "column": 52 } }, "imported": { "type": "Identifier", "start": 378, "end": 380, "loc": { "start": { "line": 12, "column": 50 }, "end": { "line": 12, "column": 52 } }, "name": "ok" }, "local": { "type": "Identifier", "start": 378, "end": 380, "loc": { "start": { "line": 12, "column": 50 }, "end": { "line": 12, "column": 52 } }, "name": "ok" } } ], "importKind": "value", "source": { "type": "Literal", "start": 388, "end": 406, "loc": { "start": { "line": 12, "column": 60 }, "end": { "line": 12, "column": 78 } }, "value": "../helpers/style", "rawValue": "../helpers/style", "raw": "'../helpers/style'" }, "trailingComments": [ { "type": "Block", "value": " This should be fetched from a server!\n ", "start": 409, "end": 453, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 15, "column": 3 } }, "range": [ 409, 453 ] } ] }, { "type": "VariableDeclaration", "start": 454, "end": 797, "loc": { "start": { "line": 16, "column": 0 }, "end": { "line": 26, "column": 3 } }, "declarations": [ { "type": "VariableDeclarator", "start": 460, "end": 796, "loc": { "start": { "line": 16, "column": 6 }, "end": { "line": 26, "column": 2 } }, "id": { "type": "Identifier", "start": 460, "end": 469, "loc": { "start": { "line": 16, "column": 6 }, "end": { "line": 16, "column": 15 } }, "name": "templates", "leadingComments": null }, "init": { "type": "ArrayExpression", "start": 472, "end": 796, "loc": { "start": { "line": 16, "column": 18 }, "end": { "line": 26, "column": 2 } }, "elements": [ { "type": "ObjectExpression", "start": 473, "end": 625, "loc": { "start": { "line": 16, "column": 19 }, "end": { "line": 21, "column": 1 } }, "properties": [ { "type": "Property", "start": 479, "end": 501, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 17, "column": 26 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 479, "end": 483, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 17, "column": 8 } }, "name": "name" }, "value": { "type": "Literal", "start": 485, "end": 501, "loc": { "start": { "line": 17, "column": 10 }, "end": { "line": 17, "column": 26 } }, "value": "Simple Roc App", "rawValue": "Simple Roc App", "raw": "'Simple Roc App'" }, "kind": "init" }, { "type": "Property", "start": 507, "end": 565, "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 18, "column": 62 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 507, "end": 518, "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 18, "column": 15 } }, "name": "description" }, "value": { "type": "Literal", "start": 520, "end": 565, "loc": { "start": { "line": 18, "column": 17 }, "end": { "line": 18, "column": 62 } }, "value": "A simple start on a generic web application", "rawValue": "A simple start on a generic web application", "raw": "'A simple start on a generic web application'" }, "kind": "init" }, { "type": "Property", "start": 571, "end": 588, "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 19, "column": 21 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 571, "end": 581, "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 19, "column": 14 } }, "name": "identifier" }, "value": { "type": "Literal", "start": 583, "end": 588, "loc": { "start": { "line": 19, "column": 16 }, "end": { "line": 19, "column": 21 } }, "value": "web", "rawValue": "web", "raw": "'web'" }, "kind": "init" }, { "type": "Property", "start": 594, "end": 623, "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 20, "column": 33 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 594, "end": 598, "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 20, "column": 8 } }, "name": "repo" }, "value": { "type": "Literal", "start": 600, "end": 623, "loc": { "start": { "line": 20, "column": 10 }, "end": { "line": 20, "column": 33 } }, "value": "vgno/roc-template-web", "rawValue": "vgno/roc-template-web", "raw": "'vgno/roc-template-web'" }, "kind": "init" } ] }, { "type": "ObjectExpression", "start": 627, "end": 795, "loc": { "start": { "line": 21, "column": 3 }, "end": { "line": 26, "column": 1 } }, "properties": [ { "type": "Property", "start": 633, "end": 661, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 32 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 633, "end": 637, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 8 } }, "name": "name" }, "value": { "type": "Literal", "start": 639, "end": 661, "loc": { "start": { "line": 22, "column": 10 }, "end": { "line": 22, "column": 32 } }, "value": "Simple Roc React App", "rawValue": "Simple Roc React App", "raw": "'Simple Roc React App'" }, "kind": "init" }, { "type": "Property", "start": 667, "end": 723, "loc": { "start": { "line": 23, "column": 4 }, "end": { "line": 23, "column": 60 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 667, "end": 678, "loc": { "start": { "line": 23, "column": 4 }, "end": { "line": 23, "column": 15 } }, "name": "description" }, "value": { "type": "Literal", "start": 680, "end": 723, "loc": { "start": { "line": 23, "column": 17 }, "end": { "line": 23, "column": 60 } }, "value": "A simple start on a React web application", "rawValue": "A simple start on a React web application", "raw": "'A simple start on a React web application'" }, "kind": "init" }, { "type": "Property", "start": 729, "end": 752, "loc": { "start": { "line": 24, "column": 4 }, "end": { "line": 24, "column": 27 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 729, "end": 739, "loc": { "start": { "line": 24, "column": 4 }, "end": { "line": 24, "column": 14 } }, "name": "identifier" }, "value": { "type": "Literal", "start": 741, "end": 752, "loc": { "start": { "line": 24, "column": 16 }, "end": { "line": 24, "column": 27 } }, "value": "web-react", "rawValue": "web-react", "raw": "'web-react'" }, "kind": "init" }, { "type": "Property", "start": 758, "end": 793, "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 39 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 758, "end": 762, "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 8 } }, "name": "repo" }, "value": { "type": "Literal", "start": 764, "end": 793, "loc": { "start": { "line": 25, "column": 10 }, "end": { "line": 25, "column": 39 } }, "value": "vgno/roc-template-web-react", "rawValue": "vgno/roc-template-web-react", "raw": "'vgno/roc-template-web-react'" }, "kind": "init" } ] } ] }, "leadingComments": null } ], "kind": "const", "leadingComments": [ { "type": "Block", "value": " This should be fetched from a server!\n ", "start": 409, "end": 453, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 15, "column": 3 } }, "range": [ 409, 453 ] } ], "trailingComments": [ { "type": "Block", "value": "*\n * Command used to init a new Roc project.\n *\n * @param {rocCommandObject} parsedArguments - The Roc command object, uses parsedArguments from it.\n *\n * @returns {Promise} - Promise for the command.\n ", "start": 799, "end": 1005, "loc": { "start": { "line": 28, "column": 0 }, "end": { "line": 34, "column": 3 } }, "range": [ 799, 1005 ] } ] }, { "type": "ExportDefaultDeclaration", "start": 1006, "end": 6644, "loc": { "start": { "line": 35, "column": 0 }, "end": { "line": 188, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 1021, "end": 6644, "loc": { "start": { "line": 35, "column": 15 }, "end": { "line": 188, "column": 1 } }, "id": { "type": "Identifier", "start": 1030, "end": 1034, "loc": { "start": { "line": 35, "column": 24 }, "end": { "line": 35, "column": 28 } }, "name": "init", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "ObjectPattern", "start": 1035, "end": 1052, "loc": { "start": { "line": 35, "column": 29 }, "end": { "line": 35, "column": 46 } }, "properties": [ { "type": "Property", "start": 1037, "end": 1050, "loc": { "start": { "line": 35, "column": 31 }, "end": { "line": 35, "column": 44 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1037, "end": 1050, "loc": { "start": { "line": 35, "column": 31 }, "end": { "line": 35, "column": 44 } }, "name": "parsedOptions" }, "kind": "init", "value": { "type": "Identifier", "start": 1037, "end": 1050, "loc": { "start": { "line": 35, "column": 31 }, "end": { "line": 35, "column": 44 } }, "name": "parsedOptions" } } ] } ], "body": { "type": "BlockStatement", "start": 1054, "end": 6644, "loc": { "start": { "line": 35, "column": 48 }, "end": { "line": 188, "column": 1 } }, "body": [ { "type": "VariableDeclaration", "start": 1060, "end": 1112, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 56 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1066, "end": 1111, "loc": { "start": { "line": 36, "column": 10 }, "end": { "line": 36, "column": 55 } }, "id": { "type": "ObjectPattern", "start": 1066, "end": 1087, "loc": { "start": { "line": 36, "column": 10 }, "end": { "line": 36, "column": 31 } }, "properties": [ { "type": "Property", "start": 1068, "end": 1076, "loc": { "start": { "line": 36, "column": 12 }, "end": { "line": 36, "column": 20 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1068, "end": 1076, "loc": { "start": { "line": 36, "column": 12 }, "end": { "line": 36, "column": 20 } }, "name": "template" }, "kind": "init", "value": { "type": "Identifier", "start": 1068, "end": 1076, "loc": { "start": { "line": 36, "column": 12 }, "end": { "line": 36, "column": 20 } }, "name": "template" } }, { "type": "Property", "start": 1078, "end": 1085, "loc": { "start": { "line": 36, "column": 22 }, "end": { "line": 36, "column": 29 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1078, "end": 1085, "loc": { "start": { "line": 36, "column": 22 }, "end": { "line": 36, "column": 29 } }, "name": "version" }, "kind": "init", "value": { "type": "Identifier", "start": 1078, "end": 1085, "loc": { "start": { "line": 36, "column": 22 }, "end": { "line": 36, "column": 29 } }, "name": "version" } } ] }, "init": { "type": "MemberExpression", "start": 1090, "end": 1111, "loc": { "start": { "line": 36, "column": 34 }, "end": { "line": 36, "column": 55 } }, "object": { "type": "Identifier", "start": 1090, "end": 1103, "loc": { "start": { "line": 36, "column": 34 }, "end": { "line": 36, "column": 47 } }, "name": "parsedOptions" }, "property": { "type": "Identifier", "start": 1104, "end": 1111, "loc": { "start": { "line": 36, "column": 48 }, "end": { "line": 36, "column": 55 } }, "name": "options" }, "computed": false } } ], "kind": "const", "trailingComments": [ { "type": "CommentLine", "value": " Make sure the directory is empty!", "start": 1118, "end": 1154, "loc": { "start": { "line": 38, "column": 4 }, "end": { "line": 38, "column": 40 } }, "range": [ 1118, 1154 ] } ] }, { "type": "ExpressionStatement", "start": 1159, "end": 1176, "loc": { "start": { "line": 39, "column": 4 }, "end": { "line": 39, "column": 21 } }, "expression": { "type": "CallExpression", "start": 1159, "end": 1175, "loc": { "start": { "line": 39, "column": 4 }, "end": { "line": 39, "column": 20 } }, "callee": { "type": "Identifier", "start": 1159, "end": 1173, "loc": { "start": { "line": 39, "column": 4 }, "end": { "line": 39, "column": 18 } }, "name": "assertEmptyDir", "leadingComments": null }, "arguments": [], "leadingComments": null }, "leadingComments": [ { "type": "CommentLine", "value": " Make sure the directory is empty!", "start": 1118, "end": 1154,