electrify-web 1.0.0
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/LICENSE.md +10 -0
- package/README.md +351 -0
- package/app/inject/_placeholder +0 -0
- package/app/lib/main.js +11772 -0
- package/app/lib/main.js.map +1 -0
- package/app/lib/preload.js +338 -0
- package/app/lib/preload.js.map +1 -0
- package/app/lib/static/login.css +57 -0
- package/app/lib/static/login.html +24 -0
- package/app/lib/static/login.js +10 -0
- package/app/nativefier.json +8 -0
- package/app/npm-shrinkwrap.json +1170 -0
- package/app/package.json +25 -0
- package/icon-scripts/convertToIcns +56 -0
- package/icon-scripts/convertToIco +39 -0
- package/icon-scripts/convertToIconset +68 -0
- package/icon-scripts/convertToPng +76 -0
- package/icon-scripts/convertToTrayIcon +32 -0
- package/lib/autologin/index.d.ts +25 -0
- package/lib/autologin/index.js +189 -0
- package/lib/autologin/index.js.map +1 -0
- package/lib/build/buildIcon.d.ts +6 -0
- package/lib/build/buildIcon.js +110 -0
- package/lib/build/buildIcon.js.map +1 -0
- package/lib/build/buildNativefierApp.d.ts +2 -0
- package/lib/build/buildNativefierApp.js +234 -0
- package/lib/build/buildNativefierApp.js.map +1 -0
- package/lib/build/prepareElectronApp.d.ts +15 -0
- package/lib/build/prepareElectronApp.js +220 -0
- package/lib/build/prepareElectronApp.js.map +1 -0
- package/lib/cli.d.ts +6 -0
- package/lib/cli.js +783 -0
- package/lib/cli.js.map +1 -0
- package/lib/config/index.d.ts +87 -0
- package/lib/config/index.js +460 -0
- package/lib/config/index.js.map +1 -0
- package/lib/constants.d.ts +11 -0
- package/lib/constants.js +58 -0
- package/lib/constants.js.map +1 -0
- package/lib/helpers/fsHelpers.d.ts +2 -0
- package/lib/helpers/fsHelpers.js +57 -0
- package/lib/helpers/fsHelpers.js.map +1 -0
- package/lib/helpers/helpers.d.ts +29 -0
- package/lib/helpers/helpers.js +225 -0
- package/lib/helpers/helpers.js.map +1 -0
- package/lib/helpers/iconShellHelpers.d.ts +5 -0
- package/lib/helpers/iconShellHelpers.js +91 -0
- package/lib/helpers/iconShellHelpers.js.map +1 -0
- package/lib/helpers/upgrade/executableHelpers.d.ts +2 -0
- package/lib/helpers/upgrade/executableHelpers.js +173 -0
- package/lib/helpers/upgrade/executableHelpers.js.map +1 -0
- package/lib/helpers/upgrade/plistInfoXMLHelpers.d.ts +2 -0
- package/lib/helpers/upgrade/plistInfoXMLHelpers.js +29 -0
- package/lib/helpers/upgrade/plistInfoXMLHelpers.js.map +1 -0
- package/lib/helpers/upgrade/rceditGet.d.ts +1 -0
- package/lib/helpers/upgrade/rceditGet.js +65 -0
- package/lib/helpers/upgrade/rceditGet.js.map +1 -0
- package/lib/helpers/upgrade/upgrade.d.ts +8 -0
- package/lib/helpers/upgrade/upgrade.js +193 -0
- package/lib/helpers/upgrade/upgrade.js.map +1 -0
- package/lib/infer/browsers/inferChromeVersion.d.ts +1 -0
- package/lib/infer/browsers/inferChromeVersion.js +73 -0
- package/lib/infer/browsers/inferChromeVersion.js.map +1 -0
- package/lib/infer/browsers/inferFirefoxVersion.d.ts +1 -0
- package/lib/infer/browsers/inferFirefoxVersion.js +61 -0
- package/lib/infer/browsers/inferFirefoxVersion.js.map +1 -0
- package/lib/infer/browsers/inferSafariVersion.d.ts +6 -0
- package/lib/infer/browsers/inferSafariVersion.js +96 -0
- package/lib/infer/browsers/inferSafariVersion.js.map +1 -0
- package/lib/infer/inferDefaults.d.ts +33 -0
- package/lib/infer/inferDefaults.js +272 -0
- package/lib/infer/inferDefaults.js.map +1 -0
- package/lib/infer/inferIcon.d.ts +1 -0
- package/lib/infer/inferIcon.js +116 -0
- package/lib/infer/inferIcon.js.map +1 -0
- package/lib/infer/inferOs.d.ts +4 -0
- package/lib/infer/inferOs.js +69 -0
- package/lib/infer/inferOs.js.map +1 -0
- package/lib/infer/inferTitle.d.ts +1 -0
- package/lib/infer/inferTitle.js +56 -0
- package/lib/infer/inferTitle.js.map +1 -0
- package/lib/integration-test.d.ts +1 -0
- package/lib/main.d.ts +11 -0
- package/lib/main.js +18 -0
- package/lib/main.js.map +1 -0
- package/lib/options/asyncConfig.d.ts +5 -0
- package/lib/options/asyncConfig.js +46 -0
- package/lib/options/asyncConfig.js.map +1 -0
- package/lib/options/fields/fields.d.ts +2 -0
- package/lib/options/fields/fields.js +32 -0
- package/lib/options/fields/fields.js.map +1 -0
- package/lib/options/fields/icon.d.ts +9 -0
- package/lib/options/fields/icon.js +106 -0
- package/lib/options/fields/icon.js.map +1 -0
- package/lib/options/fields/name.d.ts +9 -0
- package/lib/options/fields/name.js +59 -0
- package/lib/options/fields/name.js.map +1 -0
- package/lib/options/fields/userAgent.d.ts +10 -0
- package/lib/options/fields/userAgent.js +81 -0
- package/lib/options/fields/userAgent.js.map +1 -0
- package/lib/options/normalizeUrl.d.ts +1 -0
- package/lib/options/normalizeUrl.js +62 -0
- package/lib/options/normalizeUrl.js.map +1 -0
- package/lib/options/optionsMain.d.ts +6 -0
- package/lib/options/optionsMain.js +305 -0
- package/lib/options/optionsMain.js.map +1 -0
- package/lib/presets/index.d.ts +27 -0
- package/lib/presets/index.js +162 -0
- package/lib/presets/index.js.map +1 -0
- package/lib/pwa/index.d.ts +57 -0
- package/lib/pwa/index.js +241 -0
- package/lib/pwa/index.js.map +1 -0
- package/lib/security/index.d.ts +27 -0
- package/lib/security/index.js +202 -0
- package/lib/security/index.js.map +1 -0
- package/lib/updater/index.d.ts +34 -0
- package/lib/updater/index.js +264 -0
- package/lib/updater/index.js.map +1 -0
- package/lib/utils/parseUtils.d.ts +3 -0
- package/lib/utils/parseUtils.js +95 -0
- package/lib/utils/parseUtils.js.map +1 -0
- package/lib/utils/sanitizeFilename.d.ts +1 -0
- package/lib/utils/sanitizeFilename.js +53 -0
- package/lib/utils/sanitizeFilename.js.map +1 -0
- package/lib/wizard/index.d.ts +13 -0
- package/lib/wizard/index.js +252 -0
- package/lib/wizard/index.js.map +1 -0
- package/npm-shrinkwrap.json +8144 -0
- package/package.json +148 -0
package/lib/cli.js
ADDED
|
@@ -0,0 +1,783 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.initArgs = initArgs;
|
|
41
|
+
exports.parseArgs = parseArgs;
|
|
42
|
+
require("source-map-support/register");
|
|
43
|
+
const fs = __importStar(require("fs"));
|
|
44
|
+
const log = __importStar(require("loglevel"));
|
|
45
|
+
const yargs_1 = __importDefault(require("yargs"));
|
|
46
|
+
const constants_1 = require("./constants");
|
|
47
|
+
const helpers_1 = require("./helpers/helpers");
|
|
48
|
+
const inferOs_1 = require("./infer/inferOs");
|
|
49
|
+
const main_1 = require("./main");
|
|
50
|
+
const parseUtils_1 = require("./utils/parseUtils");
|
|
51
|
+
const presets_1 = require("./presets");
|
|
52
|
+
const config_1 = require("./config");
|
|
53
|
+
const wizard_1 = require("./wizard");
|
|
54
|
+
const security_1 = require("./security");
|
|
55
|
+
function initArgs(argv) {
|
|
56
|
+
const sanitizedArgs = sanitizeArgs(argv);
|
|
57
|
+
const args = (0, yargs_1.default)(sanitizedArgs)
|
|
58
|
+
.scriptName('electrify')
|
|
59
|
+
.usage('$0 <targetUrl> [outputDirectory] [options]\n\n' +
|
|
60
|
+
'Commands:\n' +
|
|
61
|
+
' $0 wizard Interactive setup wizard\n' +
|
|
62
|
+
' $0 init Generate config file template\n' +
|
|
63
|
+
' $0 build Build from config file\n' +
|
|
64
|
+
' $0 presets List available presets\n' +
|
|
65
|
+
' $0 doctor Check system environment\n' +
|
|
66
|
+
' $0 <url> Quick build from URL')
|
|
67
|
+
.example('$0 wizard', 'Start interactive wizard for guided setup')
|
|
68
|
+
.example('$0 https://example.com', 'Quick build with auto-detected settings')
|
|
69
|
+
.example('$0 https://example.com --preset social', 'Build with social media preset')
|
|
70
|
+
.example('$0 build', 'Build from electrify.config.yaml in current directory')
|
|
71
|
+
.example('$0 --config ./my-config.yaml', 'Build from specified config file')
|
|
72
|
+
.positional('targetUrl', {
|
|
73
|
+
description: 'the URL that you wish to to turn into a native app; required if not using --upgrade',
|
|
74
|
+
type: 'string',
|
|
75
|
+
})
|
|
76
|
+
.positional('outputDirectory', {
|
|
77
|
+
defaultDescription: 'defaults to the current directory, or env. var. NATIVEFIER_APPS_DIR if set',
|
|
78
|
+
description: 'the directory to generate the app in',
|
|
79
|
+
normalize: true,
|
|
80
|
+
type: 'string',
|
|
81
|
+
})
|
|
82
|
+
// New Options
|
|
83
|
+
.option('config', {
|
|
84
|
+
description: 'path to config file (YAML or JSON)',
|
|
85
|
+
normalize: true,
|
|
86
|
+
type: 'string',
|
|
87
|
+
})
|
|
88
|
+
.option('preset', {
|
|
89
|
+
description: 'use a preset configuration (social, productivity, media, email, developer, minimal, secure, kiosk)',
|
|
90
|
+
type: 'string',
|
|
91
|
+
})
|
|
92
|
+
.option('pwa', {
|
|
93
|
+
description: 'auto-detect PWA manifest and use its settings (name, icon, colors)',
|
|
94
|
+
type: 'boolean',
|
|
95
|
+
default: false,
|
|
96
|
+
})
|
|
97
|
+
.option('auto-update', {
|
|
98
|
+
description: 'enable auto-update (github:owner/repo or update server URL)',
|
|
99
|
+
type: 'string',
|
|
100
|
+
})
|
|
101
|
+
.group(['config', 'preset', 'pwa', 'auto-update'], decorateYargOptionGroup('Quick Start Options'))
|
|
102
|
+
// App Creation Options
|
|
103
|
+
.option('a', {
|
|
104
|
+
alias: 'arch',
|
|
105
|
+
choices: inferOs_1.supportedArchs,
|
|
106
|
+
defaultDescription: "current Node's arch",
|
|
107
|
+
description: 'the CPU architecture to build for',
|
|
108
|
+
type: 'string',
|
|
109
|
+
})
|
|
110
|
+
.option('c', {
|
|
111
|
+
alias: 'conceal',
|
|
112
|
+
default: false,
|
|
113
|
+
description: 'package the app source code into an asar archive',
|
|
114
|
+
type: 'boolean',
|
|
115
|
+
})
|
|
116
|
+
.option('e', {
|
|
117
|
+
alias: 'electron-version',
|
|
118
|
+
defaultDescription: constants_1.DEFAULT_ELECTRON_VERSION,
|
|
119
|
+
description: "specify the electron version to use (without the 'v'); see https://github.com/electron/electron/releases",
|
|
120
|
+
})
|
|
121
|
+
.option('global-shortcuts', {
|
|
122
|
+
description: 'define global keyboard shortcuts via a JSON file; See https://github.com/nativefier/nativefier/blob/master/API.md#global-shortcuts',
|
|
123
|
+
normalize: true,
|
|
124
|
+
type: 'string',
|
|
125
|
+
})
|
|
126
|
+
.option('i', {
|
|
127
|
+
alias: 'icon',
|
|
128
|
+
description: 'the icon file to use as the icon for the app (.ico on Windows, .icns/.png on macOS, .png on Linux). Supports local paths or URLs.',
|
|
129
|
+
type: 'string',
|
|
130
|
+
})
|
|
131
|
+
.option('n', {
|
|
132
|
+
alias: 'name',
|
|
133
|
+
defaultDescription: 'the title of the page passed via targetUrl',
|
|
134
|
+
description: 'specify the name of the app',
|
|
135
|
+
type: 'string',
|
|
136
|
+
})
|
|
137
|
+
.option('no-overwrite', {
|
|
138
|
+
default: false,
|
|
139
|
+
description: 'do not overwrite output directory if it already exists',
|
|
140
|
+
type: 'boolean',
|
|
141
|
+
})
|
|
142
|
+
.option('overwrite', {
|
|
143
|
+
// This is needed to have the `no-overwrite` flag to work correctly
|
|
144
|
+
default: true,
|
|
145
|
+
hidden: true,
|
|
146
|
+
type: 'boolean',
|
|
147
|
+
})
|
|
148
|
+
.option('p', {
|
|
149
|
+
alias: 'platform',
|
|
150
|
+
choices: inferOs_1.supportedPlatforms,
|
|
151
|
+
defaultDescription: 'current operating system',
|
|
152
|
+
description: 'the operating system platform to build for',
|
|
153
|
+
type: 'string',
|
|
154
|
+
})
|
|
155
|
+
.option('portable', {
|
|
156
|
+
default: false,
|
|
157
|
+
description: 'make the app store its user data in the app folder; WARNING: see https://github.com/nativefier/nativefier/blob/master/API.md#portable for security risks',
|
|
158
|
+
type: 'boolean',
|
|
159
|
+
})
|
|
160
|
+
.option('upgrade', {
|
|
161
|
+
description: 'upgrade an app built by an older version of Nativefier\nYou must pass the full path to the existing app executable (app will be overwritten with upgraded version by default)',
|
|
162
|
+
normalize: true,
|
|
163
|
+
type: 'string',
|
|
164
|
+
})
|
|
165
|
+
.option('widevine', {
|
|
166
|
+
default: false,
|
|
167
|
+
description: "use a Widevine-enabled version of Electron for DRM playback (use at your own risk, it's unofficial, provided by CastLabs)",
|
|
168
|
+
type: 'boolean',
|
|
169
|
+
})
|
|
170
|
+
.group([
|
|
171
|
+
'arch',
|
|
172
|
+
'conceal',
|
|
173
|
+
'electron-version',
|
|
174
|
+
'global-shortcuts',
|
|
175
|
+
'icon',
|
|
176
|
+
'name',
|
|
177
|
+
'no-overwrite',
|
|
178
|
+
'platform',
|
|
179
|
+
'portable',
|
|
180
|
+
'upgrade',
|
|
181
|
+
'widevine',
|
|
182
|
+
], decorateYargOptionGroup('App Creation Options'))
|
|
183
|
+
// App Window Options
|
|
184
|
+
.option('always-on-top', {
|
|
185
|
+
default: false,
|
|
186
|
+
description: 'enable always on top window',
|
|
187
|
+
type: 'boolean',
|
|
188
|
+
})
|
|
189
|
+
.option('background-color', {
|
|
190
|
+
description: "set the app background color, for better integration while the app is loading. Example value: '#2e2c29'",
|
|
191
|
+
type: 'string',
|
|
192
|
+
})
|
|
193
|
+
.option('bookmarks-menu', {
|
|
194
|
+
description: 'create a bookmarks menu (via JSON file); See https://github.com/nativefier/nativefier/blob/master/API.md#bookmarks-menu',
|
|
195
|
+
normalize: true,
|
|
196
|
+
type: 'string',
|
|
197
|
+
})
|
|
198
|
+
.option('browserwindow-options', {
|
|
199
|
+
coerce: parseUtils_1.parseJson,
|
|
200
|
+
description: 'override Electron BrowserWindow options (via JSON string); see https://github.com/nativefier/nativefier/blob/master/API.md#browserwindow-options',
|
|
201
|
+
})
|
|
202
|
+
.option('disable-context-menu', {
|
|
203
|
+
default: false,
|
|
204
|
+
description: 'disable the context menu (right click)',
|
|
205
|
+
type: 'boolean',
|
|
206
|
+
})
|
|
207
|
+
.option('disable-dev-tools', {
|
|
208
|
+
default: false,
|
|
209
|
+
description: 'disable developer tools (Ctrl+Shift+I / F12)',
|
|
210
|
+
type: 'boolean',
|
|
211
|
+
})
|
|
212
|
+
.option('full-screen', {
|
|
213
|
+
default: false,
|
|
214
|
+
description: 'always start the app full screen',
|
|
215
|
+
type: 'boolean',
|
|
216
|
+
})
|
|
217
|
+
.option('height', {
|
|
218
|
+
defaultDescription: '800',
|
|
219
|
+
description: 'set window default height in pixels',
|
|
220
|
+
type: 'number',
|
|
221
|
+
})
|
|
222
|
+
.option('hide-window-frame', {
|
|
223
|
+
default: false,
|
|
224
|
+
description: 'disable window frame and controls',
|
|
225
|
+
type: 'boolean',
|
|
226
|
+
})
|
|
227
|
+
.option('m', {
|
|
228
|
+
alias: 'show-menu-bar',
|
|
229
|
+
default: false,
|
|
230
|
+
description: 'set menu bar visible',
|
|
231
|
+
type: 'boolean',
|
|
232
|
+
})
|
|
233
|
+
.option('max-height', {
|
|
234
|
+
defaultDescription: 'unlimited',
|
|
235
|
+
description: 'set window maximum height in pixels',
|
|
236
|
+
type: 'number',
|
|
237
|
+
})
|
|
238
|
+
.option('max-width', {
|
|
239
|
+
defaultDescription: 'unlimited',
|
|
240
|
+
description: 'set window maximum width in pixels',
|
|
241
|
+
type: 'number',
|
|
242
|
+
})
|
|
243
|
+
.option('maximize', {
|
|
244
|
+
default: false,
|
|
245
|
+
description: 'always start the app maximized',
|
|
246
|
+
type: 'boolean',
|
|
247
|
+
})
|
|
248
|
+
.option('min-height', {
|
|
249
|
+
defaultDescription: '0',
|
|
250
|
+
description: 'set window minimum height in pixels',
|
|
251
|
+
type: 'number',
|
|
252
|
+
})
|
|
253
|
+
.option('min-width', {
|
|
254
|
+
defaultDescription: '0',
|
|
255
|
+
description: 'set window minimum width in pixels',
|
|
256
|
+
type: 'number',
|
|
257
|
+
})
|
|
258
|
+
.option('process-envs', {
|
|
259
|
+
coerce: helpers_1.getProcessEnvs,
|
|
260
|
+
description: 'a JSON string of key/value pairs to be set as environment variables before any browser windows are opened',
|
|
261
|
+
})
|
|
262
|
+
.option('single-instance', {
|
|
263
|
+
default: false,
|
|
264
|
+
description: 'allow only a single instance of the app',
|
|
265
|
+
type: 'boolean',
|
|
266
|
+
})
|
|
267
|
+
.option('tray', {
|
|
268
|
+
default: 'false',
|
|
269
|
+
description: "allow app to stay in system tray. If 'start-in-tray' is set as argument, don't show main window on first start",
|
|
270
|
+
choices: ['true', 'false', 'start-in-tray'],
|
|
271
|
+
})
|
|
272
|
+
.option('width', {
|
|
273
|
+
defaultDescription: '1280',
|
|
274
|
+
description: 'app window default width in pixels',
|
|
275
|
+
type: 'number',
|
|
276
|
+
})
|
|
277
|
+
.option('x', {
|
|
278
|
+
description: 'set window x location in pixels from left',
|
|
279
|
+
type: 'number',
|
|
280
|
+
})
|
|
281
|
+
.option('y', {
|
|
282
|
+
description: 'set window y location in pixels from top',
|
|
283
|
+
type: 'number',
|
|
284
|
+
})
|
|
285
|
+
.option('zoom', {
|
|
286
|
+
default: 1.0,
|
|
287
|
+
description: 'set the default zoom factor for the app',
|
|
288
|
+
type: 'number',
|
|
289
|
+
})
|
|
290
|
+
.group([
|
|
291
|
+
'always-on-top',
|
|
292
|
+
'background-color',
|
|
293
|
+
'bookmarks-menu',
|
|
294
|
+
'browserwindow-options',
|
|
295
|
+
'disable-context-menu',
|
|
296
|
+
'disable-dev-tools',
|
|
297
|
+
'full-screen',
|
|
298
|
+
'height',
|
|
299
|
+
'hide-window-frame',
|
|
300
|
+
'm',
|
|
301
|
+
'max-width',
|
|
302
|
+
'max-height',
|
|
303
|
+
'maximize',
|
|
304
|
+
'min-height',
|
|
305
|
+
'min-width',
|
|
306
|
+
'process-envs',
|
|
307
|
+
'single-instance',
|
|
308
|
+
'tray',
|
|
309
|
+
'width',
|
|
310
|
+
'x',
|
|
311
|
+
'y',
|
|
312
|
+
'zoom',
|
|
313
|
+
], decorateYargOptionGroup('App Window Options'))
|
|
314
|
+
// Internal Browser Options
|
|
315
|
+
.option('file-download-options', {
|
|
316
|
+
coerce: parseUtils_1.parseJson,
|
|
317
|
+
description: 'a JSON string defining file download options; see https://github.com/sindresorhus/electron-dl',
|
|
318
|
+
})
|
|
319
|
+
.option('inject', {
|
|
320
|
+
description: 'path to a CSS/JS file to be injected; pass multiple times to inject multiple files',
|
|
321
|
+
string: true,
|
|
322
|
+
type: 'array',
|
|
323
|
+
})
|
|
324
|
+
.option('auto-login', {
|
|
325
|
+
description: 'auto-fill login form with credentials (format: username:password). Credentials are Base64 encoded in the app.',
|
|
326
|
+
type: 'string',
|
|
327
|
+
})
|
|
328
|
+
.option('lang', {
|
|
329
|
+
defaultDescription: 'os language at runtime of the app',
|
|
330
|
+
description: 'set the language or locale to render the web site as (e.g., "fr", "en-US", "es", etc.)',
|
|
331
|
+
type: 'string',
|
|
332
|
+
})
|
|
333
|
+
.option('u', {
|
|
334
|
+
alias: 'user-agent',
|
|
335
|
+
description: "set the app's user agent string; may also use 'edge', 'firefox', or 'safari' to have one auto-generated",
|
|
336
|
+
type: 'string',
|
|
337
|
+
})
|
|
338
|
+
.option('user-agent-honest', {
|
|
339
|
+
alias: 'honest',
|
|
340
|
+
default: false,
|
|
341
|
+
description: 'prevent the normal changing of the user agent string to appear as a regular Chrome browser',
|
|
342
|
+
type: 'boolean',
|
|
343
|
+
})
|
|
344
|
+
.group([
|
|
345
|
+
'file-download-options',
|
|
346
|
+
'inject',
|
|
347
|
+
'auto-login',
|
|
348
|
+
'lang',
|
|
349
|
+
'user-agent',
|
|
350
|
+
'user-agent-honest',
|
|
351
|
+
], decorateYargOptionGroup('Internal Browser Options'))
|
|
352
|
+
// Internal Browser Cache Options
|
|
353
|
+
.option('clear-cache', {
|
|
354
|
+
default: false,
|
|
355
|
+
description: 'prevent the app from preserving cache between launches',
|
|
356
|
+
type: 'boolean',
|
|
357
|
+
})
|
|
358
|
+
.option('disk-cache-size', {
|
|
359
|
+
defaultDescription: 'chromium default',
|
|
360
|
+
description: 'set the maximum disk space (in bytes) to be used by the disk cache',
|
|
361
|
+
type: 'number',
|
|
362
|
+
})
|
|
363
|
+
.group(['clear-cache', 'disk-cache-size'], decorateYargOptionGroup('Internal Browser Cache Options'))
|
|
364
|
+
// URL Handling Options
|
|
365
|
+
.option('block-external-urls', {
|
|
366
|
+
default: false,
|
|
367
|
+
description: `forbid navigation to URLs not considered "internal" (see '--internal-urls'). Instead of opening in an external browser, attempts to navigate to external URLs will be blocked`,
|
|
368
|
+
type: 'boolean',
|
|
369
|
+
})
|
|
370
|
+
.option('internal-urls', {
|
|
371
|
+
defaultDescription: 'URLs sharing the same base domain',
|
|
372
|
+
description: `regex of URLs to consider "internal"; by default matches based on domain (see '--strict-internal-urls'); all other URLs will be opened in an external browser`,
|
|
373
|
+
type: 'string',
|
|
374
|
+
})
|
|
375
|
+
.option('strict-internal-urls', {
|
|
376
|
+
default: false,
|
|
377
|
+
description: 'disable domain-based matching on internal URLs',
|
|
378
|
+
type: 'boolean',
|
|
379
|
+
})
|
|
380
|
+
.option('proxy-rules', {
|
|
381
|
+
description: 'proxy rules; see https://www.electronjs.org/docs/api/session#sessetproxyconfig',
|
|
382
|
+
type: 'string',
|
|
383
|
+
})
|
|
384
|
+
.group([
|
|
385
|
+
'block-external-urls',
|
|
386
|
+
'internal-urls',
|
|
387
|
+
'strict-internal-urls',
|
|
388
|
+
'proxy-rules',
|
|
389
|
+
], decorateYargOptionGroup('URL Handling Options'))
|
|
390
|
+
// Auth Options
|
|
391
|
+
.option('basic-auth-password', {
|
|
392
|
+
description: 'basic http(s) auth password',
|
|
393
|
+
type: 'string',
|
|
394
|
+
})
|
|
395
|
+
.option('basic-auth-username', {
|
|
396
|
+
description: 'basic http(s) auth username',
|
|
397
|
+
type: 'string',
|
|
398
|
+
})
|
|
399
|
+
.group(['basic-auth-password', 'basic-auth-username'], decorateYargOptionGroup('Auth Options'))
|
|
400
|
+
// Graphics Options
|
|
401
|
+
.option('disable-gpu', {
|
|
402
|
+
default: false,
|
|
403
|
+
description: 'disable hardware acceleration',
|
|
404
|
+
type: 'boolean',
|
|
405
|
+
})
|
|
406
|
+
.option('enable-es3-apis', {
|
|
407
|
+
default: false,
|
|
408
|
+
description: 'force activation of WebGL 2.0',
|
|
409
|
+
type: 'boolean',
|
|
410
|
+
})
|
|
411
|
+
.option('ignore-gpu-blacklist', {
|
|
412
|
+
default: false,
|
|
413
|
+
description: 'force WebGL apps to work on unsupported GPUs',
|
|
414
|
+
type: 'boolean',
|
|
415
|
+
})
|
|
416
|
+
.group(['disable-gpu', 'enable-es3-apis', 'ignore-gpu-blacklist'], decorateYargOptionGroup('Graphics Options'))
|
|
417
|
+
// Security Options
|
|
418
|
+
.option('ignore-certificate', {
|
|
419
|
+
default: false,
|
|
420
|
+
description: 'ignore certificate-related errors',
|
|
421
|
+
type: 'boolean',
|
|
422
|
+
})
|
|
423
|
+
.option('insecure', {
|
|
424
|
+
default: false,
|
|
425
|
+
description: 'enable loading of insecure content',
|
|
426
|
+
type: 'boolean',
|
|
427
|
+
})
|
|
428
|
+
.group([
|
|
429
|
+
'ignore-certificate',
|
|
430
|
+
'insecure',
|
|
431
|
+
], decorateYargOptionGroup('Security Options'))
|
|
432
|
+
// Flash Options (DEPRECATED)
|
|
433
|
+
.option('flash', {
|
|
434
|
+
default: false,
|
|
435
|
+
deprecated: true,
|
|
436
|
+
description: 'enable Adobe Flash',
|
|
437
|
+
hidden: true,
|
|
438
|
+
type: 'boolean',
|
|
439
|
+
})
|
|
440
|
+
.option('flash-path', {
|
|
441
|
+
deprecated: true,
|
|
442
|
+
description: 'path to Chrome flash plugin; find it in `chrome://plugins`',
|
|
443
|
+
hidden: true,
|
|
444
|
+
normalize: true,
|
|
445
|
+
type: 'string',
|
|
446
|
+
})
|
|
447
|
+
// Platform Specific Options
|
|
448
|
+
.option('app-copyright', {
|
|
449
|
+
description: '(macOS, windows only) set a human-readable copyright line for the app; maps to `LegalCopyright` metadata property on Windows, and `NSHumanReadableCopyright` on macOS',
|
|
450
|
+
type: 'string',
|
|
451
|
+
})
|
|
452
|
+
.option('app-version', {
|
|
453
|
+
description: '(macOS, windows only) set the version of the app; maps to the `ProductVersion` metadata property on Windows, and `CFBundleShortVersionString` on macOS',
|
|
454
|
+
type: 'string',
|
|
455
|
+
})
|
|
456
|
+
.option('bounce', {
|
|
457
|
+
default: false,
|
|
458
|
+
description: '(macOS only) make the dock icon bounce when the counter increases',
|
|
459
|
+
type: 'boolean',
|
|
460
|
+
})
|
|
461
|
+
.option('build-version', {
|
|
462
|
+
description: '(macOS, windows only) set the build version of the app; maps to `FileVersion` metadata property on Windows, and `CFBundleVersion` on macOS',
|
|
463
|
+
type: 'string',
|
|
464
|
+
})
|
|
465
|
+
.option('counter', {
|
|
466
|
+
default: false,
|
|
467
|
+
description: '(macOS only) set a dock count badge, determined by looking for a number in the window title',
|
|
468
|
+
type: 'boolean',
|
|
469
|
+
})
|
|
470
|
+
.option('darwin-dark-mode-support', {
|
|
471
|
+
default: false,
|
|
472
|
+
description: '(macOS only) enable Dark Mode support on macOS 10.14+',
|
|
473
|
+
type: 'boolean',
|
|
474
|
+
})
|
|
475
|
+
.option('f', {
|
|
476
|
+
alias: 'fast-quit',
|
|
477
|
+
default: false,
|
|
478
|
+
description: '(macOS only) quit app on window close',
|
|
479
|
+
type: 'boolean',
|
|
480
|
+
})
|
|
481
|
+
.option('title-bar-style', {
|
|
482
|
+
choices: ['hidden', 'hiddenInset'],
|
|
483
|
+
description: '(macOS only) set title bar style; consider injecting custom CSS (via --inject) for better integration',
|
|
484
|
+
type: 'string',
|
|
485
|
+
})
|
|
486
|
+
.option('win32metadata', {
|
|
487
|
+
coerce: (value) => (0, parseUtils_1.parseJson)(value),
|
|
488
|
+
description: '(windows only) a JSON string of key/value pairs (ProductName, InternalName, FileDescription) to embed as executable metadata',
|
|
489
|
+
})
|
|
490
|
+
.group([
|
|
491
|
+
'app-copyright',
|
|
492
|
+
'app-version',
|
|
493
|
+
'bounce',
|
|
494
|
+
'build-version',
|
|
495
|
+
'counter',
|
|
496
|
+
'darwin-dark-mode-support',
|
|
497
|
+
'fast-quit',
|
|
498
|
+
'title-bar-style',
|
|
499
|
+
'win32metadata',
|
|
500
|
+
], decorateYargOptionGroup('Platform-Specific Options'))
|
|
501
|
+
// Debug Options
|
|
502
|
+
.option('crash-reporter', {
|
|
503
|
+
description: 'remote server URL to send crash reports',
|
|
504
|
+
type: 'string',
|
|
505
|
+
})
|
|
506
|
+
.option('verbose', {
|
|
507
|
+
default: false,
|
|
508
|
+
description: 'enable verbose/debug/troubleshooting logs',
|
|
509
|
+
type: 'boolean',
|
|
510
|
+
})
|
|
511
|
+
.option('quiet', {
|
|
512
|
+
default: false,
|
|
513
|
+
description: 'suppress all logging',
|
|
514
|
+
type: 'boolean',
|
|
515
|
+
})
|
|
516
|
+
.group(['crash-reporter', 'verbose', 'quiet'], decorateYargOptionGroup('Debug Options'))
|
|
517
|
+
.version()
|
|
518
|
+
.help()
|
|
519
|
+
.group(['version', 'help'], 'Other Options')
|
|
520
|
+
.wrap(yargs_1.default.terminalWidth());
|
|
521
|
+
// We must access argv in order to get yargs to actually process args
|
|
522
|
+
// Do this now to go ahead and get any errors out of the way
|
|
523
|
+
args.argv;
|
|
524
|
+
return args;
|
|
525
|
+
}
|
|
526
|
+
function decorateYargOptionGroup(value) {
|
|
527
|
+
return `====== ${value} ======`;
|
|
528
|
+
}
|
|
529
|
+
function parseArgs(args) {
|
|
530
|
+
const parsed = { ...args.argv };
|
|
531
|
+
// In yargs, the _ property of the parsed args is an array of the positional args
|
|
532
|
+
// https://github.com/yargs/yargs/blob/master/docs/examples.md#and-non-hyphenated-options-too-just-use-argv_
|
|
533
|
+
// So try to extract the targetUrl and outputDirectory from these
|
|
534
|
+
parsed.targetUrl = parsed._.length > 0 ? parsed._[0].toString() : undefined;
|
|
535
|
+
parsed.out = parsed._.length > 1 ? parsed._[1] : undefined;
|
|
536
|
+
if (parsed.upgrade && parsed.targetUrl) {
|
|
537
|
+
let targetAndUpgrade = false;
|
|
538
|
+
if (!parsed.out) {
|
|
539
|
+
// If we're upgrading, the first positional args might be the outputDirectory, so swap these if we can
|
|
540
|
+
try {
|
|
541
|
+
// If this succeeds, we have a problem
|
|
542
|
+
new URL(parsed.targetUrl);
|
|
543
|
+
targetAndUpgrade = true;
|
|
544
|
+
}
|
|
545
|
+
catch {
|
|
546
|
+
// Cool, it's not a URL
|
|
547
|
+
parsed.out = parsed.targetUrl;
|
|
548
|
+
parsed.targetUrl = undefined;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
else {
|
|
552
|
+
// Someone supplied a targetUrl, an outputDirectory, and --upgrade. That's not cool.
|
|
553
|
+
targetAndUpgrade = true;
|
|
554
|
+
}
|
|
555
|
+
if (targetAndUpgrade) {
|
|
556
|
+
throw new Error('ERROR: Nativefier must be called with either a targetUrl or the --upgrade option, not both.\n');
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
// 允许使用配置文件时不需要 targetUrl
|
|
560
|
+
if (!parsed.targetUrl && !parsed.upgrade && !parsed.config) {
|
|
561
|
+
// 检查是否有自动发现的配置文件
|
|
562
|
+
const autoConfig = (0, config_1.findConfigFile)();
|
|
563
|
+
if (!autoConfig) {
|
|
564
|
+
throw new Error('ERROR: Nativefier must be called with a targetUrl, --upgrade, or --config option.\n' +
|
|
565
|
+
'Or create a electrify.config.yaml file in the current directory.\n' +
|
|
566
|
+
'Run "electrify init" to generate a config template.\n');
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
parsed.noOverwrite = parsed['no-overwrite'] = !parsed.overwrite;
|
|
570
|
+
// Since coerce in yargs seems to have broken since
|
|
571
|
+
// https://github.com/yargs/yargs/pull/1978
|
|
572
|
+
for (const arg of [
|
|
573
|
+
'win32metadata',
|
|
574
|
+
'browserwindow-options',
|
|
575
|
+
'file-download-options',
|
|
576
|
+
]) {
|
|
577
|
+
if (parsed[arg] && typeof parsed[arg] === 'string') {
|
|
578
|
+
parsed[arg] = (0, parseUtils_1.parseJson)(parsed[arg]);
|
|
579
|
+
// sets fileDownloadOptions and browserWindowOptions
|
|
580
|
+
// as parsed object as they were still strings in `nativefier.json`
|
|
581
|
+
// because only their snake-cased variants were being parsed above
|
|
582
|
+
parsed[(0, helpers_1.camelCased)(arg)] = parsed[arg];
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
if (parsed['process-envs'] && typeof parsed['process-envs'] === 'string') {
|
|
586
|
+
parsed['process-envs'] = (0, helpers_1.getProcessEnvs)(parsed['process-envs']);
|
|
587
|
+
}
|
|
588
|
+
return parsed;
|
|
589
|
+
}
|
|
590
|
+
function sanitizeArgs(argv) {
|
|
591
|
+
const sanitizedArgs = [];
|
|
592
|
+
argv.forEach((arg) => {
|
|
593
|
+
if ((0, helpers_1.isArgFormatInvalid)(arg)) {
|
|
594
|
+
throw new Error(`Invalid argument passed: ${arg} .\nNativefier supports short options (like "-n") and long options (like "--name"), all lowercase. Run "electrify --help" for help.\nAborting`);
|
|
595
|
+
}
|
|
596
|
+
const isLastArg = sanitizedArgs.length + 1 === argv.length;
|
|
597
|
+
if (sanitizedArgs.length > 0) {
|
|
598
|
+
const previousArg = sanitizedArgs[sanitizedArgs.length - 1];
|
|
599
|
+
log.debug({ arg, previousArg, isLastArg });
|
|
600
|
+
// Work around commander.js not supporting default argument for options
|
|
601
|
+
if (previousArg === '--tray' &&
|
|
602
|
+
!['true', 'false', 'start-in-tray'].includes(arg)) {
|
|
603
|
+
sanitizedArgs.push('true');
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
sanitizedArgs.push(arg);
|
|
607
|
+
if (arg === '--tray' && isLastArg) {
|
|
608
|
+
// Add a true if --tray is last so it gets enabled
|
|
609
|
+
sanitizedArgs.push('true');
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
return sanitizedArgs;
|
|
613
|
+
}
|
|
614
|
+
if (require.main === module) {
|
|
615
|
+
// 处理特殊命令
|
|
616
|
+
const firstArg = process.argv[2];
|
|
617
|
+
// wizard 命令 - 交互式向导
|
|
618
|
+
if (firstArg === 'wizard') {
|
|
619
|
+
log.setLevel('info');
|
|
620
|
+
(0, wizard_1.runWizard)()
|
|
621
|
+
.then((options) => (0, main_1.buildNativefierApp)(options))
|
|
622
|
+
.catch((error) => {
|
|
623
|
+
log.error('Error:', error);
|
|
624
|
+
process.exit(1);
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
// init 命令 - 生成配置文件模板
|
|
628
|
+
else if (firstArg === 'init') {
|
|
629
|
+
const format = process.argv[3] === '--json' ? 'json' : 'yaml';
|
|
630
|
+
const fileName = format === 'json' ? 'electrify.config.json' : 'electrify.config.yaml';
|
|
631
|
+
const template = (0, config_1.generateConfigTemplate)(format);
|
|
632
|
+
fs.writeFileSync(fileName, template);
|
|
633
|
+
console.log(`✅ Created ${fileName}`);
|
|
634
|
+
console.log(`\nEdit the file and run: electrify build`);
|
|
635
|
+
}
|
|
636
|
+
// build 命令 - 从配置文件构建
|
|
637
|
+
else if (firstArg === 'build') {
|
|
638
|
+
log.setLevel('info');
|
|
639
|
+
const configPath = process.argv[3] || (0, config_1.findConfigFile)();
|
|
640
|
+
if (!configPath) {
|
|
641
|
+
log.error('No config file found. Run "electrify init" to create one.');
|
|
642
|
+
process.exit(1);
|
|
643
|
+
}
|
|
644
|
+
try {
|
|
645
|
+
const config = (0, config_1.loadConfigFile)(configPath);
|
|
646
|
+
const options = (0, config_1.configToOptions)(config);
|
|
647
|
+
log.info(`📄 Using config: ${configPath}`);
|
|
648
|
+
(0, main_1.buildNativefierApp)(options).catch((error) => {
|
|
649
|
+
log.error('Error during build:', error);
|
|
650
|
+
process.exit(1);
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
catch (err) {
|
|
654
|
+
log.error('Failed to load config:', err);
|
|
655
|
+
process.exit(1);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
// presets 命令 - 列出预设
|
|
659
|
+
else if (firstArg === 'presets') {
|
|
660
|
+
console.log('\n📋 Available Presets:\n');
|
|
661
|
+
(0, presets_1.listPresets)().forEach((preset) => {
|
|
662
|
+
console.log(` ${preset.name.padEnd(15)} - ${preset.description}`);
|
|
663
|
+
});
|
|
664
|
+
console.log('\nUsage: electrify <url> --preset <name>\n');
|
|
665
|
+
}
|
|
666
|
+
// doctor 命令 - 诊断环境
|
|
667
|
+
else if (firstArg === 'doctor') {
|
|
668
|
+
console.log('\n🩺 Electrify Web Doctor - Environment Check\n');
|
|
669
|
+
(0, security_1.runDoctor)()
|
|
670
|
+
.then(({ passed, checks }) => {
|
|
671
|
+
checks.forEach((check) => {
|
|
672
|
+
const icon = check.status === 'pass' ? '✅' : check.status === 'warn' ? '⚠️' : '❌';
|
|
673
|
+
console.log(` ${icon} ${check.name.padEnd(15)} ${check.message}`);
|
|
674
|
+
});
|
|
675
|
+
console.log('');
|
|
676
|
+
if (passed) {
|
|
677
|
+
console.log('✅ All checks passed! Ready to build.\n');
|
|
678
|
+
}
|
|
679
|
+
else {
|
|
680
|
+
console.log('❌ Some checks failed. Please fix the issues above.\n');
|
|
681
|
+
process.exit(1);
|
|
682
|
+
}
|
|
683
|
+
})
|
|
684
|
+
.catch((err) => {
|
|
685
|
+
console.error('Doctor check failed:', err);
|
|
686
|
+
process.exit(1);
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
// 常规构建流程
|
|
690
|
+
else {
|
|
691
|
+
let args = undefined;
|
|
692
|
+
let parsedArgs;
|
|
693
|
+
try {
|
|
694
|
+
args = initArgs(process.argv.slice(2));
|
|
695
|
+
parsedArgs = parseArgs(args);
|
|
696
|
+
}
|
|
697
|
+
catch (err) {
|
|
698
|
+
if (args) {
|
|
699
|
+
log.error(err);
|
|
700
|
+
args.showHelp();
|
|
701
|
+
}
|
|
702
|
+
else {
|
|
703
|
+
log.error('Failed to parse command-line arguments. Aborting.', err);
|
|
704
|
+
}
|
|
705
|
+
process.exit(1);
|
|
706
|
+
}
|
|
707
|
+
let options = {
|
|
708
|
+
...parsedArgs,
|
|
709
|
+
};
|
|
710
|
+
// 处理配置文件
|
|
711
|
+
if (options.config) {
|
|
712
|
+
try {
|
|
713
|
+
const config = (0, config_1.loadConfigFile)(options.config);
|
|
714
|
+
const configOptions = (0, config_1.configToOptions)(config);
|
|
715
|
+
options = { ...configOptions, ...options };
|
|
716
|
+
delete options.config;
|
|
717
|
+
}
|
|
718
|
+
catch (err) {
|
|
719
|
+
log.error('Failed to load config file:', err);
|
|
720
|
+
process.exit(1);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
else {
|
|
724
|
+
// 自动发现配置文件
|
|
725
|
+
const autoConfig = (0, config_1.findConfigFile)();
|
|
726
|
+
if (autoConfig && !options.targetUrl) {
|
|
727
|
+
try {
|
|
728
|
+
const config = (0, config_1.loadConfigFile)(autoConfig);
|
|
729
|
+
const configOptions = (0, config_1.configToOptions)(config);
|
|
730
|
+
options = { ...configOptions, ...options };
|
|
731
|
+
log.info(`📄 Auto-loaded config: ${autoConfig}`);
|
|
732
|
+
}
|
|
733
|
+
catch (err) {
|
|
734
|
+
log.debug('Failed to auto-load config:', err);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
// 处理预设
|
|
739
|
+
if (options.preset) {
|
|
740
|
+
try {
|
|
741
|
+
options = (0, presets_1.applyPreset)(options, options.preset);
|
|
742
|
+
log.info(`🎯 Applied preset: ${options.preset}`);
|
|
743
|
+
delete options.preset;
|
|
744
|
+
}
|
|
745
|
+
catch (err) {
|
|
746
|
+
log.error(err.message);
|
|
747
|
+
process.exit(1);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
else if (options.targetUrl) {
|
|
751
|
+
// 智能推荐预设
|
|
752
|
+
const suggested = (0, presets_1.suggestPreset)(options.targetUrl);
|
|
753
|
+
if (suggested) {
|
|
754
|
+
log.info(`💡 Tip: Use --preset ${suggested} for optimized settings`);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
if (options.verbose) {
|
|
758
|
+
log.setLevel('trace');
|
|
759
|
+
try {
|
|
760
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
|
761
|
+
require('debug').enable('electron-packager');
|
|
762
|
+
}
|
|
763
|
+
catch (err) {
|
|
764
|
+
log.debug('Failed to enable electron-packager debug output. This should not happen,', 'and suggests their internals changed. Please report an issue.');
|
|
765
|
+
}
|
|
766
|
+
log.debug('Running in verbose mode! This will produce a mountain of logs and', 'is recommended only for troubleshooting or if you like Shakespeare.');
|
|
767
|
+
}
|
|
768
|
+
else if (options.quiet) {
|
|
769
|
+
log.setLevel('silent');
|
|
770
|
+
}
|
|
771
|
+
else {
|
|
772
|
+
log.setLevel('info');
|
|
773
|
+
}
|
|
774
|
+
(0, helpers_1.checkInternet)();
|
|
775
|
+
if (!options.out && process.env.NATIVEFIER_APPS_DIR) {
|
|
776
|
+
options.out = process.env.NATIVEFIER_APPS_DIR;
|
|
777
|
+
}
|
|
778
|
+
(0, main_1.buildNativefierApp)(options).catch((error) => {
|
|
779
|
+
log.error('Error during build. Run with --verbose for details.', error);
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
//# sourceMappingURL=cli.js.map
|