UNPKG

electron-forge

Version:

A complete tool for building modern Electron applications

1,653 lines (1,652 loc) 634 kB
{ "type": "File", "start": 0, "end": 3726, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 98, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 3726, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 98, "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": "glob" }, "name": "glob" } } ], "source": { "type": "StringLiteral", "start": 63, "end": 69, "loc": { "start": { "line": 3, "column": 17 }, "end": { "line": 3, "column": 23 } }, "extra": { "rawValue": "glob", "raw": "'glob'" }, "value": "glob" } }, { "type": "ImportDeclaration", "start": 71, "end": 95, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 24 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 78, "end": 82, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 11 } }, "local": { "type": "Identifier", "start": 78, "end": 82, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 11 }, "identifierName": "path" }, "name": "path" } } ], "source": { "type": "StringLiteral", "start": 88, "end": 94, "loc": { "start": { "line": 4, "column": 17 }, "end": { "line": 4, "column": 23 } }, "extra": { "rawValue": "path", "raw": "'path'" }, "value": "path" } }, { "type": "ImportDeclaration", "start": 96, "end": 120, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 24 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 103, "end": 107, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 11 } }, "local": { "type": "Identifier", "start": 103, "end": 107, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 11 }, "identifierName": "pify" }, "name": "pify" } } ], "source": { "type": "StringLiteral", "start": 113, "end": 119, "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 23 } }, "extra": { "rawValue": "pify", "raw": "'pify'" }, "value": "pify" } }, { "type": "ImportDeclaration", "start": 121, "end": 162, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 41 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 128, "end": 136, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 15 } }, "local": { "type": "Identifier", "start": 128, "end": 136, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 15 }, "identifierName": "packager" }, "name": "packager" } } ], "source": { "type": "StringLiteral", "start": 142, "end": 161, "loc": { "start": { "line": 6, "column": 21 }, "end": { "line": 6, "column": 40 } }, "extra": { "rawValue": "electron-packager", "raw": "'electron-packager'" }, "value": "electron-packager" } }, { "type": "ImportDeclaration", "start": 163, "end": 185, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 22 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 170, "end": 173, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 10 } }, "local": { "type": "Identifier", "start": 170, "end": 173, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 10 }, "identifierName": "ora" }, "name": "ora" } } ], "source": { "type": "StringLiteral", "start": 179, "end": 184, "loc": { "start": { "line": 7, "column": 16 }, "end": { "line": 7, "column": 21 } }, "extra": { "rawValue": "ora", "raw": "'ora'" }, "value": "ora" } }, { "type": "ImportDeclaration", "start": 187, "end": 245, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 58 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 194, "end": 210, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 23 } }, "local": { "type": "Identifier", "start": 194, "end": 210, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 23 }, "identifierName": "electronHostArch" }, "name": "electronHostArch" } } ], "source": { "type": "StringLiteral", "start": 216, "end": 244, "loc": { "start": { "line": 9, "column": 29 }, "end": { "line": 9, "column": 57 } }, "extra": { "rawValue": "../util/electron-host-arch", "raw": "'../util/electron-host-arch'" }, "value": "../util/electron-host-arch" } }, { "type": "ImportDeclaration", "start": 246, "end": 296, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 50 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 253, "end": 267, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 21 } }, "local": { "type": "Identifier", "start": 253, "end": 267, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 21 }, "identifierName": "getForgeConfig" }, "name": "getForgeConfig" } } ], "source": { "type": "StringLiteral", "start": 273, "end": 295, "loc": { "start": { "line": 10, "column": 27 }, "end": { "line": 10, "column": 49 } }, "extra": { "rawValue": "../util/forge-config", "raw": "'../util/forge-config'" }, "value": "../util/forge-config" } }, { "type": "ImportDeclaration", "start": 297, "end": 352, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 55 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 304, "end": 323, "loc": { "start": { "line": 11, "column": 7 }, "end": { "line": 11, "column": 26 } }, "local": { "type": "Identifier", "start": 304, "end": 323, "loc": { "start": { "line": 11, "column": 7 }, "end": { "line": 11, "column": 26 }, "identifierName": "packagerCompileHook" }, "name": "packagerCompileHook" } } ], "source": { "type": "StringLiteral", "start": 329, "end": 351, "loc": { "start": { "line": 11, "column": 32 }, "end": { "line": 11, "column": 54 } }, "extra": { "rawValue": "../util/compile-hook", "raw": "'../util/compile-hook'" }, "value": "../util/compile-hook" } }, { "type": "ImportDeclaration", "start": 353, "end": 409, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 56 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 360, "end": 375, "loc": { "start": { "line": 12, "column": 7 }, "end": { "line": 12, "column": 22 } }, "local": { "type": "Identifier", "start": 360, "end": 375, "loc": { "start": { "line": 12, "column": 7 }, "end": { "line": 12, "column": 22 }, "identifierName": "readPackageJSON" }, "name": "readPackageJSON" } } ], "source": { "type": "StringLiteral", "start": 381, "end": 408, "loc": { "start": { "line": 12, "column": 28 }, "end": { "line": 12, "column": 55 } }, "extra": { "rawValue": "../util/read-package-json", "raw": "'../util/read-package-json'" }, "value": "../util/read-package-json" } }, { "type": "ImportDeclaration", "start": 410, "end": 452, "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 13, "column": 42 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 417, "end": 428, "loc": { "start": { "line": 13, "column": 7 }, "end": { "line": 13, "column": 18 } }, "local": { "type": "Identifier", "start": 417, "end": 428, "loc": { "start": { "line": 13, "column": 7 }, "end": { "line": 13, "column": 18 }, "identifierName": "rebuildHook" }, "name": "rebuildHook" } } ], "source": { "type": "StringLiteral", "start": 434, "end": 451, "loc": { "start": { "line": 13, "column": 24 }, "end": { "line": 13, "column": 41 } }, "extra": { "rawValue": "../util/rebuild", "raw": "'../util/rebuild'" }, "value": "../util/rebuild" } }, { "type": "ImportDeclaration", "start": 453, "end": 498, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 14, "column": 45 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 460, "end": 470, "loc": { "start": { "line": 14, "column": 7 }, "end": { "line": 14, "column": 17 } }, "local": { "type": "Identifier", "start": 460, "end": 470, "loc": { "start": { "line": 14, "column": 7 }, "end": { "line": 14, "column": 17 }, "identifierName": "resolveDir" }, "name": "resolveDir" } } ], "source": { "type": "StringLiteral", "start": 476, "end": 497, "loc": { "start": { "line": 14, "column": 23 }, "end": { "line": 14, "column": 44 } }, "extra": { "rawValue": "../util/resolve-dir", "raw": "'../util/resolve-dir'" }, "value": "../util/resolve-dir" }, "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @typedef {Object} PackageOptions\n * @property {string} [dir=process.cwd()] The path to the app to package\n * @property {boolean} [interactive=false] Whether to use sensible defaults or prompt the user visually\n * @property {string} [arch=process.arch] The target arch\n * @property {string} [platform=process.platform] The target platform. NOTE: This is limited to be the current platform at the moment\n ", "start": 500, "end": 913, "loc": { "start": { "line": 16, "column": 0 }, "end": { "line": 22, "column": 3 } } }, { "type": "CommentBlock", "value": "*\n * Package an Electron application into an platform dependent format.\n *\n * @param {PackageOptions} providedOptions - Options for the Package method\n * @return {Promise} Will resolve when the package process is complete\n ", "start": 915, "end": 1142, "loc": { "start": { "line": 24, "column": 0 }, "end": { "line": 29, "column": 3 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 1143, "end": 3725, "loc": { "start": { "line": 30, "column": 0 }, "end": { "line": 97, "column": 2 } }, "declaration": { "type": "ArrowFunctionExpression", "start": 1158, "end": 3724, "loc": { "start": { "line": 30, "column": 15 }, "end": { "line": 97, "column": 1 } }, "id": null, "generator": false, "expression": false, "async": true, "params": [ { "type": "AssignmentPattern", "start": 1165, "end": 1185, "loc": { "start": { "line": 30, "column": 22 }, "end": { "line": 30, "column": 42 } }, "left": { "type": "Identifier", "start": 1165, "end": 1180, "loc": { "start": { "line": 30, "column": 22 }, "end": { "line": 30, "column": 37 }, "identifierName": "providedOptions" }, "name": "providedOptions" }, "right": { "type": "ObjectExpression", "start": 1183, "end": 1185, "loc": { "start": { "line": 30, "column": 40 }, "end": { "line": 30, "column": 42 } }, "properties": [] } } ], "body": { "type": "BlockStatement", "start": 1190, "end": 3724, "loc": { "start": { "line": 30, "column": 47 }, "end": { "line": 97, "column": 1 } }, "body": [ { "type": "VariableDeclaration", "start": 1253, "end": 1444, "loc": { "start": { "line": 32, "column": 2 }, "end": { "line": 37, "column": 22 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1257, "end": 1443, "loc": { "start": { "line": 32, "column": 6 }, "end": { "line": 37, "column": 21 } }, "id": { "type": "ObjectPattern", "start": 1257, "end": 1293, "loc": { "start": { "line": 32, "column": 6 }, "end": { "line": 32, "column": 42 } }, "properties": [ { "type": "ObjectProperty", "start": 1259, "end": 1262, "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 32, "column": 11 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1259, "end": 1262, "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 32, "column": 11 }, "identifierName": "dir" }, "name": "dir", "leadingComments": null }, "value": { "type": "Identifier", "start": 1259, "end": 1262, "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 32, "column": 11 }, "identifierName": "dir" }, "name": "dir" }, "leadingComments": null, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 1264, "end": 1275, "loc": { "start": { "line": 32, "column": 13 }, "end": { "line": 32, "column": 24 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1264, "end": 1275, "loc": { "start": { "line": 32, "column": 13 }, "end": { "line": 32, "column": 24 }, "identifierName": "interactive" }, "name": "interactive" }, "value": { "type": "Identifier", "start": 1264, "end": 1275, "loc": { "start": { "line": 32, "column": 13 }, "end": { "line": 32, "column": 24 }, "identifierName": "interactive" }, "name": "interactive" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 1277, "end": 1281, "loc": { "start": { "line": 32, "column": 26 }, "end": { "line": 32, "column": 30 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1277, "end": 1281, "loc": { "start": { "line": 32, "column": 26 }, "end": { "line": 32, "column": 30 }, "identifierName": "arch" }, "name": "arch" }, "value": { "type": "Identifier", "start": 1277, "end": 1281, "loc": { "start": { "line": 32, "column": 26 }, "end": { "line": 32, "column": 30 }, "identifierName": "arch" }, "name": "arch" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 1283, "end": 1291, "loc": { "start": { "line": 32, "column": 32 }, "end": { "line": 32, "column": 40 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1283, "end": 1291, "loc": { "start": { "line": 32, "column": 32 }, "end": { "line": 32, "column": 40 }, "identifierName": "platform" }, "name": "platform" }, "value": { "type": "Identifier", "start": 1283, "end": 1291, "loc": { "start": { "line": 32, "column": 32 }, "end": { "line": 32, "column": 40 }, "identifierName": "platform" }, "name": "platform" }, "extra": { "shorthand": true } } ], "leadingComments": null }, "init": { "type": "CallExpression", "start": 1296, "end": 1443, "loc": { "start": { "line": 32, "column": 45 }, "end": { "line": 37, "column": 21 } }, "callee": { "type": "MemberExpression", "start": 1296, "end": 1309, "loc": { "start": { "line": 32, "column": 45 }, "end": { "line": 32, "column": 58 } }, "object": { "type": "Identifier", "start": 1296, "end": 1302, "loc": { "start": { "line": 32, "column": 45 }, "end": { "line": 32, "column": 51 }, "identifierName": "Object" }, "name": "Object" }, "property": { "type": "Identifier", "start": 1303, "end": 1309, "loc": { "start": { "line": 32, "column": 52 }, "end": { "line": 32, "column": 58 }, "identifierName": "assign" }, "name": "assign" }, "computed": false }, "arguments": [ { "type": "ObjectExpression", "start": 1310, "end": 1425, "loc": { "start": { "line": 32, "column": 59 }, "end": { "line": 37, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 1316, "end": 1334, "loc": { "start": { "line": 33, "column": 4 }, "end": { "line": 33, "column": 22 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 1316, "end": 1319, "loc": { "start": { "line": 33, "column": 4 }, "end": { "line": 33, "column": 7 }, "identifierName": "dir" }, "name": "dir" }, "value": { "type": "CallExpression", "start": 1321, "end": 1334, "loc": { "start": { "line": 33, "column": 9 }, "end": { "line": 33, "column": 22 } }, "callee": { "type": "MemberExpression", "start": 1321, "end": 1332, "loc": { "start": { "line": 33, "column": 9 }, "end": { "line": 33, "column": 20 } }, "object": { "type": "Identifier", "start": 1321, "end": 1328, "loc": { "start": { "line": 33, "column": 9 }, "end": { "line": 33, "column": 16 }, "identifierName": "process" }, "name": "process" }, "property": { "type": "Identifier", "start": 1329, "end": 1332, "loc": { "start": { "line": 33, "column": 17 }, "end": { "line": 33, "column": 20 }, "identifierName": "cwd" }, "name": "cwd" }, "computed": false }, "arguments": [] } }, { "type": "ObjectProperty", "start": 1340, "end": 1358, "loc": { "start": { "line": 34, "column": 4 }, "end": { "line": 34, "column": 22 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 1340, "end": 1351, "loc": { "start": { "line": 34, "column": 4 }, "end": { "line": 34, "column": 15 }, "identifierName": "interactive" }, "name": "interactive" }, "value": { "type": "BooleanLiteral", "start": 1353, "end": 1358, "loc": { "start": { "line": 34, "column": 17 }, "end": { "line": 34, "column": 22 } }, "value": false } }, { "type": "ObjectProperty", "start": 1364, "end": 1388, "loc": { "start": { "line": 35, "column": 4 }, "end": { "line": 35, "column": 28 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 1364, "end": 1368, "loc": { "start": { "line": 35, "column": 4 }, "end": { "line": 35, "column": 8 }, "identifierName": "arch" }, "name": "arch" }, "value": { "type": "CallExpression", "start": 1370, "end": 1388, "loc": { "start": { "line": 35, "column": 10 }, "end": { "line": 35, "column": 28 } }, "callee": { "type": "Identifier", "start": 1370, "end": 1386, "loc": { "start": { "line": 35, "column": 10 }, "end": { "line": 35, "column": 26 }, "identifierName": "electronHostArch" }, "name": "electronHostArch" }, "arguments": [] } }, { "type": "ObjectProperty", "start": 1394, "end": 1420, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 30 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 1394, "end": 1402, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 12 }, "identifierName": "platform" }, "name": "platform" }, "value": { "type": "MemberExpression", "start": 1404, "end": 1420, "loc": { "start": { "line": 36, "column": 14 }, "end": { "line": 36, "column": 30 } }, "object": { "type": "Identifier", "start": 1404, "end": 1411, "loc": { "start": { "line": 36, "column": 14 }, "end": {