UNPKG

electron-forge

Version:

A complete tool for building modern Electron applications

1,559 lines (1,558 loc) 709 kB
{ "type": "File", "start": 0, "end": 4730, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 136, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 4730, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 136, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 16, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 16 } }, "specifiers": [], "source": { "type": "StringLiteral", "start": 7, "end": 15, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 15 } }, "extra": { "rawValue": "colors", "raw": "'colors'" }, "value": "colors" } }, { "type": "ImportDeclaration", "start": 17, "end": 45, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 28 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 24, "end": 26, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 9 } }, "local": { "type": "Identifier", "start": 24, "end": 26, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 9 }, "identifierName": "fs" }, "name": "fs" } } ], "source": { "type": "StringLiteral", "start": 32, "end": 44, "loc": { "start": { "line": 2, "column": 15 }, "end": { "line": 2, "column": 27 } }, "extra": { "rawValue": "fs-promise", "raw": "'fs-promise'" }, "value": "fs-promise" } }, { "type": "ImportDeclaration", "start": 46, "end": 70, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 24 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 53, "end": 57, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 11 } }, "local": { "type": "Identifier", "start": 53, "end": 57, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 11 }, "identifierName": "path" }, "name": "path" } } ], "source": { "type": "StringLiteral", "start": 63, "end": 69, "loc": { "start": { "line": 3, "column": 17 }, "end": { "line": 3, "column": 23 } }, "extra": { "rawValue": "path", "raw": "'path'" }, "value": "path" } }, { "type": "ImportDeclaration", "start": 72, "end": 115, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 43 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 79, "end": 87, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 15 } }, "local": { "type": "Identifier", "start": 79, "end": 87, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 15 }, "identifierName": "asyncOra" }, "name": "asyncOra" } } ], "source": { "type": "StringLiteral", "start": 93, "end": 114, "loc": { "start": { "line": 5, "column": 21 }, "end": { "line": 5, "column": 42 } }, "extra": { "rawValue": "../util/ora-handler", "raw": "'../util/ora-handler'" }, "value": "../util/ora-handler" } }, { "type": "ImportDeclaration", "start": 116, "end": 174, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 58 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 123, "end": 139, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 23 } }, "local": { "type": "Identifier", "start": 123, "end": 139, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 23 }, "identifierName": "electronHostArch" }, "name": "electronHostArch" } } ], "source": { "type": "StringLiteral", "start": 145, "end": 173, "loc": { "start": { "line": 6, "column": 29 }, "end": { "line": 6, "column": 57 } }, "extra": { "rawValue": "../util/electron-host-arch", "raw": "'../util/electron-host-arch'" }, "value": "../util/electron-host-arch" } }, { "type": "ImportDeclaration", "start": 175, "end": 225, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 50 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 182, "end": 196, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 21 } }, "local": { "type": "Identifier", "start": 182, "end": 196, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 21 }, "identifierName": "getForgeConfig" }, "name": "getForgeConfig" } } ], "source": { "type": "StringLiteral", "start": 202, "end": 224, "loc": { "start": { "line": 7, "column": 27 }, "end": { "line": 7, "column": 49 } }, "extra": { "rawValue": "../util/forge-config", "raw": "'../util/forge-config'" }, "value": "../util/forge-config" } }, { "type": "ImportDeclaration", "start": 226, "end": 282, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 56 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 233, "end": 248, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 22 } }, "local": { "type": "Identifier", "start": 233, "end": 248, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 22 }, "identifierName": "readPackageJSON" }, "name": "readPackageJSON" } } ], "source": { "type": "StringLiteral", "start": 254, "end": 281, "loc": { "start": { "line": 8, "column": 28 }, "end": { "line": 8, "column": 55 } }, "extra": { "rawValue": "../util/read-package-json", "raw": "'../util/read-package-json'" }, "value": "../util/read-package-json" } }, { "type": "ImportDeclaration", "start": 283, "end": 334, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 51 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 290, "end": 303, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 20 } }, "local": { "type": "Identifier", "start": 290, "end": 303, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 20 }, "identifierName": "requireSearch" }, "name": "requireSearch" } } ], "source": { "type": "StringLiteral", "start": 309, "end": 333, "loc": { "start": { "line": 9, "column": 26 }, "end": { "line": 9, "column": 50 } }, "extra": { "rawValue": "../util/require-search", "raw": "'../util/require-search'" }, "value": "../util/require-search" } }, { "type": "ImportDeclaration", "start": 335, "end": 380, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 45 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 342, "end": 352, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 17 } }, "local": { "type": "Identifier", "start": 342, "end": 352, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 17 }, "identifierName": "resolveDir" }, "name": "resolveDir" } } ], "source": { "type": "StringLiteral", "start": 358, "end": 379, "loc": { "start": { "line": 10, "column": 23 }, "end": { "line": 10, "column": 44 } }, "extra": { "rawValue": "../util/resolve-dir", "raw": "'../util/resolve-dir'" }, "value": "../util/resolve-dir" } }, { "type": "ImportDeclaration", "start": 382, "end": 415, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 33 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 389, "end": 397, "loc": { "start": { "line": 12, "column": 7 }, "end": { "line": 12, "column": 15 } }, "local": { "type": "Identifier", "start": 389, "end": 397, "loc": { "start": { "line": 12, "column": 7 }, "end": { "line": 12, "column": 15 }, "identifierName": "packager" }, "name": "packager" } } ], "source": { "type": "StringLiteral", "start": 403, "end": 414, "loc": { "start": { "line": 12, "column": 21 }, "end": { "line": 12, "column": 32 } }, "extra": { "rawValue": "./package", "raw": "'./package'" }, "value": "./package" }, "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @typedef {Object} MakeOptions\n * @property {string} [dir=process.cwd()] The path to the app from which distributables are generated\n * @property {boolean} [interactive=false] Whether to use sensible defaults or prompt the user visually\n * @property {boolean} [skipPackage=false] Whether to skip the pre-make packaging step\n * @property {Array<string>} [overrideTargets] An array of make targets to override your forge config\n * @property {string} [arch=host architecture] The target architecture\n * @property {string} [platform=process.platform] The target platform. NOTE: This is limited to be the current platform at the moment\n ", "start": 417, "end": 1057, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 22, "column": 3 } } }, { "type": "CommentBlock", "value": "*\n * Make distributables for an Electron application.\n *\n * @param {MakeOptions} providedOptions - Options for the make method\n * @return {Promise} Will resolve when the make process is complete\n ", "start": 1059, "end": 1259, "loc": { "start": { "line": 24, "column": 0 }, "end": { "line": 29, "column": 3 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 1260, "end": 4729, "loc": { "start": { "line": 30, "column": 0 }, "end": { "line": 135, "column": 2 } }, "declaration": { "type": "ArrowFunctionExpression", "start": 1275, "end": 4728, "loc": { "start": { "line": 30, "column": 15 }, "end": { "line": 135, "column": 1 } }, "id": null, "generator": false, "expression": false, "async": true, "params": [ { "type": "AssignmentPattern", "start": 1282, "end": 1302, "loc": { "start": { "line": 30, "column": 22 }, "end": { "line": 30, "column": 42 } }, "left": { "type": "Identifier", "start": 1282, "end": 1297, "loc": { "start": { "line": 30, "column": 22 }, "end": { "line": 30, "column": 37 }, "identifierName": "providedOptions" }, "name": "providedOptions" }, "right": { "type": "ObjectExpression", "start": 1300, "end": 1302, "loc": { "start": { "line": 30, "column": 40 }, "end": { "line": 30, "column": 42 } }, "properties": [] } } ], "body": { "type": "BlockStatement", "start": 1307, "end": 4728, "loc": { "start": { "line": 30, "column": 47 }, "end": { "line": 135, "column": 1 } }, "body": [ { "type": "VariableDeclaration", "start": 1370, "end": 1615, "loc": { "start": { "line": 32, "column": 2 }, "end": { "line": 38, "column": 22 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1374, "end": 1614, "loc": { "start": { "line": 32, "column": 6 }, "end": { "line": 38, "column": 21 } }, "id": { "type": "ObjectPattern", "start": 1374, "end": 1440, "loc": { "start": { "line": 32, "column": 6 }, "end": { "line": 32, "column": 72 } }, "properties": [ { "type": "ObjectProperty", "start": 1376, "end": 1379, "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 32, "column": 11 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1376, "end": 1379, "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 32, "column": 11 }, "identifierName": "dir" }, "name": "dir", "leadingComments": null }, "value": { "type": "Identifier", "start": 1376, "end": 1379, "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 32, "column": 11 }, "identifierName": "dir" }, "name": "dir" }, "leadingComments": null, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 1381, "end": 1392, "loc": { "start": { "line": 32, "column": 13 }, "end": { "line": 32, "column": 24 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1381, "end": 1392, "loc": { "start": { "line": 32, "column": 13 }, "end": { "line": 32, "column": 24 }, "identifierName": "interactive" }, "name": "interactive" }, "value": { "type": "Identifier", "start": 1381, "end": 1392, "loc": { "start": { "line": 32, "column": 13 }, "end": { "line": 32, "column": 24 }, "identifierName": "interactive" }, "name": "interactive" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 1394, "end": 1405, "loc": { "start": { "line": 32, "column": 26 }, "end": { "line": 32, "column": 37 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1394, "end": 1405, "loc": { "start": { "line": 32, "column": 26 }, "end": { "line": 32, "column": 37 }, "identifierName": "skipPackage" }, "name": "skipPackage" }, "value": { "type": "Identifier", "start": 1394, "end": 1405, "loc": { "start": { "line": 32, "column": 26 }, "end": { "line": 32, "column": 37 }, "identifierName": "skipPackage" }, "name": "skipPackage" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 1407, "end": 1422, "loc": { "start": { "line": 32, "column": 39 }, "end": { "line": 32, "column": 54 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1407, "end": 1422, "loc": { "start": { "line": 32, "column": 39 }, "end": { "line": 32, "column": 54 }, "identifierName": "overrideTargets" }, "name": "overrideTargets" }, "value": { "type": "Identifier", "start": 1407, "end": 1422, "loc": { "start": { "line": 32, "column": 39 }, "end": { "line": 32, "column": 54 }, "identifierName": "overrideTargets" }, "name": "overrideTargets" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 1424, "end": 1428, "loc": { "start": { "line": 32, "column": 56 }, "end": { "line": 32, "column": 60 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1424, "end": 1428, "loc": { "start": { "line": 32, "column": 56 }, "end": { "line": 32, "column": 60 }, "identifierName": "arch" }, "name": "arch" }, "value": { "type": "Identifier", "start": 1424, "end": 1428, "loc": { "start": { "line": 32, "column": 56 }, "end": { "line": 32, "column": 60 }, "identifierName": "arch" }, "name": "arch" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 1430, "end": 1438, "loc": { "start": { "line": 32, "column": 62 }, "end": { "line": 32, "column": 70 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1430, "end": 1438, "loc": { "start": { "line": 32, "column": 62 }, "end": { "line": 32, "column": 70 }, "identifierName": "platform" }, "name": "platform" }, "value": { "type": "Identifier", "start": 1430, "end": 1438, "loc": { "start": { "line": 32, "column": 62 }, "end": { "line": 32, "column": 70 }, "identifierName": "platform" }, "name": "platform" }, "extra": { "shorthand": true } } ], "leadingComments": null }, "init": { "type": "CallExpression", "start": 1443, "end": 1614, "loc": { "start": { "line": 32, "column": 75 }, "end": { "line": 38, "column": 21 } }, "callee": { "type": "MemberExpression", "start": 1443, "end": 1456, "loc": { "start": { "line": 32, "column": 75 }, "end": { "line": 32, "column": 88 } }, "object": { "type": "Identifier", "start": 1443, "end": 1449, "loc": { "start": { "line": 32, "column": 75 }, "end": { "line": 32, "column": 81 }, "identifierName": "Object" }, "name": "Object" }, "property": { "type": "Identifier", "start": 1450, "end": 1456, "loc": { "start": { "line": 32, "column": 82 }, "end": { "line": 32, "column": 88 }, "identifierName": "assign" }, "name": "assign" }, "computed": false }, "arguments": [ { "type": "ObjectExpression", "start": 1457, "end": 1596, "loc": { "start": { "line": 32, "column": 89 }, "end": { "line": 38, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 1463, "end": 1481, "loc": { "start": { "line": 33, "column": 4 }, "end": { "line": 33, "column": 22 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 1463, "end": 1466, "loc": { "start": { "line": 33, "column": 4 }, "end": { "line": 33, "column": 7 }, "identifierName": "dir" }, "name": "dir" }, "value": { "type": "CallExpression", "start": 1468, "end": 1481, "loc": { "start": { "line": 33, "column": 9 }, "end": { "line": 33, "column": 22 } }, "callee": { "type": "MemberExpression", "start": 1468, "end": 1479, "loc": { "start": { "line": 33, "column": 9 }, "end": { "line": 33, "column": 20 } }, "object": { "type": "Identifier", "start": 1468, "end": 1475, "loc": { "start": { "line": 33, "column": 9 }, "end": { "line": 33, "column": 16 }, "identifierName": "process" }, "name": "process" }, "property": { "type": "Identifier", "start": 1476, "end": 1479, "loc": { "start": { "line": 33, "column": 17 }, "end": { "line": 33, "column": 20 }, "identifierName": "cwd" }, "name": "cwd" }, "computed": false }, "arguments": [] } }, { "type": "ObjectProperty", "start": 1487, "end": 1505, "loc": { "start": { "line": 34, "column": 4 }, "end": { "line": 34, "column": 22 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 1487, "end": 1498, "loc": { "start": { "line": 34, "column": 4 }, "end": { "line": 34, "column": 15 }, "identifierName": "interactive" }, "name": "interactive" }, "value": { "type": "BooleanLiteral", "start": 1500, "end": 1505, "loc": { "start": { "line": 34, "column": 17 }, "end": { "line": 34, "column": 22 } }, "value": false } }, { "type": "ObjectProperty", "start": 1511, "end": 1529, "loc": { "start": { "line": 35, "column": 4 }, "end": { "line": 35, "column": 22 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 1511, "end": 1522, "loc": { "start": { "line": 35, "column": 4 }, "end": { "line": 35, "column": 15 }, "identifierName": "skipPackage" }, "name": "skipPackage" }, "value": { "type": "BooleanLiteral", "start": 1524, "end": 1529, "loc": { "start": { "line": 35, "column": 17 }, "end": { "line": 35, "column": 22 } }, "value": false } }, { "type": "ObjectProperty", "start": 1535, "end": 1559, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 28 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 1535, "end": 1539, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 8 }, "identifierName": "arch" }, "name": "arch" }, "value": { "type": "CallExpression", "start": 1541, "end": 1559, "loc": { "start": { "line": 36, "column": 10 }, "end": { "line": 36, "column": 28 } }, "callee": { "type": "Identifier", "start": 1541, "end": 1557, "loc": { "start": { "line": 36, "column": 10 }, "end": { "line": 36, "column": 26 }, "identifierName": "electronHostArch" }, "name": "electronHostArch" }, "arguments": [] } }, { "type": "ObjectProperty", "start": 1565, "end": 1591, "loc": { "start": { "line": 37, "column": 4 }, "end": {