@electron-forge/plugin-local-electron 6.0.0-beta.9 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -26
- package/dist/Config.d.ts +1 -0
- package/dist/Config.d.ts.map +1 -0
- package/dist/Config.js +4 -2
- package/dist/LocalElectronPlugin.d.ts +8 -4
- package/dist/LocalElectronPlugin.d.ts.map +1 -0
- package/dist/LocalElectronPlugin.js +56 -97
- package/index.ts +5 -0
- package/package.json +10 -13
- package/tsconfig.json +37 -21
- package/doc/assets/css/main.css +0 -865
- package/doc/assets/css/main.css.map +0 -7
- package/doc/assets/images/icons.png +0 -0
- package/doc/assets/images/icons@2x.png +0 -0
- package/doc/assets/images/widgets.png +0 -0
- package/doc/assets/images/widgets@2x.png +0 -0
- package/doc/assets/js/main.js +0 -5
- package/doc/assets/js/search.js +0 -3
- package/doc/classes/localelectronplugin.html +0 -328
- package/doc/globals.html +0 -168
- package/doc/index.html +0 -166
- package/doc/interfaces/localelectronpluginconfig.html +0 -266
- package/src/Config.ts +0 -32
- package/src/LocalElectronPlugin.ts +0 -57
- package/test/LocalElectronPlugin_spec.ts +0 -116
- package/tslint.json +0 -12
package/doc/index.html
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html class="default no-js">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
-
<title>@electron-forge/plugin-local-electron</title>
|
|
7
|
-
<meta name="description" content="">
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
-
<link rel="stylesheet" href="assets/css/main.css">
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<header>
|
|
13
|
-
<div class="tsd-page-toolbar">
|
|
14
|
-
<div class="container">
|
|
15
|
-
<div class="table-wrap">
|
|
16
|
-
<div class="table-cell" id="tsd-search" data-index="assets/js/search.js" data-base=".">
|
|
17
|
-
<div class="field">
|
|
18
|
-
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
|
19
|
-
<input id="tsd-search-field" type="text" />
|
|
20
|
-
</div>
|
|
21
|
-
<ul class="results">
|
|
22
|
-
<li class="state loading">Preparing search index...</li>
|
|
23
|
-
<li class="state failure">The search index is not available</li>
|
|
24
|
-
</ul>
|
|
25
|
-
<a href="index.html" class="title">@electron-forge/plugin-local-electron</a>
|
|
26
|
-
</div>
|
|
27
|
-
<div class="table-cell" id="tsd-widgets">
|
|
28
|
-
<div id="tsd-filter">
|
|
29
|
-
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
|
30
|
-
<div class="tsd-filter-group">
|
|
31
|
-
<div class="tsd-select" id="tsd-filter-visibility">
|
|
32
|
-
<span class="tsd-select-label">All</span>
|
|
33
|
-
<ul class="tsd-select-list">
|
|
34
|
-
<li data-value="public">Public</li>
|
|
35
|
-
<li data-value="protected">Public/Protected</li>
|
|
36
|
-
<li data-value="private" class="selected">All</li>
|
|
37
|
-
</ul>
|
|
38
|
-
</div>
|
|
39
|
-
<input type="checkbox" id="tsd-filter-inherited" checked />
|
|
40
|
-
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
|
41
|
-
<input type="checkbox" id="tsd-filter-only-exported" />
|
|
42
|
-
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
<div class="tsd-page-title">
|
|
51
|
-
<div class="container">
|
|
52
|
-
<ul class="tsd-breadcrumb">
|
|
53
|
-
<li>
|
|
54
|
-
<a href="globals.html">Globals</a>
|
|
55
|
-
</li>
|
|
56
|
-
</ul>
|
|
57
|
-
<h1> @electron-forge/plugin-local-electron</h1>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
</header>
|
|
61
|
-
<div class="container container-main">
|
|
62
|
-
<div class="row">
|
|
63
|
-
<div class="col-8 col-content">
|
|
64
|
-
<div class="tsd-panel tsd-typography">
|
|
65
|
-
<h1 id="local-electron">Local Electron</h1>
|
|
66
|
-
<p>ℹ️ <b>This plugin should only be used by people who are building Electron locally themselves, if you want to use a fork of Electron check out the <a href="https://github.com/electron-userland/electron-download#usage">environment variables</a> you can use to configure <code>electron-download</code>.
|
|
67
|
-
</b></p>
|
|
68
|
-
<p>This plugin allows you to both run and package/make your app using a <strong>local</strong> build of Electron, this is incredibly useful if you want to test a feature or a bugfix in your app before making a PR up to the Electron repository. If you want to set up a local build of Electron you should check out the build instructions for your platform (<a href="https://electronjs.org/docs/development/build-instructions-windows">Windows</a>, <a href="https://electronjs.org/docs/development/build-instructions-osx">macOS</a> or <a href="https://electronjs.org/docs/development/build-instructions-linux">Linux</a>).</p>
|
|
69
|
-
<h3 id="usage">Usage</h3>
|
|
70
|
-
<pre><code class="lang-javascript">{
|
|
71
|
-
<span class="hljs-attr">plugins</span>: [
|
|
72
|
-
[<span class="hljs-string">'@electron-forge/plugin-local-electron'</span>, {
|
|
73
|
-
<span class="hljs-attr">electronPath</span>: <span class="hljs-string">'/Users/me/projects/electron/out/D'</span>
|
|
74
|
-
}]
|
|
75
|
-
]
|
|
76
|
-
}
|
|
77
|
-
</code></pre>
|
|
78
|
-
<h3 id="configuration">Configuration</h3>
|
|
79
|
-
<p>All possible configuration options are documented in <a href="https://js.electronforge.io/plugin/local-electron/interfaces/localelectronpluginconfig.html"><code>LocalElectronPluginConfig</code></a>. Please note that all paths must be absolute, you should use <code>path.resolve()</code> to make things deterministic.</p>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
83
|
-
<nav class="tsd-navigation primary">
|
|
84
|
-
<ul>
|
|
85
|
-
<li class="globals ">
|
|
86
|
-
<a href="globals.html"><em>Globals</em></a>
|
|
87
|
-
</li>
|
|
88
|
-
</ul>
|
|
89
|
-
</nav>
|
|
90
|
-
<nav class="tsd-navigation secondary menu-sticky">
|
|
91
|
-
<ul class="before-current">
|
|
92
|
-
<li class=" tsd-kind-class">
|
|
93
|
-
<a href="classes/localelectronplugin.html" class="tsd-kind-icon">Local<wbr>Electron<wbr>Plugin</a>
|
|
94
|
-
</li>
|
|
95
|
-
<li class=" tsd-kind-interface">
|
|
96
|
-
<a href="interfaces/localelectronpluginconfig.html" class="tsd-kind-icon">Local<wbr>Electron<wbr>Plugin<wbr>Config</a>
|
|
97
|
-
</li>
|
|
98
|
-
</ul>
|
|
99
|
-
</nav>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
<footer>
|
|
104
|
-
<div class="container">
|
|
105
|
-
<h2>Legend</h2>
|
|
106
|
-
<div class="tsd-legend-group">
|
|
107
|
-
<ul class="tsd-legend">
|
|
108
|
-
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
|
|
109
|
-
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
|
|
110
|
-
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
|
|
111
|
-
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
|
|
112
|
-
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
|
|
113
|
-
<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
|
|
114
|
-
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
|
|
115
|
-
</ul>
|
|
116
|
-
<ul class="tsd-legend">
|
|
117
|
-
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
|
|
118
|
-
<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
|
|
119
|
-
<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
|
|
120
|
-
<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
|
|
121
|
-
</ul>
|
|
122
|
-
<ul class="tsd-legend">
|
|
123
|
-
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
|
|
124
|
-
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
|
|
125
|
-
<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
|
|
126
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
|
127
|
-
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
|
|
128
|
-
<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
|
|
129
|
-
</ul>
|
|
130
|
-
<ul class="tsd-legend">
|
|
131
|
-
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
|
|
132
|
-
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
|
|
133
|
-
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
|
|
134
|
-
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
|
|
135
|
-
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
|
|
136
|
-
<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
|
|
137
|
-
<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
|
|
138
|
-
</ul>
|
|
139
|
-
<ul class="tsd-legend">
|
|
140
|
-
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
|
|
141
|
-
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
|
|
142
|
-
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
|
|
143
|
-
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
|
|
144
|
-
</ul>
|
|
145
|
-
<ul class="tsd-legend">
|
|
146
|
-
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
|
|
147
|
-
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
|
|
148
|
-
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
|
|
149
|
-
</ul>
|
|
150
|
-
<ul class="tsd-legend">
|
|
151
|
-
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
|
|
152
|
-
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
|
|
153
|
-
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
|
|
154
|
-
</ul>
|
|
155
|
-
<ul class="tsd-legend">
|
|
156
|
-
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
|
|
157
|
-
<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
|
|
158
|
-
</ul>
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
</footer>
|
|
162
|
-
<div class="overlay"></div>
|
|
163
|
-
<script src="assets/js/main.js"></script>
|
|
164
|
-
<script>if (location.protocol == 'file:') document.write('<script src="assets/js/search.js"><' + '/script>');</script>
|
|
165
|
-
</body>
|
|
166
|
-
</html>
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html class="default no-js">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
-
<title>LocalElectronPluginConfig | @electron-forge/plugin-local-electron</title>
|
|
7
|
-
<meta name="description" content="">
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
-
<link rel="stylesheet" href="../assets/css/main.css">
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<header>
|
|
13
|
-
<div class="tsd-page-toolbar">
|
|
14
|
-
<div class="container">
|
|
15
|
-
<div class="table-wrap">
|
|
16
|
-
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
|
|
17
|
-
<div class="field">
|
|
18
|
-
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
|
19
|
-
<input id="tsd-search-field" type="text" />
|
|
20
|
-
</div>
|
|
21
|
-
<ul class="results">
|
|
22
|
-
<li class="state loading">Preparing search index...</li>
|
|
23
|
-
<li class="state failure">The search index is not available</li>
|
|
24
|
-
</ul>
|
|
25
|
-
<a href="../index.html" class="title">@electron-forge/plugin-local-electron</a>
|
|
26
|
-
</div>
|
|
27
|
-
<div class="table-cell" id="tsd-widgets">
|
|
28
|
-
<div id="tsd-filter">
|
|
29
|
-
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
|
30
|
-
<div class="tsd-filter-group">
|
|
31
|
-
<div class="tsd-select" id="tsd-filter-visibility">
|
|
32
|
-
<span class="tsd-select-label">All</span>
|
|
33
|
-
<ul class="tsd-select-list">
|
|
34
|
-
<li data-value="public">Public</li>
|
|
35
|
-
<li data-value="protected">Public/Protected</li>
|
|
36
|
-
<li data-value="private" class="selected">All</li>
|
|
37
|
-
</ul>
|
|
38
|
-
</div>
|
|
39
|
-
<input type="checkbox" id="tsd-filter-inherited" checked />
|
|
40
|
-
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
|
41
|
-
<input type="checkbox" id="tsd-filter-only-exported" />
|
|
42
|
-
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
<div class="tsd-page-title">
|
|
51
|
-
<div class="container">
|
|
52
|
-
<ul class="tsd-breadcrumb">
|
|
53
|
-
<li>
|
|
54
|
-
<a href="../globals.html">Globals</a>
|
|
55
|
-
</li>
|
|
56
|
-
<li>
|
|
57
|
-
<a href="localelectronpluginconfig.html">LocalElectronPluginConfig</a>
|
|
58
|
-
</li>
|
|
59
|
-
</ul>
|
|
60
|
-
<h1>Interface LocalElectronPluginConfig</h1>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
</header>
|
|
64
|
-
<div class="container container-main">
|
|
65
|
-
<div class="row">
|
|
66
|
-
<div class="col-8 col-content">
|
|
67
|
-
<section class="tsd-panel tsd-hierarchy">
|
|
68
|
-
<h3>Hierarchy</h3>
|
|
69
|
-
<ul class="tsd-hierarchy">
|
|
70
|
-
<li>
|
|
71
|
-
<span class="target">LocalElectronPluginConfig</span>
|
|
72
|
-
</li>
|
|
73
|
-
</ul>
|
|
74
|
-
</section>
|
|
75
|
-
<section class="tsd-panel-group tsd-index-group">
|
|
76
|
-
<h2>Index</h2>
|
|
77
|
-
<section class="tsd-panel tsd-index-panel">
|
|
78
|
-
<div class="tsd-index-content">
|
|
79
|
-
<section class="tsd-index-section ">
|
|
80
|
-
<h3>Properties</h3>
|
|
81
|
-
<ul class="tsd-index-list">
|
|
82
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="localelectronpluginconfig.html#electronarch" class="tsd-kind-icon">electron<wbr>Arch</a></li>
|
|
83
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="localelectronpluginconfig.html#electronpath" class="tsd-kind-icon">electron<wbr>Path</a></li>
|
|
84
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="localelectronpluginconfig.html#electronplatform" class="tsd-kind-icon">electron<wbr>Platform</a></li>
|
|
85
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="localelectronpluginconfig.html#enabled" class="tsd-kind-icon">enabled</a></li>
|
|
86
|
-
</ul>
|
|
87
|
-
</section>
|
|
88
|
-
</div>
|
|
89
|
-
</section>
|
|
90
|
-
</section>
|
|
91
|
-
<section class="tsd-panel-group tsd-member-group ">
|
|
92
|
-
<h2>Properties</h2>
|
|
93
|
-
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
94
|
-
<a name="electronarch" class="tsd-anchor"></a>
|
|
95
|
-
<h3><span class="tsd-flag ts-flagOptional">Optional</span> electron<wbr>Arch</h3>
|
|
96
|
-
<div class="tsd-signature tsd-kind-icon">electron<wbr>Arch<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></div>
|
|
97
|
-
<aside class="tsd-sources">
|
|
98
|
-
<ul>
|
|
99
|
-
<li>Defined in <a href="https://github.com/electron-userland/electron-forge/blob/ab64142/packages/plugin/local-electron/src/Config.ts#L31">Config.ts:31</a></li>
|
|
100
|
-
</ul>
|
|
101
|
-
</aside>
|
|
102
|
-
<div class="tsd-comment tsd-typography">
|
|
103
|
-
<div class="lead">
|
|
104
|
-
<p>The arch your local build of Electron is for. You only need to set this if
|
|
105
|
-
you have a local build for an arch that isn't your system's arch.</p>
|
|
106
|
-
</div>
|
|
107
|
-
<p>Default: process.arch</p>
|
|
108
|
-
</div>
|
|
109
|
-
</section>
|
|
110
|
-
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
111
|
-
<a name="electronpath" class="tsd-anchor"></a>
|
|
112
|
-
<h3>electron<wbr>Path</h3>
|
|
113
|
-
<div class="tsd-signature tsd-kind-icon">electron<wbr>Path<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
114
|
-
<aside class="tsd-sources">
|
|
115
|
-
<ul>
|
|
116
|
-
<li>Defined in <a href="https://github.com/electron-userland/electron-forge/blob/ab64142/packages/plugin/local-electron/src/Config.ts#L16">Config.ts:16</a></li>
|
|
117
|
-
</ul>
|
|
118
|
-
</aside>
|
|
119
|
-
<div class="tsd-comment tsd-typography">
|
|
120
|
-
<div class="lead">
|
|
121
|
-
<p>An absolute path to the folder containing your built version of Electron.</p>
|
|
122
|
-
</div>
|
|
123
|
-
<p>Normally this looks like <code>/path/to/electron/out/D</code></p>
|
|
124
|
-
</div>
|
|
125
|
-
</section>
|
|
126
|
-
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
127
|
-
<a name="electronplatform" class="tsd-anchor"></a>
|
|
128
|
-
<h3><span class="tsd-flag ts-flagOptional">Optional</span> electron<wbr>Platform</h3>
|
|
129
|
-
<div class="tsd-signature tsd-kind-icon">electron<wbr>Platform<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></div>
|
|
130
|
-
<aside class="tsd-sources">
|
|
131
|
-
<ul>
|
|
132
|
-
<li>Defined in <a href="https://github.com/electron-userland/electron-forge/blob/ab64142/packages/plugin/local-electron/src/Config.ts#L24">Config.ts:24</a></li>
|
|
133
|
-
</ul>
|
|
134
|
-
</aside>
|
|
135
|
-
<div class="tsd-comment tsd-typography">
|
|
136
|
-
<div class="lead">
|
|
137
|
-
<p>The platform your local build of Electron is for. You only need to set
|
|
138
|
-
this if you have a local build for a platform that isn't your system's
|
|
139
|
-
platform.</p>
|
|
140
|
-
</div>
|
|
141
|
-
<p>Default: process.platform</p>
|
|
142
|
-
</div>
|
|
143
|
-
</section>
|
|
144
|
-
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
145
|
-
<a name="enabled" class="tsd-anchor"></a>
|
|
146
|
-
<h3><span class="tsd-flag ts-flagOptional">Optional</span> enabled</h3>
|
|
147
|
-
<div class="tsd-signature tsd-kind-icon">enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">true</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">false</span></div>
|
|
148
|
-
<aside class="tsd-sources">
|
|
149
|
-
<ul>
|
|
150
|
-
<li>Defined in <a href="https://github.com/electron-userland/electron-forge/blob/ab64142/packages/plugin/local-electron/src/Config.ts#L10">Config.ts:10</a></li>
|
|
151
|
-
</ul>
|
|
152
|
-
</aside>
|
|
153
|
-
<div class="tsd-comment tsd-typography">
|
|
154
|
-
<div class="lead">
|
|
155
|
-
<p>Whether or not the plugin is enabled.</p>
|
|
156
|
-
</div>
|
|
157
|
-
<p>Can be handy to set this to an environment variable for quick personal
|
|
158
|
-
toggling of this plugin.</p>
|
|
159
|
-
<p>Default: <code>true</code></p>
|
|
160
|
-
</div>
|
|
161
|
-
</section>
|
|
162
|
-
</section>
|
|
163
|
-
</div>
|
|
164
|
-
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
165
|
-
<nav class="tsd-navigation primary">
|
|
166
|
-
<ul>
|
|
167
|
-
<li class="globals ">
|
|
168
|
-
<a href="../globals.html"><em>Globals</em></a>
|
|
169
|
-
</li>
|
|
170
|
-
</ul>
|
|
171
|
-
</nav>
|
|
172
|
-
<nav class="tsd-navigation secondary menu-sticky">
|
|
173
|
-
<ul class="before-current">
|
|
174
|
-
<li class=" tsd-kind-class">
|
|
175
|
-
<a href="../classes/localelectronplugin.html" class="tsd-kind-icon">Local<wbr>Electron<wbr>Plugin</a>
|
|
176
|
-
</li>
|
|
177
|
-
</ul>
|
|
178
|
-
<ul class="current">
|
|
179
|
-
<li class="current tsd-kind-interface">
|
|
180
|
-
<a href="localelectronpluginconfig.html" class="tsd-kind-icon">Local<wbr>Electron<wbr>Plugin<wbr>Config</a>
|
|
181
|
-
<ul>
|
|
182
|
-
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
183
|
-
<a href="localelectronpluginconfig.html#electronarch" class="tsd-kind-icon">electron<wbr>Arch</a>
|
|
184
|
-
</li>
|
|
185
|
-
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
186
|
-
<a href="localelectronpluginconfig.html#electronpath" class="tsd-kind-icon">electron<wbr>Path</a>
|
|
187
|
-
</li>
|
|
188
|
-
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
189
|
-
<a href="localelectronpluginconfig.html#electronplatform" class="tsd-kind-icon">electron<wbr>Platform</a>
|
|
190
|
-
</li>
|
|
191
|
-
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
192
|
-
<a href="localelectronpluginconfig.html#enabled" class="tsd-kind-icon">enabled</a>
|
|
193
|
-
</li>
|
|
194
|
-
</ul>
|
|
195
|
-
</li>
|
|
196
|
-
</ul>
|
|
197
|
-
<ul class="after-current">
|
|
198
|
-
</ul>
|
|
199
|
-
</nav>
|
|
200
|
-
</div>
|
|
201
|
-
</div>
|
|
202
|
-
</div>
|
|
203
|
-
<footer>
|
|
204
|
-
<div class="container">
|
|
205
|
-
<h2>Legend</h2>
|
|
206
|
-
<div class="tsd-legend-group">
|
|
207
|
-
<ul class="tsd-legend">
|
|
208
|
-
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
|
|
209
|
-
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
|
|
210
|
-
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
|
|
211
|
-
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
|
|
212
|
-
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
|
|
213
|
-
<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
|
|
214
|
-
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
|
|
215
|
-
</ul>
|
|
216
|
-
<ul class="tsd-legend">
|
|
217
|
-
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
|
|
218
|
-
<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
|
|
219
|
-
<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
|
|
220
|
-
<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
|
|
221
|
-
</ul>
|
|
222
|
-
<ul class="tsd-legend">
|
|
223
|
-
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
|
|
224
|
-
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
|
|
225
|
-
<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
|
|
226
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
|
227
|
-
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
|
|
228
|
-
<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
|
|
229
|
-
</ul>
|
|
230
|
-
<ul class="tsd-legend">
|
|
231
|
-
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
|
|
232
|
-
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
|
|
233
|
-
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
|
|
234
|
-
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
|
|
235
|
-
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
|
|
236
|
-
<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
|
|
237
|
-
<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
|
|
238
|
-
</ul>
|
|
239
|
-
<ul class="tsd-legend">
|
|
240
|
-
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
|
|
241
|
-
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
|
|
242
|
-
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
|
|
243
|
-
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
|
|
244
|
-
</ul>
|
|
245
|
-
<ul class="tsd-legend">
|
|
246
|
-
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
|
|
247
|
-
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
|
|
248
|
-
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
|
|
249
|
-
</ul>
|
|
250
|
-
<ul class="tsd-legend">
|
|
251
|
-
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
|
|
252
|
-
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
|
|
253
|
-
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
|
|
254
|
-
</ul>
|
|
255
|
-
<ul class="tsd-legend">
|
|
256
|
-
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
|
|
257
|
-
<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
|
|
258
|
-
</ul>
|
|
259
|
-
</div>
|
|
260
|
-
</div>
|
|
261
|
-
</footer>
|
|
262
|
-
<div class="overlay"></div>
|
|
263
|
-
<script src="../assets/js/main.js"></script>
|
|
264
|
-
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
|
|
265
|
-
</body>
|
|
266
|
-
</html>
|
package/src/Config.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export interface LocalElectronPluginConfig {
|
|
2
|
-
/**
|
|
3
|
-
* Whether or not the plugin is enabled.
|
|
4
|
-
*
|
|
5
|
-
* Can be handy to set this to an environment variable for quick personal
|
|
6
|
-
* toggling of this plugin.
|
|
7
|
-
*
|
|
8
|
-
* Default: `true`
|
|
9
|
-
*/
|
|
10
|
-
enabled?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* An absolute path to the folder containing your built version of Electron.
|
|
13
|
-
*
|
|
14
|
-
* Normally this looks like `/path/to/electron/out/D`
|
|
15
|
-
*/
|
|
16
|
-
electronPath: string;
|
|
17
|
-
/**
|
|
18
|
-
* The platform your local build of Electron is for. You only need to set
|
|
19
|
-
* this if you have a local build for a platform that isn't your system's
|
|
20
|
-
* platform.
|
|
21
|
-
*
|
|
22
|
-
* Default: process.platform
|
|
23
|
-
*/
|
|
24
|
-
electronPlatform?: string;
|
|
25
|
-
/**
|
|
26
|
-
* The arch your local build of Electron is for. You only need to set this if
|
|
27
|
-
* you have a local build for an arch that isn't your system's arch.
|
|
28
|
-
*
|
|
29
|
-
* Default: process.arch
|
|
30
|
-
*/
|
|
31
|
-
electronArch?: string;
|
|
32
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import PluginBase from '@electron-forge/plugin-base';
|
|
2
|
-
import { spawn } from 'child_process';
|
|
3
|
-
import fs from 'fs-extra';
|
|
4
|
-
|
|
5
|
-
import { LocalElectronPluginConfig } from './Config';
|
|
6
|
-
|
|
7
|
-
export default class LocalElectronPlugin extends PluginBase<LocalElectronPluginConfig> {
|
|
8
|
-
name = 'local-electron';
|
|
9
|
-
|
|
10
|
-
constructor(config: LocalElectronPluginConfig) {
|
|
11
|
-
super(config);
|
|
12
|
-
if (typeof this.config.enabled === 'undefined') {
|
|
13
|
-
this.config = {
|
|
14
|
-
...this.config,
|
|
15
|
-
enabled: true,
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async startLogic() {
|
|
21
|
-
if (this.config.enabled) {
|
|
22
|
-
this.checkPlatform(process.platform);
|
|
23
|
-
process.env.ELECTRON_OVERRIDE_DIST_PATH = this.config.electronPath;
|
|
24
|
-
}
|
|
25
|
-
return false as any;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
getHook(hookName: string) {
|
|
29
|
-
if (hookName === 'packageAfterExtract') {
|
|
30
|
-
return this.afterExtract;
|
|
31
|
-
}
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
private checkPlatform = (platform: string) => {
|
|
36
|
-
if ((this.config.electronPlatform || process.platform) !== platform) {
|
|
37
|
-
throw `Can not use local Electron version, required platform "${platform}" but local platform is "${this.config.electronPlatform || process.platform}"`;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
private checkArch = (arch: string) => {
|
|
42
|
-
if ((this.config.electronArch || process.arch) !== arch) {
|
|
43
|
-
throw `Can not use local Electron version, required arch "${arch}" but local arch is "${this.config.electronArch || process.arch}"`;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
private afterExtract = async (_: any, buildPath: string, __: any, platform: string, arch: string) => {
|
|
48
|
-
if (!this.config.enabled) return;
|
|
49
|
-
|
|
50
|
-
this.checkPlatform(platform);
|
|
51
|
-
this.checkArch(arch);
|
|
52
|
-
|
|
53
|
-
await fs.remove(buildPath);
|
|
54
|
-
|
|
55
|
-
await fs.copy(this.config.electronPath, buildPath);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { expect } from 'chai';
|
|
2
|
-
import fs from 'fs-extra';
|
|
3
|
-
import os from 'os';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
|
|
6
|
-
import LocalElectronPlugin from '../src/LocalElectronPlugin';
|
|
7
|
-
|
|
8
|
-
describe('LocalElectronPlugin', () => {
|
|
9
|
-
describe('start logic', () => {
|
|
10
|
-
before(() => {
|
|
11
|
-
delete process.env.ELECTRON_OVERRIDE_DIST_PATH;
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
afterEach(() => {
|
|
15
|
-
delete process.env.ELECTRON_OVERRIDE_DIST_PATH;
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should set ELECTRON_OVERRIDE_DIST_PATH when enabled', async () => {
|
|
19
|
-
expect(process.env.ELECTRON_OVERRIDE_DIST_PATH).to.equal(undefined);
|
|
20
|
-
const p = new LocalElectronPlugin({ electronPath: 'test/foo' });
|
|
21
|
-
await p.startLogic();
|
|
22
|
-
expect(process.env.ELECTRON_OVERRIDE_DIST_PATH).to.equal('test/foo');
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should not set ELECTRON_OVERRIDE_DIST_PATH when disabled', async () => {
|
|
26
|
-
expect(process.env.ELECTRON_OVERRIDE_DIST_PATH).to.equal(undefined);
|
|
27
|
-
const p = new LocalElectronPlugin({ enabled: false, electronPath: 'test/foo' });
|
|
28
|
-
await p.startLogic();
|
|
29
|
-
expect(process.env.ELECTRON_OVERRIDE_DIST_PATH).to.equal(undefined);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('should throw an error if platforms don\'t match', async () => {
|
|
33
|
-
const p = new LocalElectronPlugin({ electronPath: 'test/bar', electronPlatform: 'wut' });
|
|
34
|
-
await expect(p.startLogic()).to.eventually.be.rejectedWith(
|
|
35
|
-
`Can not use local Electron version, required platform "${process.platform}" but local platform is "wut"`,
|
|
36
|
-
);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('should always return false', async () => {
|
|
40
|
-
let p = new LocalElectronPlugin({ electronPath: 'test/bar' });
|
|
41
|
-
expect(await p.startLogic()).to.equal(false);
|
|
42
|
-
|
|
43
|
-
p = new LocalElectronPlugin({ enabled: false, electronPath: 'test/bar' });
|
|
44
|
-
expect(await p.startLogic()).to.equal(false);
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
describe('hooks', () => {
|
|
49
|
-
let p: LocalElectronPlugin;
|
|
50
|
-
|
|
51
|
-
beforeEach(() => {
|
|
52
|
-
p = new LocalElectronPlugin({ electronPath: 'test/foo' });
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('should return for all other hooks', () => {
|
|
56
|
-
expect(p.getHook('prePackage')).to.equal(null);
|
|
57
|
-
expect(p.getHook('postMake')).to.equal(null);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
describe('with afterExtract hook', () => {
|
|
61
|
-
let tmpDir: string;
|
|
62
|
-
|
|
63
|
-
beforeEach(async () => {
|
|
64
|
-
tmpDir = await fs.mkdtemp(path.resolve(os.tmpdir(), 'forge-test-'));
|
|
65
|
-
await fs.writeFile(path.resolve(tmpDir, 'touch'), 'hey');
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
afterEach(() => {
|
|
69
|
-
return fs.remove(tmpDir);
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('should return a function for packageAfterExtract', () => {
|
|
73
|
-
expect(p.getHook('packageAfterExtract')).to.be.a('function');
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('should do nothing when disabled', async () => {
|
|
77
|
-
p.config.enabled = false;
|
|
78
|
-
const fn = p.getHook('packageAfterExtract')!;
|
|
79
|
-
|
|
80
|
-
await fn(null, tmpDir, null, process.platform, process.arch);
|
|
81
|
-
|
|
82
|
-
expect(await fs.pathExists(tmpDir)).to.equal(true);
|
|
83
|
-
expect(await fs.pathExists(path.resolve(tmpDir, 'touch'))).to.equal(true);
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
it('should throw an error if the platform doesn\'t match', async () => {
|
|
87
|
-
const fn = p.getHook('packageAfterExtract')!;
|
|
88
|
-
|
|
89
|
-
await expect(fn(null, tmpDir, null, 'bad', process.arch)).to.eventually.be.rejectedWith(
|
|
90
|
-
`Can not use local Electron version, required platform "bad" but local platform is "${process.platform}"`,
|
|
91
|
-
);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('should throw an error if the arch doesn\'t match', async () => {
|
|
95
|
-
const fn = p.getHook('packageAfterExtract')!;
|
|
96
|
-
|
|
97
|
-
await expect(fn(null, tmpDir, null, process.platform, 'bad')).to.eventually.be.rejectedWith(
|
|
98
|
-
`Can not use local Electron version, required arch "bad" but local arch is "${process.arch}"`,
|
|
99
|
-
);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
it('should copy the electron dir to the build dir if everything is ok and enabled', async () => {
|
|
103
|
-
const electronDir = await fs.mkdtemp(path.resolve(os.tmpdir(), 'electron-tmp-'));
|
|
104
|
-
await fs.writeFile(path.resolve(electronDir, 'electron'), 'hi i am electron I swear');
|
|
105
|
-
p.config.electronPath = electronDir;
|
|
106
|
-
const fn = p.getHook('packageAfterExtract')!;
|
|
107
|
-
|
|
108
|
-
await fn(null, tmpDir, null, process.platform, process.arch);
|
|
109
|
-
|
|
110
|
-
expect(await fs.pathExists(path.resolve(tmpDir, 'touch'))).to.equal(false);
|
|
111
|
-
expect(await fs.pathExists(path.resolve(tmpDir, 'electron'))).to.equal(true);
|
|
112
|
-
expect(await fs.readFile(path.resolve(tmpDir, 'electron'), 'utf8')).to.equal('hi i am electron I swear');
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
});
|