@vixoniccom/module-packager 2.10.2-test.6 → 2.10.2

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.
@@ -1,693 +0,0 @@
1
- "use strict";
2
- (global["webpackChunk_vixoniccom_module_packager"] = global["webpackChunk_vixoniccom_module_packager"] || []).push([[676],{
3
-
4
- /***/ 31676:
5
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
6
-
7
- // ESM COMPAT FLAG
8
- __webpack_require__.r(__webpack_exports__);
9
-
10
- // EXPORTS
11
- __webpack_require__.d(__webpack_exports__, {
12
- apps: () => (/* binding */ apps),
13
- "default": () => (/* binding */ node_modules_open),
14
- openApp: () => (/* binding */ openApp)
15
- });
16
-
17
- // EXTERNAL MODULE: external "node:process"
18
- var external_node_process_ = __webpack_require__(1708);
19
- // EXTERNAL MODULE: external "node:buffer"
20
- var external_node_buffer_ = __webpack_require__(4573);
21
- // EXTERNAL MODULE: external "node:path"
22
- var external_node_path_ = __webpack_require__(76760);
23
- // EXTERNAL MODULE: external "node:url"
24
- var external_node_url_ = __webpack_require__(73136);
25
- // EXTERNAL MODULE: external "node:util"
26
- var external_node_util_ = __webpack_require__(57975);
27
- // EXTERNAL MODULE: external "node:child_process"
28
- var external_node_child_process_ = __webpack_require__(31421);
29
- // EXTERNAL MODULE: external "node:fs/promises"
30
- var promises_ = __webpack_require__(73836);
31
- // EXTERNAL MODULE: external "node:os"
32
- var external_node_os_ = __webpack_require__(48161);
33
- // EXTERNAL MODULE: external "node:fs"
34
- var external_node_fs_ = __webpack_require__(73024);
35
- ;// ../../node_modules/is-docker/index.js
36
-
37
-
38
- let isDockerCached;
39
-
40
- function hasDockerEnv() {
41
- try {
42
- external_node_fs_.statSync('/.dockerenv');
43
- return true;
44
- } catch {
45
- return false;
46
- }
47
- }
48
-
49
- function hasDockerCGroup() {
50
- try {
51
- return external_node_fs_.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');
52
- } catch {
53
- return false;
54
- }
55
- }
56
-
57
- function isDocker() {
58
- // TODO: Use `??=` when targeting Node.js 16.
59
- if (isDockerCached === undefined) {
60
- isDockerCached = hasDockerEnv() || hasDockerCGroup();
61
- }
62
-
63
- return isDockerCached;
64
- }
65
-
66
- ;// ../../node_modules/is-inside-container/index.js
67
-
68
-
69
-
70
- let cachedResult;
71
-
72
- // Podman detection
73
- const hasContainerEnv = () => {
74
- try {
75
- external_node_fs_.statSync('/run/.containerenv');
76
- return true;
77
- } catch {
78
- return false;
79
- }
80
- };
81
-
82
- function isInsideContainer() {
83
- // TODO: Use `??=` when targeting Node.js 16.
84
- if (cachedResult === undefined) {
85
- cachedResult = hasContainerEnv() || isDocker();
86
- }
87
-
88
- return cachedResult;
89
- }
90
-
91
- ;// ../../node_modules/is-wsl/index.js
92
-
93
-
94
-
95
-
96
-
97
- const isWsl = () => {
98
- if (external_node_process_.platform !== 'linux') {
99
- return false;
100
- }
101
-
102
- if (external_node_os_.release().toLowerCase().includes('microsoft')) {
103
- if (isInsideContainer()) {
104
- return false;
105
- }
106
-
107
- return true;
108
- }
109
-
110
- try {
111
- return external_node_fs_.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft')
112
- ? !isInsideContainer() : false;
113
- } catch {
114
- return false;
115
- }
116
- };
117
-
118
- /* harmony default export */ const is_wsl = (external_node_process_.env.__IS_WSL_TEST__ ? isWsl : isWsl());
119
-
120
- ;// ../../node_modules/define-lazy-prop/index.js
121
- function defineLazyProperty(object, propertyName, valueGetter) {
122
- const define = value => Object.defineProperty(object, propertyName, {value, enumerable: true, writable: true});
123
-
124
- Object.defineProperty(object, propertyName, {
125
- configurable: true,
126
- enumerable: true,
127
- get() {
128
- const result = valueGetter();
129
- define(result);
130
- return result;
131
- },
132
- set(value) {
133
- define(value);
134
- }
135
- });
136
-
137
- return object;
138
- }
139
-
140
- ;// ../../node_modules/default-browser-id/index.js
141
-
142
-
143
-
144
-
145
- const execFileAsync = (0,external_node_util_.promisify)(external_node_child_process_.execFile);
146
-
147
- async function defaultBrowserId() {
148
- if (external_node_process_.platform !== 'darwin') {
149
- throw new Error('macOS only');
150
- }
151
-
152
- const {stdout} = await execFileAsync('defaults', ['read', 'com.apple.LaunchServices/com.apple.launchservices.secure', 'LSHandlers']);
153
-
154
- // `(?!-)` is to prevent matching `LSHandlerRoleAll = "-";`.
155
- const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
156
-
157
- return match?.groups.id ?? 'com.apple.Safari';
158
- }
159
-
160
- ;// ../../node_modules/run-applescript/index.js
161
-
162
-
163
-
164
-
165
- const run_applescript_execFileAsync = (0,external_node_util_.promisify)(external_node_child_process_.execFile);
166
-
167
- async function runAppleScript(script, {humanReadableOutput = true} = {}) {
168
- if (external_node_process_.platform !== 'darwin') {
169
- throw new Error('macOS only');
170
- }
171
-
172
- const outputArguments = humanReadableOutput ? [] : ['-ss'];
173
-
174
- const {stdout} = await run_applescript_execFileAsync('osascript', ['-e', script, outputArguments]);
175
- return stdout.trim();
176
- }
177
-
178
- function runAppleScriptSync(script, {humanReadableOutput = true} = {}) {
179
- if (process.platform !== 'darwin') {
180
- throw new Error('macOS only');
181
- }
182
-
183
- const outputArguments = humanReadableOutput ? [] : ['-ss'];
184
-
185
- const stdout = execFileSync('osascript', ['-e', script, ...outputArguments], {
186
- encoding: 'utf8',
187
- stdio: ['ignore', 'pipe', 'ignore'],
188
- timeout: 500,
189
- });
190
-
191
- return stdout.trim();
192
- }
193
-
194
- ;// ../../node_modules/bundle-name/index.js
195
-
196
-
197
- async function bundleName(bundleId) {
198
- return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
199
- }
200
-
201
- ;// ../../node_modules/default-browser/windows.js
202
-
203
-
204
-
205
- const windows_execFileAsync = (0,external_node_util_.promisify)(external_node_child_process_.execFile);
206
-
207
- // Windows doesn't have browser IDs in the same way macOS/Linux does so we give fake
208
- // ones that look real and match the macOS/Linux versions for cross-platform apps.
209
- const windowsBrowserProgIds = {
210
- AppXq0fevzme2pys62n3e0fbqa7peapykr8v: {name: 'Edge', id: 'com.microsoft.edge.old'},
211
- MSEdgeDHTML: {name: 'Edge', id: 'com.microsoft.edge'}, // On macOS, it's "com.microsoft.edgemac"
212
- MSEdgeHTM: {name: 'Edge', id: 'com.microsoft.edge'}, // Newer Edge/Win10 releases
213
- 'IE.HTTP': {name: 'Internet Explorer', id: 'com.microsoft.ie'},
214
- FirefoxURL: {name: 'Firefox', id: 'org.mozilla.firefox'},
215
- ChromeHTML: {name: 'Chrome', id: 'com.google.chrome'},
216
- BraveHTML: {name: 'Brave', id: 'com.brave.Browser'},
217
- BraveBHTML: {name: 'Brave Beta', id: 'com.brave.Browser.beta'},
218
- BraveSSHTM: {name: 'Brave Nightly', id: 'com.brave.Browser.nightly'},
219
- };
220
-
221
- class UnknownBrowserError extends Error {}
222
-
223
- async function defaultBrowser(_execFileAsync = windows_execFileAsync) {
224
- const {stdout} = await _execFileAsync('reg', [
225
- 'QUERY',
226
- ' HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice',
227
- '/v',
228
- 'ProgId',
229
- ]);
230
-
231
- const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
232
- if (!match) {
233
- throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
234
- }
235
-
236
- const {id} = match.groups;
237
-
238
- const browser = windowsBrowserProgIds[id];
239
- if (!browser) {
240
- throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
241
- }
242
-
243
- return browser;
244
- }
245
-
246
- ;// ../../node_modules/default-browser/index.js
247
-
248
-
249
-
250
-
251
-
252
-
253
-
254
- const default_browser_execFileAsync = (0,external_node_util_.promisify)(external_node_child_process_.execFile);
255
-
256
- // Inlined: https://github.com/sindresorhus/titleize/blob/main/index.js
257
- const titleize = string => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, x => x.toUpperCase());
258
-
259
- async function default_browser_defaultBrowser() {
260
- if (external_node_process_.platform === 'darwin') {
261
- const id = await defaultBrowserId();
262
- const name = await bundleName(id);
263
- return {name, id};
264
- }
265
-
266
- if (external_node_process_.platform === 'linux') {
267
- const {stdout} = await default_browser_execFileAsync('xdg-mime', ['query', 'default', 'x-scheme-handler/http']);
268
- const id = stdout.trim();
269
- const name = titleize(id.replace(/.desktop$/, '').replace('-', ' '));
270
- return {name, id};
271
- }
272
-
273
- if (external_node_process_.platform === 'win32') {
274
- return defaultBrowser();
275
- }
276
-
277
- throw new Error('Only macOS, Linux, and Windows are supported');
278
- }
279
-
280
- ;// ../../node_modules/open/index.js
281
-
282
-
283
-
284
-
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
-
293
- const execFile = external_node_util_.promisify(external_node_child_process_.execFile);
294
-
295
- // Path to included `xdg-open`.
296
- const open_dirname = external_node_path_.dirname((0,external_node_url_.fileURLToPath)("file:///home/nicolasandrade/vixonic/update-controller/node_modules/open/index.js"));
297
- const localXdgOpenPath = external_node_path_.join(open_dirname, 'xdg-open');
298
-
299
- const {platform, arch} = external_node_process_;
300
-
301
- /**
302
- Get the mount point for fixed drives in WSL.
303
-
304
- @inner
305
- @returns {string} The mount point.
306
- */
307
- const getWslDrivesMountPoint = (() => {
308
- // Default value for "root" param
309
- // according to https://docs.microsoft.com/en-us/windows/wsl/wsl-config
310
- const defaultMountPoint = '/mnt/';
311
-
312
- let mountPoint;
313
-
314
- return async function () {
315
- if (mountPoint) {
316
- // Return memoized mount point value
317
- return mountPoint;
318
- }
319
-
320
- const configFilePath = '/etc/wsl.conf';
321
-
322
- let isConfigFileExists = false;
323
- try {
324
- await promises_.access(configFilePath, promises_.constants.F_OK);
325
- isConfigFileExists = true;
326
- } catch {}
327
-
328
- if (!isConfigFileExists) {
329
- return defaultMountPoint;
330
- }
331
-
332
- const configContent = await promises_.readFile(configFilePath, {encoding: 'utf8'});
333
- const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
334
-
335
- if (!configMountPoint) {
336
- return defaultMountPoint;
337
- }
338
-
339
- mountPoint = configMountPoint.groups.mountPoint.trim();
340
- mountPoint = mountPoint.endsWith('/') ? mountPoint : `${mountPoint}/`;
341
-
342
- return mountPoint;
343
- };
344
- })();
345
-
346
- /**
347
- Get the PowerShell executable path in WSL environment.
348
-
349
- @returns {Promise<string>} The absolute path to the PowerShell executable in WSL.
350
- */
351
- const getPowershellPathFromWsl = async () => {
352
- const mountPoint = await getWslDrivesMountPoint();
353
- return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
354
- };
355
-
356
- /**
357
- Get the default browser name in Windows from WSL.
358
-
359
- @returns {Promise<string>} Browser name.
360
- */
361
- async function getWindowsDefaultBrowserFromWsl() {
362
- const powershellPath = await getPowershellPathFromWsl();
363
- const rawCommand = '(Get-ItemProperty -Path "HKCU:\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice").ProgId';
364
- const encodedCommand = external_node_buffer_.Buffer.from(rawCommand, 'utf16le').toString('base64');
365
-
366
- const {stdout} = await execFile(
367
- powershellPath,
368
- [
369
- '-NoProfile',
370
- '-NonInteractive',
371
- '-ExecutionPolicy',
372
- 'Bypass',
373
- '-EncodedCommand',
374
- encodedCommand,
375
- ],
376
- {encoding: 'utf8'},
377
- );
378
-
379
- const progId = stdout.trim();
380
-
381
- // Map ProgId to browser IDs
382
- const browserMap = {
383
- ChromeHTML: 'com.google.chrome',
384
- MSEdgeHTM: 'com.microsoft.edge',
385
- FirefoxURL: 'org.mozilla.firefox',
386
- };
387
-
388
- return browserMap[progId] ? {id: browserMap[progId]} : {};
389
- }
390
-
391
- const pTryEach = async (array, mapper) => {
392
- let latestError;
393
-
394
- for (const item of array) {
395
- try {
396
- return await mapper(item); // eslint-disable-line no-await-in-loop
397
- } catch (error) {
398
- latestError = error;
399
- }
400
- }
401
-
402
- throw latestError;
403
- };
404
-
405
- const baseOpen = async options => {
406
- options = {
407
- wait: false,
408
- background: false,
409
- newInstance: false,
410
- allowNonzeroExitCode: false,
411
- ...options,
412
- };
413
-
414
- if (Array.isArray(options.app)) {
415
- return pTryEach(options.app, singleApp => baseOpen({
416
- ...options,
417
- app: singleApp,
418
- }));
419
- }
420
-
421
- let {name: app, arguments: appArguments = []} = options.app ?? {};
422
- appArguments = [...appArguments];
423
-
424
- if (Array.isArray(app)) {
425
- return pTryEach(app, appName => baseOpen({
426
- ...options,
427
- app: {
428
- name: appName,
429
- arguments: appArguments,
430
- },
431
- }));
432
- }
433
-
434
- if (app === 'browser' || app === 'browserPrivate') {
435
- // IDs from default-browser for macOS and windows are the same
436
- const ids = {
437
- 'com.google.chrome': 'chrome',
438
- 'google-chrome.desktop': 'chrome',
439
- 'org.mozilla.firefox': 'firefox',
440
- 'firefox.desktop': 'firefox',
441
- 'com.microsoft.msedge': 'edge',
442
- 'com.microsoft.edge': 'edge',
443
- 'com.microsoft.edgemac': 'edge',
444
- 'microsoft-edge.desktop': 'edge',
445
- };
446
-
447
- // Incognito flags for each browser in `apps`.
448
- const flags = {
449
- chrome: '--incognito',
450
- firefox: '--private-window',
451
- edge: '--inPrivate',
452
- };
453
-
454
- const browser = is_wsl ? await getWindowsDefaultBrowserFromWsl() : await default_browser_defaultBrowser();
455
- if (browser.id in ids) {
456
- const browserName = ids[browser.id];
457
-
458
- if (app === 'browserPrivate') {
459
- appArguments.push(flags[browserName]);
460
- }
461
-
462
- return baseOpen({
463
- ...options,
464
- app: {
465
- name: apps[browserName],
466
- arguments: appArguments,
467
- },
468
- });
469
- }
470
-
471
- throw new Error(`${browser.name} is not supported as a default browser`);
472
- }
473
-
474
- let command;
475
- const cliArguments = [];
476
- const childProcessOptions = {};
477
-
478
- if (platform === 'darwin') {
479
- command = 'open';
480
-
481
- if (options.wait) {
482
- cliArguments.push('--wait-apps');
483
- }
484
-
485
- if (options.background) {
486
- cliArguments.push('--background');
487
- }
488
-
489
- if (options.newInstance) {
490
- cliArguments.push('--new');
491
- }
492
-
493
- if (app) {
494
- cliArguments.push('-a', app);
495
- }
496
- } else if (platform === 'win32' || (is_wsl && !isInsideContainer() && !app)) {
497
- command = is_wsl
498
- ? await getPowershellPathFromWsl()
499
- : `${external_node_process_.env.SYSTEMROOT || external_node_process_.env.windir || 'C:\\Windows'}\\System32\\WindowsPowerShell\\v1.0\\powershell`;
500
-
501
- cliArguments.push(
502
- '-NoProfile',
503
- '-NonInteractive',
504
- '-ExecutionPolicy',
505
- 'Bypass',
506
- '-EncodedCommand',
507
- );
508
-
509
- if (!is_wsl) {
510
- childProcessOptions.windowsVerbatimArguments = true;
511
- }
512
-
513
- const encodedArguments = ['Start'];
514
-
515
- if (options.wait) {
516
- encodedArguments.push('-Wait');
517
- }
518
-
519
- if (app) {
520
- // Double quote with double quotes to ensure the inner quotes are passed through.
521
- // Inner quotes are delimited for PowerShell interpretation with backticks.
522
- encodedArguments.push(`"\`"${app}\`""`);
523
- if (options.target) {
524
- appArguments.push(options.target);
525
- }
526
- } else if (options.target) {
527
- encodedArguments.push(`"${options.target}"`);
528
- }
529
-
530
- if (appArguments.length > 0) {
531
- appArguments = appArguments.map(argument => `"\`"${argument}\`""`);
532
- encodedArguments.push('-ArgumentList', appArguments.join(','));
533
- }
534
-
535
- // Using Base64-encoded command, accepted by PowerShell, to allow special characters.
536
- options.target = external_node_buffer_.Buffer.from(encodedArguments.join(' '), 'utf16le').toString('base64');
537
- } else {
538
- if (app) {
539
- command = app;
540
- } else {
541
- // When bundled by Webpack, there's no actual package file path and no local `xdg-open`.
542
- const isBundled = !open_dirname || open_dirname === '/';
543
-
544
- // Check if local `xdg-open` exists and is executable.
545
- let exeLocalXdgOpen = false;
546
- try {
547
- await promises_.access(localXdgOpenPath, promises_.constants.X_OK);
548
- exeLocalXdgOpen = true;
549
- } catch {}
550
-
551
- const useSystemXdgOpen = external_node_process_.versions.electron
552
- ?? (platform === 'android' || isBundled || !exeLocalXdgOpen);
553
- command = useSystemXdgOpen ? 'xdg-open' : localXdgOpenPath;
554
- }
555
-
556
- if (appArguments.length > 0) {
557
- cliArguments.push(...appArguments);
558
- }
559
-
560
- if (!options.wait) {
561
- // `xdg-open` will block the process unless stdio is ignored
562
- // and it's detached from the parent even if it's unref'd.
563
- childProcessOptions.stdio = 'ignore';
564
- childProcessOptions.detached = true;
565
- }
566
- }
567
-
568
- if (platform === 'darwin' && appArguments.length > 0) {
569
- cliArguments.push('--args', ...appArguments);
570
- }
571
-
572
- // This has to come after `--args`.
573
- if (options.target) {
574
- cliArguments.push(options.target);
575
- }
576
-
577
- const subprocess = external_node_child_process_.spawn(command, cliArguments, childProcessOptions);
578
-
579
- if (options.wait) {
580
- return new Promise((resolve, reject) => {
581
- subprocess.once('error', reject);
582
-
583
- subprocess.once('close', exitCode => {
584
- if (!options.allowNonzeroExitCode && exitCode > 0) {
585
- reject(new Error(`Exited with code ${exitCode}`));
586
- return;
587
- }
588
-
589
- resolve(subprocess);
590
- });
591
- });
592
- }
593
-
594
- subprocess.unref();
595
-
596
- return subprocess;
597
- };
598
-
599
- const open_open = (target, options) => {
600
- if (typeof target !== 'string') {
601
- throw new TypeError('Expected a `target`');
602
- }
603
-
604
- return baseOpen({
605
- ...options,
606
- target,
607
- });
608
- };
609
-
610
- const openApp = (name, options) => {
611
- if (typeof name !== 'string' && !Array.isArray(name)) {
612
- throw new TypeError('Expected a valid `name`');
613
- }
614
-
615
- const {arguments: appArguments = []} = options ?? {};
616
- if (appArguments !== undefined && appArguments !== null && !Array.isArray(appArguments)) {
617
- throw new TypeError('Expected `appArguments` as Array type');
618
- }
619
-
620
- return baseOpen({
621
- ...options,
622
- app: {
623
- name,
624
- arguments: appArguments,
625
- },
626
- });
627
- };
628
-
629
- function detectArchBinary(binary) {
630
- if (typeof binary === 'string' || Array.isArray(binary)) {
631
- return binary;
632
- }
633
-
634
- const {[arch]: archBinary} = binary;
635
-
636
- if (!archBinary) {
637
- throw new Error(`${arch} is not supported`);
638
- }
639
-
640
- return archBinary;
641
- }
642
-
643
- function detectPlatformBinary({[platform]: platformBinary}, {wsl}) {
644
- if (wsl && is_wsl) {
645
- return detectArchBinary(wsl);
646
- }
647
-
648
- if (!platformBinary) {
649
- throw new Error(`${platform} is not supported`);
650
- }
651
-
652
- return detectArchBinary(platformBinary);
653
- }
654
-
655
- const apps = {};
656
-
657
- defineLazyProperty(apps, 'chrome', () => detectPlatformBinary({
658
- darwin: 'google chrome',
659
- win32: 'chrome',
660
- linux: ['google-chrome', 'google-chrome-stable', 'chromium'],
661
- }, {
662
- wsl: {
663
- ia32: '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe',
664
- x64: ['/mnt/c/Program Files/Google/Chrome/Application/chrome.exe', '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'],
665
- },
666
- }));
667
-
668
- defineLazyProperty(apps, 'firefox', () => detectPlatformBinary({
669
- darwin: 'firefox',
670
- win32: 'C:\\Program Files\\Mozilla Firefox\\firefox.exe',
671
- linux: 'firefox',
672
- }, {
673
- wsl: '/mnt/c/Program Files/Mozilla Firefox/firefox.exe',
674
- }));
675
-
676
- defineLazyProperty(apps, 'edge', () => detectPlatformBinary({
677
- darwin: 'microsoft edge',
678
- win32: 'msedge',
679
- linux: ['microsoft-edge', 'microsoft-edge-dev'],
680
- }, {
681
- wsl: '/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe',
682
- }));
683
-
684
- defineLazyProperty(apps, 'browser', () => 'browser');
685
-
686
- defineLazyProperty(apps, 'browserPrivate', () => 'browserPrivate');
687
-
688
- /* harmony default export */ const node_modules_open = (open_open);
689
-
690
-
691
- /***/ })
692
-
693
- }]);