electron-forge
Version:
A complete tool for building modern Electron applications
1,493 lines (1,492 loc) • 278 kB
JSON
{
"type": "File",
"start": 0,
"end": 2074,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 61,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 2074,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 61,
"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": 55,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 38
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 26,
"end": 31,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 14
}
},
"imported": {
"type": "Identifier",
"start": 26,
"end": 31,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 14
},
"identifierName": "spawn"
},
"name": "spawn"
},
"local": {
"type": "Identifier",
"start": 26,
"end": 31,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 14
},
"identifierName": "spawn"
},
"name": "spawn"
}
}
],
"source": {
"type": "StringLiteral",
"start": 39,
"end": 54,
"loc": {
"start": {
"line": 2,
"column": 22
},
"end": {
"line": 2,
"column": 37
}
},
"extra": {
"rawValue": "child_process",
"raw": "'child_process'"
},
"value": "child_process"
}
},
{
"type": "ImportDeclaration",
"start": 56,
"end": 80,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 24
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 63,
"end": 67,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 11
}
},
"local": {
"type": "Identifier",
"start": 63,
"end": 67,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 11
},
"identifierName": "path"
},
"name": "path"
}
}
],
"source": {
"type": "StringLiteral",
"start": 73,
"end": 79,
"loc": {
"start": {
"line": 3,
"column": 17
},
"end": {
"line": 3,
"column": 23
}
},
"extra": {
"rawValue": "path",
"raw": "'path'"
},
"value": "path"
}
},
{
"type": "ImportDeclaration",
"start": 82,
"end": 125,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 43
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 89,
"end": 97,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 15
}
},
"local": {
"type": "Identifier",
"start": 89,
"end": 97,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 15
},
"identifierName": "asyncOra"
},
"name": "asyncOra"
}
}
],
"source": {
"type": "StringLiteral",
"start": 103,
"end": 124,
"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": 126,
"end": 182,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 56
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 133,
"end": 148,
"loc": {
"start": {
"line": 6,
"column": 7
},
"end": {
"line": 6,
"column": 22
}
},
"local": {
"type": "Identifier",
"start": 133,
"end": 148,
"loc": {
"start": {
"line": 6,
"column": 7
},
"end": {
"line": 6,
"column": 22
},
"identifierName": "readPackageJSON"
},
"name": "readPackageJSON"
}
}
],
"source": {
"type": "StringLiteral",
"start": 154,
"end": 181,
"loc": {
"start": {
"line": 6,
"column": 28
},
"end": {
"line": 6,
"column": 55
}
},
"extra": {
"rawValue": "../util/read-package-json",
"raw": "'../util/read-package-json'"
},
"value": "../util/read-package-json"
}
},
{
"type": "ImportDeclaration",
"start": 183,
"end": 221,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 38
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 190,
"end": 197,
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 14
}
},
"local": {
"type": "Identifier",
"start": 190,
"end": 197,
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 14
},
"identifierName": "rebuild"
},
"name": "rebuild"
}
}
],
"source": {
"type": "StringLiteral",
"start": 203,
"end": 220,
"loc": {
"start": {
"line": 7,
"column": 20
},
"end": {
"line": 7,
"column": 37
}
},
"extra": {
"rawValue": "../util/rebuild",
"raw": "'../util/rebuild'"
},
"value": "../util/rebuild"
}
},
{
"type": "ImportDeclaration",
"start": 222,
"end": 267,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 8,
"column": 45
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 229,
"end": 239,
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 8,
"column": 17
}
},
"local": {
"type": "Identifier",
"start": 229,
"end": 239,
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 8,
"column": 17
},
"identifierName": "resolveDir"
},
"name": "resolveDir"
}
}
],
"source": {
"type": "StringLiteral",
"start": 245,
"end": 266,
"loc": {
"start": {
"line": 8,
"column": 23
},
"end": {
"line": 8,
"column": 44
}
},
"extra": {
"rawValue": "../util/resolve-dir",
"raw": "'../util/resolve-dir'"
},
"value": "../util/resolve-dir"
},
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @typedef {Object} StartOptions\n * @property {string} [dir=process.cwd()] The path to the app to be run\n * @property {boolean} [interactive=false] Whether to use sensible defaults or prompt the user visually\n * @property {boolean} [enableLogging=false] Enables advanced internal Electron debug calls\n * @property {Array<string>} [args] Arguments to pass through to the launched Electron application\n ",
"start": 269,
"end": 677,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 16,
"column": 3
}
}
},
{
"type": "CommentBlock",
"value": "*\n * Start an Electron application.\n *\n * @param {StartOptions} providedOptions - Options for the Publish method\n * @return {Promise} Will resolve when the application is launched\n ",
"start": 679,
"end": 864,
"loc": {
"start": {
"line": 18,
"column": 0
},
"end": {
"line": 23,
"column": 3
}
}
}
]
},
{
"type": "ExportDefaultDeclaration",
"start": 865,
"end": 2073,
"loc": {
"start": {
"line": 24,
"column": 0
},
"end": {
"line": 60,
"column": 2
}
},
"declaration": {
"type": "ArrowFunctionExpression",
"start": 880,
"end": 2072,
"loc": {
"start": {
"line": 24,
"column": 15
},
"end": {
"line": 60,
"column": 1
}
},
"id": null,
"generator": false,
"expression": false,
"async": true,
"params": [
{
"type": "AssignmentPattern",
"start": 887,
"end": 907,
"loc": {
"start": {
"line": 24,
"column": 22
},
"end": {
"line": 24,
"column": 42
}
},
"left": {
"type": "Identifier",
"start": 887,
"end": 902,
"loc": {
"start": {
"line": 24,
"column": 22
},
"end": {
"line": 24,
"column": 37
},
"identifierName": "providedOptions"
},
"name": "providedOptions"
},
"right": {
"type": "ObjectExpression",
"start": 905,
"end": 907,
"loc": {
"start": {
"line": 24,
"column": 40
},
"end": {
"line": 24,
"column": 42
}
},
"properties": []
}
}
],
"body": {
"type": "BlockStatement",
"start": 912,
"end": 2072,
"loc": {
"start": {
"line": 24,
"column": 47
},
"end": {
"line": 60,
"column": 1
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 975,
"end": 1149,
"loc": {
"start": {
"line": 26,
"column": 2
},
"end": {
"line": 31,
"column": 22
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 979,
"end": 1148,
"loc": {
"start": {
"line": 26,
"column": 6
},
"end": {
"line": 31,
"column": 21
}
},
"id": {
"type": "ObjectPattern",
"start": 979,
"end": 1020,
"loc": {
"start": {
"line": 26,
"column": 6
},
"end": {
"line": 26,
"column": 47
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 981,
"end": 984,
"loc": {
"start": {
"line": 26,
"column": 8
},
"end": {
"line": 26,
"column": 11
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 981,
"end": 984,
"loc": {
"start": {
"line": 26,
"column": 8
},
"end": {
"line": 26,
"column": 11
},
"identifierName": "dir"
},
"name": "dir",
"leadingComments": null
},
"value": {
"type": "Identifier",
"start": 981,
"end": 984,
"loc": {
"start": {
"line": 26,
"column": 8
},
"end": {
"line": 26,
"column": 11
},
"identifierName": "dir"
},
"name": "dir"
},
"leadingComments": null,
"extra": {
"shorthand": true
}
},
{
"type": "ObjectProperty",
"start": 986,
"end": 997,
"loc": {
"start": {
"line": 26,
"column": 13
},
"end": {
"line": 26,
"column": 24
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 986,
"end": 997,
"loc": {
"start": {
"line": 26,
"column": 13
},
"end": {
"line": 26,
"column": 24
},
"identifierName": "interactive"
},
"name": "interactive"
},
"value": {
"type": "Identifier",
"start": 986,
"end": 997,
"loc": {
"start": {
"line": 26,
"column": 13
},
"end": {
"line": 26,
"column": 24
},
"identifierName": "interactive"
},
"name": "interactive"
},
"extra": {
"shorthand": true
}
},
{
"type": "ObjectProperty",
"start": 999,
"end": 1012,
"loc": {
"start": {
"line": 26,
"column": 26
},
"end": {
"line": 26,
"column": 39
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 999,
"end": 1012,
"loc": {
"start": {
"line": 26,
"column": 26
},
"end": {
"line": 26,
"column": 39
},
"identifierName": "enableLogging"
},
"name": "enableLogging"
},
"value": {
"type": "Identifier",
"start": 999,
"end": 1012,
"loc": {
"start": {
"line": 26,
"column": 26
},
"end": {
"line": 26,
"column": 39
},
"identifierName": "enableLogging"
},
"name": "enableLogging"
},
"extra": {
"shorthand": true
}
},
{
"type": "ObjectProperty",
"start": 1014,
"end": 1018,
"loc": {
"start": {
"line": 26,
"column": 41
},
"end": {
"line": 26,
"column": 45
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 1014,
"end": 1018,
"loc": {
"start": {
"line": 26,
"column": 41
},
"end": {
"line": 26,
"column": 45
},
"identifierName": "args"
},
"name": "args"
},
"value": {
"type": "Identifier",
"start": 1014,
"end": 1018,
"loc": {
"start": {
"line": 26,
"column": 41
},
"end": {
"line": 26,
"column": 45
},
"identifierName": "args"
},
"name": "args"
},
"extra": {
"shorthand": true
}
}
],
"leadingComments": null
},
"init": {
"type": "CallExpression",
"start": 1023,
"end": 1148,
"loc": {
"start": {
"line": 26,
"column": 50
},
"end": {
"line": 31,
"column": 21
}
},
"callee": {
"type": "MemberExpression",
"start": 1023,
"end": 1036,
"loc": {
"start": {
"line": 26,
"column": 50
},
"end": {
"line": 26,
"column": 63
}
},
"object": {
"type": "Identifier",
"start": 1023,
"end": 1029,
"loc": {
"start": {
"line": 26,
"column": 50
},
"end": {
"line": 26,
"column": 56
},
"identifierName": "Object"
},
"name": "Object"
},
"property": {
"type": "Identifier",
"start": 1030,
"end": 1036,
"loc": {
"start": {
"line": 26,
"column": 57
},
"end": {
"line": 26,
"column": 63
},
"identifierName": "assign"
},
"name": "assign"
},
"computed": false
},
"arguments": [
{
"type": "ObjectExpression",
"start": 1037,
"end": 1130,
"loc": {
"start": {
"line": 26,
"column": 64
},
"end": {
"line": 31,
"column": 3
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 1043,
"end": 1061,
"loc": {
"start": {
"line": 27,
"column": 4
},
"end": {
"line": 27,
"column": 22
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 1043,
"end": 1046,
"loc": {
"start": {
"line": 27,
"column": 4
},
"end": {
"line": 27,
"column": 7
},
"identifierName": "dir"
},
"name": "dir"
},
"value": {
"type": "CallExpression",
"start": 1048,
"end": 1061,
"loc": {
"start": {
"line": 27,
"column": 9
},
"end": {
"line": 27,
"column": 22
}
},
"callee": {
"type": "MemberExpression",
"start": 1048,
"end": 1059,
"loc": {
"start": {
"line": 27,
"column": 9
},
"end": {
"line": 27,
"column": 20
}
},
"object": {
"type": "Identifier",
"start": 1048,
"end": 1055,
"loc": {
"start": {
"line": 27,
"column": 9
},
"end": {
"line": 27,
"column": 16
},
"identifierName": "process"
},
"name": "process"
},
"property": {
"type": "Identifier",
"start": 1056,
"end": 1059,
"loc": {
"start": {
"line": 27,
"column": 17
},
"end": {
"line": 27,
"column": 20
},
"identifierName": "cwd"
},
"name": "cwd"
},
"computed": false
},
"arguments": []
}
},
{
"type": "ObjectProperty",
"start": 1067,
"end": 1085,
"loc": {
"start": {
"line": 28,
"column": 4
},
"end": {
"line": 28,
"column": 22
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 1067,
"end": 1078,
"loc": {
"start": {
"line": 28,
"column": 4
},
"end": {
"line": 28,
"column": 15
},
"identifierName": "interactive"
},
"name": "interactive"
},
"value": {
"type": "BooleanLiteral",
"start": 1080,
"end": 1085,
"loc": {
"start": {
"line": 28,
"column": 17
},
"end": {
"line": 28,
"column": 22
}
},
"value": false
}
},
{
"type": "ObjectProperty",
"start": 1091,
"end": 1111,
"loc": {
"start": {
"line": 29,
"column": 4
},
"end": {
"line": 29,
"column": 24
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 1091,
"end": 1104,
"loc": {
"start": {
"line": 29,
"column": 4
},
"end": {
"line": 29,
"column": 17
},
"identifierName": "enableLogging"
},
"name": "enableLogging"
},
"value": {
"type": "BooleanLiteral",
"start": 1106,
"end": 1111,
"loc": {
"start": {
"line": 29,
"column": 19
},
"end": {
"line": 29,
"column": 24
}
},
"value": false
}
},
{
"type": "ObjectProperty",
"start": 1117,
"end": 1125,
"loc": {
"start": {
"line": 30,
"column": 4
},
"end": {
"line": 30,
"column": 12
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 1117,
"end": 1121,
"loc": {
"start": {
"line": 30,
"column": 4
},
"end": {
"line": 30,
"column": 8
},
"identifierName": "args"
},
"name": "args"
},
"value": {
"type": "ArrayExpression",
"start": 1123,
"end": 1125,
"loc": {
"start": {
"line": 30,
"column": 10
},
"end": {
"line": 30,
"column": 12
}
},
"elements": []
}
}
]
},
{
"type": "Identifier",
"start": 1132,
"end": 1147,
"loc": {
"start": {
"line": 31,
"column": 5
},
"end": {
"line": 31,
"column": 20
},
"identifierName": "providedOptions"
},
"name": "providedOptions"
}
]
},
"leadingComments": null
}
],
"kind": "let",
"leadingComments": [
{
"type": "CommentLine",
"value": " eslint-disable-next-line prefer-const, no-unused-vars",
"start": 916,
"end": 972,
"loc": {
"start": {
"line": 25,
"column": 2
},
"end": {
"line": 25,
"column": 58
}
}
}
]
},
{
"type": "ExpressionStatement",
"start": 1153,
"end": 1380,
"loc": {
"start": {
"line": 33,
"column": 2
},
"end": {
"line": 39,
"column": 5
}
},
"expression": {
"type": "AwaitExpression",
"start": 1153,
"end": 1379,
"loc": {
"start": {
"line": 33,
"column": 2
},
"end": {
"line": 39,
"column": 4
}
},
"argument": {
"type": "CallExpression",
"start": 1159,
"end": 1379,
"loc": {
"start": {
"line": 33,
"column": 8
},
"end": {
"line": 39,
"column": 4
}
},
"callee": {
"type": "Identifier",
"start": 1159,
"end": 1167,
"loc": {
"start": {
"line": 33,
"column": 8
},
"end": {
"line": 33,
"column": 16
},
"identifierName": "asyncOra"
},
"name": "asyncOra"
},
"arguments": [
{
"type": "StringLiteral",
"start": 1168,
"end": 1190,
"loc": {
"start": {
"line": 33,
"column": 17
},
"end": {
"line": 33,
"column": 39
}
},
"extra": {
"rawValue": "Locating Application",
"raw": "'Locating Application'"
},
"value": "Locating Application"
},
{
"type": "ArrowFunctionExpression",
"start": 1192,
"end": 1378,
"loc": {
"start": {
"line": 33,
"column": 41
},
"end": {
"line": 39,
"column": 3
}
},
"id": null,
"generator": false,
"expression": false,
"async": true,
"params": [],
"body": {
"type": "BlockStatement",
"start": 1204,
"end": 1378,
"loc": {
"start": {
"line": 33,
"column": 53
},
"end": {
"line": 39,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 1210,
"end": 1238,
"loc": {
"start": {
"line": 34,
"column": 4
},
"end": {
"line": 34,
"column": 32
}
},
"expression": {
"type": "AssignmentExpression",
"start": 1210,
"end": 1237,
"loc": {
"start": {
"line": 34,
"column": 4
},
"end": {
"line": 34,
"column": 31
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 1210,
"end": 1213,
"loc": {
"start": {
"line": 34,
"column": 4
},
"end": {
"line": 34,
"column": 7
},
"identifierName": "dir"
},
"name": "dir"
},
"right": {
"type": "AwaitExpression",
"start": 1216,
"end": 1237,
"loc": {
"start": {
"line": 34,
"column": 10
},
"end": {
"line": 34,
"column": 31
}
},
"argument": {
"type": "CallExpression",
"start": 1222,
"end": 1237,
"loc": {
"start": {
"line": 34,
"column": 16
},
"end": {
"line": 34,
"column": 31
}
},
"callee": {
"type": "Identifier",
"start": 1222,
"end": 1232,
"loc": {
"start": {
"line": 34,
"column": 16
},
"end": {
"line": 34,
"column": 26
},
"identifierName": "resolveDir"
},
"name": "resolveDir"
},
"arguments": [
{
"type": "Identifier",
"start": 1233,
"end": 1236,
"loc": {
"start": {
"line": 34,
"column": 27
},
"end": {
"line": 34,