UNPKG

electron-forge

Version:

A complete tool for building modern Electron applications

1,589 lines (1,588 loc) 235 kB
{ "type": "File", "start": 0, "end": 2007, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 60, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 2007, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 60, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 26, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 12, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 12 } }, "local": { "type": "Identifier", "start": 7, "end": 12, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 12 }, "identifierName": "debug" }, "name": "debug" } } ], "source": { "type": "StringLiteral", "start": 18, "end": 25, "loc": { "start": { "line": 1, "column": 18 }, "end": { "line": 1, "column": 25 } }, "extra": { "rawValue": "debug", "raw": "'debug'" }, "value": "debug" } }, { "type": "ImportDeclaration", "start": 28, "end": 73, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 45 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 35, "end": 45, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 17 } }, "local": { "type": "Identifier", "start": 35, "end": 45, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 17 }, "identifierName": "initCustom" }, "name": "initCustom" } } ], "source": { "type": "StringLiteral", "start": 51, "end": 72, "loc": { "start": { "line": 3, "column": 23 }, "end": { "line": 3, "column": 44 } }, "extra": { "rawValue": "../init/init-custom", "raw": "'../init/init-custom'" }, "value": "../init/init-custom" } }, { "type": "ImportDeclaration", "start": 74, "end": 125, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 51 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 81, "end": 94, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 20 } }, "local": { "type": "Identifier", "start": 81, "end": 94, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 20 }, "identifierName": "initDirectory" }, "name": "initDirectory" } } ], "source": { "type": "StringLiteral", "start": 100, "end": 124, "loc": { "start": { "line": 4, "column": 26 }, "end": { "line": 4, "column": 50 } }, "extra": { "rawValue": "../init/init-directory", "raw": "'../init/init-directory'" }, "value": "../init/init-directory" } }, { "type": "ImportDeclaration", "start": 126, "end": 165, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 39 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 133, "end": 140, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 14 } }, "local": { "type": "Identifier", "start": 133, "end": 140, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 14 }, "identifierName": "initGit" }, "name": "initGit" } } ], "source": { "type": "StringLiteral", "start": 146, "end": 164, "loc": { "start": { "line": 5, "column": 20 }, "end": { "line": 5, "column": 38 } }, "extra": { "rawValue": "../init/init-git", "raw": "'../init/init-git'" }, "value": "../init/init-git" } }, { "type": "ImportDeclaration", "start": 166, "end": 205, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 39 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 173, "end": 180, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 14 } }, "local": { "type": "Identifier", "start": 173, "end": 180, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 14 }, "identifierName": "initNPM" }, "name": "initNPM" } } ], "source": { "type": "StringLiteral", "start": 186, "end": 204, "loc": { "start": { "line": 6, "column": 20 }, "end": { "line": 6, "column": 38 } }, "extra": { "rawValue": "../init/init-npm", "raw": "'../init/init-npm'" }, "value": "../init/init-npm" } }, { "type": "ImportDeclaration", "start": 206, "end": 262, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 56 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 213, "end": 228, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 22 } }, "local": { "type": "Identifier", "start": 213, "end": 228, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 22 }, "identifierName": "initStandardFix" }, "name": "initStandardFix" } } ], "source": { "type": "StringLiteral", "start": 234, "end": 261, "loc": { "start": { "line": 7, "column": 28 }, "end": { "line": 7, "column": 55 } }, "extra": { "rawValue": "../init/init-standard-fix", "raw": "'../init/init-standard-fix'" }, "value": "../init/init-standard-fix" } }, { "type": "ImportDeclaration", "start": 263, "end": 316, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 53 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 270, "end": 281, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 18 } }, "local": { "type": "Identifier", "start": 270, "end": 281, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 18 }, "identifierName": "initStarter" }, "name": "initStarter" } } ], "source": { "type": "StringLiteral", "start": 287, "end": 315, "loc": { "start": { "line": 8, "column": 24 }, "end": { "line": 8, "column": 52 } }, "extra": { "rawValue": "../init/init-starter-files", "raw": "'../init/init-starter-files'" }, "value": "../init/init-starter-files" } }, { "type": "ImportDeclaration", "start": 318, "end": 361, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 43 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 325, "end": 333, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 15 } }, "local": { "type": "Identifier", "start": 325, "end": 333, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 15 }, "identifierName": "asyncOra" }, "name": "asyncOra" } } ], "source": { "type": "StringLiteral", "start": 339, "end": 360, "loc": { "start": { "line": 10, "column": 21 }, "end": { "line": 10, "column": 42 } }, "extra": { "rawValue": "../util/ora-handler", "raw": "'../util/ora-handler'" }, "value": "../util/ora-handler" } }, { "type": "VariableDeclaration", "start": 363, "end": 402, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 39 } }, "declarations": [ { "type": "VariableDeclarator", "start": 369, "end": 401, "loc": { "start": { "line": 12, "column": 6 }, "end": { "line": 12, "column": 38 } }, "id": { "type": "Identifier", "start": 369, "end": 370, "loc": { "start": { "line": 12, "column": 6 }, "end": { "line": 12, "column": 7 }, "identifierName": "d" }, "name": "d" }, "init": { "type": "CallExpression", "start": 373, "end": 401, "loc": { "start": { "line": 12, "column": 10 }, "end": { "line": 12, "column": 38 } }, "callee": { "type": "Identifier", "start": 373, "end": 378, "loc": { "start": { "line": 12, "column": 10 }, "end": { "line": 12, "column": 15 }, "identifierName": "debug" }, "name": "debug" }, "arguments": [ { "type": "StringLiteral", "start": 379, "end": 400, "loc": { "start": { "line": 12, "column": 16 }, "end": { "line": 12, "column": 37 } }, "extra": { "rawValue": "electron-forge:init", "raw": "'electron-forge:init'" }, "value": "electron-forge:init" } ] } } ], "kind": "const", "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @typedef {Object} InitOptions\n * @property {string} [dir=process.cwd()] The path to the app to be initialized\n * @property {boolean} [interactive=false] Whether to use sensible defaults or prompt the user visually\n * @property {string} [lintstyle=airbnb] The lintstyle to pass through to the template creator\n * @property {string} [template] The custom template to use. If left empty, the default template is used\n ", "start": 404, "end": 828, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 20, "column": 3 } } }, { "type": "CommentBlock", "value": "*\n * Initialize a new Electron Forge template project in the given directory.\n *\n * @param {InitOptions} providedOptions - Options for the init method\n * @return {Promise} Will resolve when the initialization process is complete\n ", "start": 830, "end": 1064, "loc": { "start": { "line": 22, "column": 0 }, "end": { "line": 27, "column": 3 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 1065, "end": 2006, "loc": { "start": { "line": 28, "column": 0 }, "end": { "line": 59, "column": 2 } }, "declaration": { "type": "ArrowFunctionExpression", "start": 1080, "end": 2005, "loc": { "start": { "line": 28, "column": 15 }, "end": { "line": 59, "column": 1 } }, "id": null, "generator": false, "expression": false, "async": true, "params": [ { "type": "AssignmentPattern", "start": 1087, "end": 1107, "loc": { "start": { "line": 28, "column": 22 }, "end": { "line": 28, "column": 42 } }, "left": { "type": "Identifier", "start": 1087, "end": 1102, "loc": { "start": { "line": 28, "column": 22 }, "end": { "line": 28, "column": 37 }, "identifierName": "providedOptions" }, "name": "providedOptions" }, "right": { "type": "ObjectExpression", "start": 1105, "end": 1107, "loc": { "start": { "line": 28, "column": 40 }, "end": { "line": 28, "column": 42 } }, "properties": [] } } ], "body": { "type": "BlockStatement", "start": 1112, "end": 2005, "loc": { "start": { "line": 28, "column": 47 }, "end": { "line": 59, "column": 1 } }, "body": [ { "type": "VariableDeclaration", "start": 1175, "end": 1354, "loc": { "start": { "line": 30, "column": 2 }, "end": { "line": 35, "column": 22 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1179, "end": 1353, "loc": { "start": { "line": 30, "column": 6 }, "end": { "line": 35, "column": 21 } }, "id": { "type": "ObjectPattern", "start": 1179, "end": 1220, "loc": { "start": { "line": 30, "column": 6 }, "end": { "line": 30, "column": 47 } }, "properties": [ { "type": "ObjectProperty", "start": 1181, "end": 1184, "loc": { "start": { "line": 30, "column": 8 }, "end": { "line": 30, "column": 11 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1181, "end": 1184, "loc": { "start": { "line": 30, "column": 8 }, "end": { "line": 30, "column": 11 }, "identifierName": "dir" }, "name": "dir", "leadingComments": null }, "value": { "type": "Identifier", "start": 1181, "end": 1184, "loc": { "start": { "line": 30, "column": 8 }, "end": { "line": 30, "column": 11 }, "identifierName": "dir" }, "name": "dir" }, "leadingComments": null, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 1186, "end": 1197, "loc": { "start": { "line": 30, "column": 13 }, "end": { "line": 30, "column": 24 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1186, "end": 1197, "loc": { "start": { "line": 30, "column": 13 }, "end": { "line": 30, "column": 24 }, "identifierName": "interactive" }, "name": "interactive" }, "value": { "type": "Identifier", "start": 1186, "end": 1197, "loc": { "start": { "line": 30, "column": 13 }, "end": { "line": 30, "column": 24 }, "identifierName": "interactive" }, "name": "interactive" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 1199, "end": 1208, "loc": { "start": { "line": 30, "column": 26 }, "end": { "line": 30, "column": 35 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1199, "end": 1208, "loc": { "start": { "line": 30, "column": 26 }, "end": { "line": 30, "column": 35 }, "identifierName": "lintstyle" }, "name": "lintstyle" }, "value": { "type": "Identifier", "start": 1199, "end": 1208, "loc": { "start": { "line": 30, "column": 26 }, "end": { "line": 30, "column": 35 }, "identifierName": "lintstyle" }, "name": "lintstyle" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 1210, "end": 1218, "loc": { "start": { "line": 30, "column": 37 }, "end": { "line": 30, "column": 45 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 1210, "end": 1218, "loc": { "start": { "line": 30, "column": 37 }, "end": { "line": 30, "column": 45 }, "identifierName": "template" }, "name": "template" }, "value": { "type": "Identifier", "start": 1210, "end": 1218, "loc": { "start": { "line": 30, "column": 37 }, "end": { "line": 30, "column": 45 }, "identifierName": "template" }, "name": "template" }, "extra": { "shorthand": true } } ], "leadingComments": null }, "init": { "type": "CallExpression", "start": 1223, "end": 1353, "loc": { "start": { "line": 30, "column": 50 }, "end": { "line": 35, "column": 21 } }, "callee": { "type": "MemberExpression", "start": 1223, "end": 1236, "loc": { "start": { "line": 30, "column": 50 }, "end": { "line": 30, "column": 63 } }, "object": { "type": "Identifier", "start": 1223, "end": 1229, "loc": { "start": { "line": 30, "column": 50 }, "end": { "line": 30, "column": 56 }, "identifierName": "Object" }, "name": "Object" }, "property": { "type": "Identifier", "start": 1230, "end": 1236, "loc": { "start": { "line": 30, "column": 57 }, "end": { "line": 30, "column": 63 }, "identifierName": "assign" }, "name": "assign" }, "computed": false }, "arguments": [ { "type": "ObjectExpression", "start": 1237, "end": 1335, "loc": { "start": { "line": 30, "column": 64 }, "end": { "line": 35, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 1243, "end": 1261, "loc": { "start": { "line": 31, "column": 4 }, "end": { "line": 31, "column": 22 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 1243, "end": 1246, "loc": { "start": { "line": 31, "column": 4 }, "end": { "line": 31, "column": 7 }, "identifierName": "dir" }, "name": "dir" }, "value": { "type": "CallExpression", "start": 1248, "end": 1261, "loc": { "start": { "line": 31, "column": 9 }, "end": { "line": 31, "column": 22 } }, "callee": { "type": "MemberExpression", "start": 1248, "end": 1259, "loc": { "start": { "line": 31, "column": 9 }, "end": { "line": 31, "column": 20 } }, "object": { "type": "Identifier", "start": 1248, "end": 1255, "loc": { "start": { "line": 31, "column": 9 }, "end": { "line": 31, "column": 16 }, "identifierName": "process" }, "name": "process" }, "property": { "type": "Identifier", "start": 1256, "end": 1259, "loc": { "start": { "line": 31, "column": 17 }, "end": { "line": 31, "column": 20 }, "identifierName": "cwd" }, "name": "cwd" }, "computed": false }, "arguments": [] } }, { "type": "ObjectProperty", "start": 1267, "end": 1285, "loc": { "start": { "line": 32, "column": 4 }, "end": { "line": 32, "column": 22 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 1267, "end": 1278, "loc": { "start": { "line": 32, "column": 4 }, "end": { "line": 32, "column": 15 }, "identifierName": "interactive" }, "name": "interactive" }, "value": { "type": "BooleanLiteral", "start": 1280, "end": 1285, "loc": { "start": { "line": 32, "column": 17 }, "end": { "line": 32, "column": 22 } }, "value": false } }, { "type": "ObjectProperty", "start": 1291, "end": 1310, "loc": { "start": { "line": 33, "column": 4 }, "end": { "line": 33, "column": 23 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 1291, "end": 1300, "loc": { "start": { "line": 33, "column": 4 }, "end": { "line": 33, "column": 13 }, "identifierName": "lintstyle" }, "name": "lintstyle" }, "value": { "type": "StringLiteral", "start": 1302, "end": 1310, "loc": { "start": { "line": 33, "column": 15 }, "end": { "line": 33, "column": 23 } }, "extra": { "rawValue": "airbnb", "raw": "'airbnb'" }, "value": "airbnb" } }, { "type": "ObjectProperty", "start": 1316, "end": 1330, "loc": { "start": { "line": 34, "column": 4 }, "end": { "line": 34, "column": 18 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 1316, "end": 1324, "loc": { "start": { "line": 34, "column": 4 }, "end": { "line": 34, "column": 12 }, "identifierName": "template" }, "name": "template" }, "value": { "type": "NullLiteral", "start": 1326, "end": 1330, "loc": { "start": { "line": 34, "column": 14 }, "end": { "line": 34, "column": 18 } } } } ] }, { "type": "Identifier", "start": 1337, "end": 1352, "loc": { "start": { "line": 35, "column": 5 }, "end": { "line": 35, "column": 20 }, "identifierName": "providedOptions" }, "name": "providedOptions" } ] }, "leadingComments": null } ], "kind": "let", "leadingComments": [ { "type": "CommentLine", "value": " eslint-disable-next-line prefer-const, no-unused-vars", "start": 1116, "end": 1172, "loc": { "start": { "line": 29, "column": 2 }, "end": { "line": 29, "column": 58 } } } ] }, { "type": "ExpressionStatement", "start": 1357, "end": 1392, "loc": { "start": { "line": 36, "column": 2 }, "end": { "line": 36, "column": 37 } }, "expression": { "type": "AssignmentExpression", "start": 1357, "end": 1391, "loc": { "start": { "line": 36, "column": 2 }, "end": { "line": 36, "column": 36 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 1357, "end": 1377, "loc": { "start": { "line": 36, "column": 2 }, "end": { "line": 36, "column": 22 } }, "object": { "type": "Identifier", "start": 1357, "end": 1365, "loc": { "start": { "line": 36, "column": 2 }, "end": { "line": 36, "column": 10 }, "identifierName": "asyncOra" }, "name": "asyncOra" }, "property": { "type": "Identifier", "start": 1366, "end": 1377, "loc": { "start": { "line": 36, "column": 11 }, "end": { "line": 36, "column": 22 }, "identifierName": "interactive" }, "name": "interactive" }, "computed": false }, "right": { "type": "Identifier", "start": 1380, "end": 1391, "loc": { "start": { "line": 36, "column": 25 }, "end": { "line": 36, "column": 36 }, "identifierName": "interactive" }, "name": "interactive" } } }, { "type": "ExpressionStatement", "start": 1396, "end": 1425, "loc": { "start": { "line": 38, "column": 2 }, "end": { "line": 38, "column": 31 } }, "expression": { "type": "CallExpression", "start": 1396, "end": 1424, "loc": { "start": { "line": 38, "column": 2 },