extension-develop 2.0.1 → 2.0.3
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 +26 -0
- package/dist/extensions/chrome-manager-extension/define-initial-tab.js +11 -1
- package/dist/extensions/chromium-based-manager-extension/define-initial-tab.js +11 -1
- package/dist/extensions/edge-manager-extension/define-initial-tab.js +11 -1
- package/dist/extensions/firefox-manager-extension/define-initial-tab.js +6 -2
- package/dist/extensions/gecko-based-manager-extension/define-initial-tab.js +6 -2
- package/dist/inject-chromium-client-loader.js +2 -0
- package/dist/inject-firefox-client-loader.js +2 -0
- package/dist/module.js +291 -131
- package/dist/webpack/webpack-lib/utils.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -150,6 +150,32 @@ Options accepted by each command. Values shown are typical types or enumerations
|
|
|
150
150
|
- browser.chrome | .firefox | .edge | .chromium-based | .gecko-based: launch flags, excluded flags, preferences, binaries, and profile reuse.
|
|
151
151
|
- When detected, a one‑time notice is printed to indicate config is active.
|
|
152
152
|
|
|
153
|
+
### Environment variables in `extension.config.*`
|
|
154
|
+
|
|
155
|
+
- `extension.config.*` runs in a Node context during command startup.
|
|
156
|
+
- Use `process.env.*` to read environment variables inside the config file.
|
|
157
|
+
- `import.meta.env.*` is available in your extension code at bundle time (via the Env plugin), not in the Node config.
|
|
158
|
+
- During config loading, develop preloads environment files from the project directory into `process.env` using the following order (first match wins):
|
|
159
|
+
1. `.env.defaults` (always merged first when present)
|
|
160
|
+
2. `.env.development`
|
|
161
|
+
3. `.env.local`
|
|
162
|
+
4. `.env`
|
|
163
|
+
- Only variables you read explicitly in the config are used there; client-side injection still requires the `EXTENSION_PUBLIC_*` prefix.
|
|
164
|
+
- Example:
|
|
165
|
+
|
|
166
|
+
```js
|
|
167
|
+
// extension.config.js (Node-based)
|
|
168
|
+
export default {
|
|
169
|
+
browser: {
|
|
170
|
+
chrome: {
|
|
171
|
+
startingUrl:
|
|
172
|
+
process.env.EXTENSION_PUBLIC_START_URL || 'https://example.com'
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
config: (config) => config
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
153
179
|
## Safety and ergonomics
|
|
154
180
|
|
|
155
181
|
- Managed dependency guard: If your `extension.config.*` references dependencies that are managed by Extension.js itself, the command aborts with a detailed message to prevent version conflicts.
|
|
@@ -60,7 +60,17 @@ export async function handleFirstRun() {
|
|
|
60
60
|
return
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
// Guard against opening multiple welcome pages
|
|
64
|
+
chrome.tabs.query(
|
|
65
|
+
{url: chrome.runtime.getURL('pages/welcome.html')},
|
|
66
|
+
(tabs) => {
|
|
67
|
+
if (Array.isArray(tabs) && tabs.length > 0) {
|
|
68
|
+
// Already open; do not create another
|
|
69
|
+
return
|
|
70
|
+
}
|
|
71
|
+
chrome.tabs.create({url: 'pages/welcome.html'})
|
|
72
|
+
}
|
|
73
|
+
)
|
|
64
74
|
// Ensure the welcome page shows only once per extension installation
|
|
65
75
|
chrome.storage.local.set({[devExtension.id]: {didRun: true}})
|
|
66
76
|
})
|
|
@@ -60,7 +60,17 @@ export async function handleFirstRun() {
|
|
|
60
60
|
return
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
// Guard against opening multiple welcome pages
|
|
64
|
+
chrome.tabs.query(
|
|
65
|
+
{url: chrome.runtime.getURL('pages/welcome.html')},
|
|
66
|
+
(tabs) => {
|
|
67
|
+
if (Array.isArray(tabs) && tabs.length > 0) {
|
|
68
|
+
// Already open; do not create another
|
|
69
|
+
return
|
|
70
|
+
}
|
|
71
|
+
chrome.tabs.create({url: 'pages/welcome.html'})
|
|
72
|
+
}
|
|
73
|
+
)
|
|
64
74
|
// Ensure the welcome page shows only once per extension installation
|
|
65
75
|
chrome.storage.local.set({[devExtension.id]: {didRun: true}})
|
|
66
76
|
})
|
|
@@ -60,7 +60,17 @@ export async function handleFirstRun() {
|
|
|
60
60
|
return
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
// Guard against opening multiple welcome pages
|
|
64
|
+
chrome.tabs.query(
|
|
65
|
+
{url: chrome.runtime.getURL('pages/welcome.html')},
|
|
66
|
+
(tabs) => {
|
|
67
|
+
if (Array.isArray(tabs) && tabs.length > 0) {
|
|
68
|
+
// Already open; do not create another
|
|
69
|
+
return
|
|
70
|
+
}
|
|
71
|
+
chrome.tabs.create({url: 'pages/welcome.html'})
|
|
72
|
+
}
|
|
73
|
+
)
|
|
64
74
|
// Ensure the welcome page shows only once per extension installation
|
|
65
75
|
chrome.storage.local.set({[devExtension.id]: {didRun: true}})
|
|
66
76
|
})
|
|
@@ -49,8 +49,12 @@ async function handleFirstRun() {
|
|
|
49
49
|
return
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
// Open the welcome page
|
|
53
|
-
|
|
52
|
+
// Open the welcome page only if not already open
|
|
53
|
+
const welcomeUrl = browser.runtime.getURL('./pages/welcome.html')
|
|
54
|
+
const existingWelcome = await browser.tabs.query({url: welcomeUrl})
|
|
55
|
+
if (!existingWelcome || existingWelcome.length === 0) {
|
|
56
|
+
await browser.tabs.create({url: './pages/welcome.html'})
|
|
57
|
+
}
|
|
54
58
|
|
|
55
59
|
// Ensure the welcome page shows only once per extension installation
|
|
56
60
|
await browser.storage.local.set({[devExtension.id]: {didRun: true}})
|
|
@@ -51,8 +51,12 @@ export async function handleFirstRun() {
|
|
|
51
51
|
return
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
// Open the welcome page
|
|
55
|
-
|
|
54
|
+
// Open the welcome page only if not already open
|
|
55
|
+
const welcomeUrl = browser.runtime.getURL('./pages/welcome.html')
|
|
56
|
+
const existingWelcome = await browser.tabs.query({url: welcomeUrl})
|
|
57
|
+
if (!existingWelcome || existingWelcome.length === 0) {
|
|
58
|
+
await browser.tabs.create({url: './pages/welcome.html'})
|
|
59
|
+
}
|
|
56
60
|
|
|
57
61
|
// Ensure the welcome page shows only once per extension installation
|
|
58
62
|
await browser.storage.local.set({[devExtension.id]: {didRun: true}})
|
|
@@ -30,6 +30,8 @@ const external_path_namespaceObject = require("path");
|
|
|
30
30
|
const external_fs_namespaceObject = require("fs");
|
|
31
31
|
const external_loader_utils_namespaceObject = require("loader-utils");
|
|
32
32
|
const external_schema_utils_namespaceObject = require("schema-utils");
|
|
33
|
+
require("os");
|
|
34
|
+
require("crypto");
|
|
33
35
|
require("child_process");
|
|
34
36
|
require("package-manager-detector");
|
|
35
37
|
require("pintor");
|
|
@@ -30,6 +30,8 @@ const external_path_namespaceObject = require("path");
|
|
|
30
30
|
const external_fs_namespaceObject = require("fs");
|
|
31
31
|
const external_loader_utils_namespaceObject = require("loader-utils");
|
|
32
32
|
const external_schema_utils_namespaceObject = require("schema-utils");
|
|
33
|
+
require("os");
|
|
34
|
+
require("crypto");
|
|
33
35
|
require("child_process");
|
|
34
36
|
require("package-manager-detector");
|
|
35
37
|
require("pintor");
|
package/dist/module.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
|
|
3
|
+
return 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
4
|
+
}();
|
|
2
5
|
var __webpack_modules__ = {
|
|
3
6
|
"./webpack/plugin-browsers/browsers-lib/add-progress-bar.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4
7
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -226,12 +229,12 @@ var __webpack_modules__ = {
|
|
|
226
229
|
__webpack_require__.d(__webpack_exports__, {
|
|
227
230
|
InstanceManager: ()=>InstanceManager
|
|
228
231
|
});
|
|
229
|
-
var
|
|
230
|
-
var
|
|
231
|
-
|
|
232
|
-
var
|
|
233
|
-
var
|
|
234
|
-
var
|
|
232
|
+
var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("fs/promises");
|
|
233
|
+
var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("path");
|
|
234
|
+
var os__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("os");
|
|
235
|
+
var crypto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("crypto");
|
|
236
|
+
var net__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("net");
|
|
237
|
+
var _webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./webpack/webpack-lib/messages.ts");
|
|
235
238
|
function _define_property(obj, key, value) {
|
|
236
239
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
237
240
|
value: value,
|
|
@@ -248,21 +251,21 @@ var __webpack_modules__ = {
|
|
|
248
251
|
const isWSL = process.env.WSL_DISTRO_NAME || process.env.WSLENV;
|
|
249
252
|
switch(platform){
|
|
250
253
|
case 'darwin':
|
|
251
|
-
return
|
|
254
|
+
return path__WEBPACK_IMPORTED_MODULE_1__.join(os__WEBPACK_IMPORTED_MODULE_2__.homedir(), 'Library', 'Application Support', 'extension-js');
|
|
252
255
|
case 'win32':
|
|
253
|
-
return
|
|
256
|
+
return path__WEBPACK_IMPORTED_MODULE_1__.join(process.env.APPDATA || '', 'extension-js');
|
|
254
257
|
case 'linux':
|
|
255
258
|
if (isWSL) {
|
|
256
259
|
const windowsAppData = process.env.APPDATA;
|
|
257
|
-
if (windowsAppData) return
|
|
260
|
+
if (windowsAppData) return path__WEBPACK_IMPORTED_MODULE_1__.join(windowsAppData, 'extension-js');
|
|
258
261
|
}
|
|
259
|
-
return
|
|
262
|
+
return path__WEBPACK_IMPORTED_MODULE_1__.join(os__WEBPACK_IMPORTED_MODULE_2__.homedir(), '.config', 'extension-js');
|
|
260
263
|
default:
|
|
261
|
-
return
|
|
264
|
+
return path__WEBPACK_IMPORTED_MODULE_1__.join(os__WEBPACK_IMPORTED_MODULE_2__.homedir(), '.extension-js');
|
|
262
265
|
}
|
|
263
266
|
}
|
|
264
267
|
generateInstanceId() {
|
|
265
|
-
return
|
|
268
|
+
return crypto__WEBPACK_IMPORTED_MODULE_3__.randomBytes(8).toString('hex');
|
|
266
269
|
}
|
|
267
270
|
generateManagerExtensionId() {
|
|
268
271
|
const chars = 'abcdefghijklmnopqrstuvwxyz';
|
|
@@ -271,11 +274,11 @@ var __webpack_modules__ = {
|
|
|
271
274
|
return result;
|
|
272
275
|
}
|
|
273
276
|
async ensureRegistryDir() {
|
|
274
|
-
const dir =
|
|
277
|
+
const dir = path__WEBPACK_IMPORTED_MODULE_1__.dirname(this.registryPath);
|
|
275
278
|
try {
|
|
276
|
-
await
|
|
279
|
+
await fs_promises__WEBPACK_IMPORTED_MODULE_0__.access(dir);
|
|
277
280
|
} catch {
|
|
278
|
-
await
|
|
281
|
+
await fs_promises__WEBPACK_IMPORTED_MODULE_0__.mkdir(dir, {
|
|
279
282
|
recursive: true
|
|
280
283
|
});
|
|
281
284
|
}
|
|
@@ -283,7 +286,7 @@ var __webpack_modules__ = {
|
|
|
283
286
|
async loadRegistry() {
|
|
284
287
|
try {
|
|
285
288
|
await this.ensureRegistryDir();
|
|
286
|
-
const data = await
|
|
289
|
+
const data = await fs_promises__WEBPACK_IMPORTED_MODULE_0__.readFile(this.registryPath, 'utf-8');
|
|
287
290
|
return JSON.parse(data);
|
|
288
291
|
} catch {
|
|
289
292
|
return {
|
|
@@ -296,16 +299,16 @@ var __webpack_modules__ = {
|
|
|
296
299
|
try {
|
|
297
300
|
await this.ensureRegistryDir();
|
|
298
301
|
const data = JSON.stringify(registry, null, 2);
|
|
299
|
-
await
|
|
300
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
302
|
+
await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(this.registryPath, data);
|
|
303
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.xc(this.registryPath));
|
|
301
304
|
} catch (error) {
|
|
302
|
-
if ('development' === process.env.EXTENSION_ENV) console.error(
|
|
305
|
+
if ('development' === process.env.EXTENSION_ENV) console.error(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.b9(error));
|
|
303
306
|
throw error;
|
|
304
307
|
}
|
|
305
308
|
}
|
|
306
309
|
async isPortAvailable(port) {
|
|
307
310
|
const check = (host)=>new Promise((resolve)=>{
|
|
308
|
-
const server =
|
|
311
|
+
const server = net__WEBPACK_IMPORTED_MODULE_4__.createServer();
|
|
309
312
|
const complete = (result)=>{
|
|
310
313
|
try {
|
|
311
314
|
server.close(()=>resolve(result));
|
|
@@ -345,25 +348,25 @@ var __webpack_modules__ = {
|
|
|
345
348
|
const usedPorts = existingInstances.filter((instance)=>'running' === instance.status).map((instance)=>instance.port);
|
|
346
349
|
const usedWebSocketPorts = existingInstances.filter((instance)=>'running' === instance.status).map((instance)=>instance.webSocketPort);
|
|
347
350
|
if ('development' === process.env.EXTENSION_ENV) {
|
|
348
|
-
console.log(
|
|
349
|
-
console.log(
|
|
351
|
+
console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.EP(usedPorts));
|
|
352
|
+
console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.Hh(usedWebSocketPorts));
|
|
350
353
|
}
|
|
351
354
|
if (requestedPort) {
|
|
352
355
|
const isPortAvailable = await this.isPortAvailable(requestedPort);
|
|
353
356
|
if (isPortAvailable && !usedPorts.includes(requestedPort)) {
|
|
354
357
|
const webSocketPort = await this.findAvailableWebSocketPort(usedWebSocketPorts);
|
|
355
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
358
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.G(requestedPort, webSocketPort));
|
|
356
359
|
return {
|
|
357
360
|
port: requestedPort,
|
|
358
361
|
webSocketPort
|
|
359
362
|
};
|
|
360
363
|
}
|
|
361
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
364
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.S8(requestedPort));
|
|
362
365
|
}
|
|
363
366
|
let port = this.basePort;
|
|
364
367
|
while(usedPorts.includes(port) || !await this.isPortAvailable(port))port++;
|
|
365
368
|
const webSocketPort = await this.findAvailableWebSocketPort(usedWebSocketPorts);
|
|
366
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
369
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__._Z(port, webSocketPort));
|
|
367
370
|
return {
|
|
368
371
|
port,
|
|
369
372
|
webSocketPort
|
|
@@ -383,18 +386,18 @@ var __webpack_modules__ = {
|
|
|
383
386
|
if ('terminated' === instance.status || 'error' === instance.status || now - instance.startTime > maxAge) shouldRemove = true;
|
|
384
387
|
else if (await this.isProcessRunning(instance.processId)) {
|
|
385
388
|
if (await this.isPortAvailable(instance.port) && await this.isPortAvailable(instance.webSocketPort)) {
|
|
386
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
389
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.Y_(instanceId, instance.port, instance.webSocketPort));
|
|
387
390
|
shouldRemove = true;
|
|
388
391
|
}
|
|
389
392
|
} else {
|
|
390
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
393
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.jQ(instanceId, instance.processId));
|
|
391
394
|
shouldRemove = true;
|
|
392
395
|
}
|
|
393
396
|
if (shouldRemove) instancesToRemove.push(instanceId);
|
|
394
397
|
}
|
|
395
398
|
for (const instanceId of instancesToRemove){
|
|
396
399
|
delete registry.instances[instanceId];
|
|
397
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
400
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.Hl(instanceId));
|
|
398
401
|
}
|
|
399
402
|
registry.lastCleanup = now;
|
|
400
403
|
}
|
|
@@ -409,7 +412,7 @@ var __webpack_modules__ = {
|
|
|
409
412
|
async monitorProcessHealth(instanceId) {
|
|
410
413
|
const instance = await this.getInstance(instanceId);
|
|
411
414
|
if (!instance) return;
|
|
412
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
415
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.oN(instanceId));
|
|
413
416
|
const healthCheck = setInterval(async ()=>{
|
|
414
417
|
try {
|
|
415
418
|
const isHealthy = await this.isProcessRunning(instance.processId);
|
|
@@ -417,13 +420,13 @@ var __webpack_modules__ = {
|
|
|
417
420
|
const isCurrentProcess = instance.processId === process.pid;
|
|
418
421
|
const definitelyOrphaned = !isCurrentProcess && !isHealthy && !portsInUse;
|
|
419
422
|
if (definitelyOrphaned) {
|
|
420
|
-
console.log(
|
|
423
|
+
console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.zd(instanceId));
|
|
421
424
|
await this.terminateInstance(instanceId);
|
|
422
425
|
clearInterval(healthCheck);
|
|
423
426
|
this.healthChecks.delete(instanceId);
|
|
424
|
-
} else if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
427
|
+
} else if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.IV(instanceId));
|
|
425
428
|
} catch (error) {
|
|
426
|
-
console.error(
|
|
429
|
+
console.error(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.Es(instanceId, error));
|
|
427
430
|
clearInterval(healthCheck);
|
|
428
431
|
this.healthChecks.delete(instanceId);
|
|
429
432
|
}
|
|
@@ -436,32 +439,32 @@ var __webpack_modules__ = {
|
|
|
436
439
|
return portInUse || webSocketPortInUse;
|
|
437
440
|
}
|
|
438
441
|
async forceCleanupProjectProcesses(projectPath) {
|
|
439
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
442
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.r6(projectPath));
|
|
440
443
|
const registry = await this.loadRegistry();
|
|
441
444
|
const projectInstances = Object.values(registry.instances).filter((instance)=>instance.projectPath === projectPath);
|
|
442
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
445
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.dQ(projectInstances.length));
|
|
443
446
|
for (const instance of projectInstances)try {
|
|
444
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
447
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.j4(instance.instanceId));
|
|
445
448
|
if (await this.isProcessRunning(instance.processId)) {
|
|
446
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
449
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.qb(instance.processId));
|
|
447
450
|
process.kill(instance.processId, 'SIGTERM');
|
|
448
451
|
setTimeout(()=>{
|
|
449
452
|
try {
|
|
450
453
|
process.kill(instance.processId, 'SIGKILL');
|
|
451
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
454
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.o2(instance.processId));
|
|
452
455
|
} catch (error) {}
|
|
453
456
|
}, 3000);
|
|
454
457
|
}
|
|
455
458
|
instance.status = 'terminated';
|
|
456
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
459
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.J9(instance.instanceId));
|
|
457
460
|
} catch (error) {
|
|
458
|
-
if ('development' === process.env.EXTENSION_ENV) console.error(
|
|
461
|
+
if ('development' === process.env.EXTENSION_ENV) console.error(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.Wc(instance.instanceId, error));
|
|
459
462
|
}
|
|
460
463
|
await this.saveRegistry(registry);
|
|
461
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
464
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.JJ());
|
|
462
465
|
}
|
|
463
466
|
async createInstance(browser, projectPath, requestedPort) {
|
|
464
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
467
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.jE({
|
|
465
468
|
browser,
|
|
466
469
|
projectPath,
|
|
467
470
|
requestedPort
|
|
@@ -481,12 +484,12 @@ var __webpack_modules__ = {
|
|
|
481
484
|
startTime: Date.now(),
|
|
482
485
|
status: 'running',
|
|
483
486
|
processId: process.pid,
|
|
484
|
-
profilePath:
|
|
487
|
+
profilePath: path__WEBPACK_IMPORTED_MODULE_1__.join(os__WEBPACK_IMPORTED_MODULE_2__.tmpdir(), `extension-js-${instanceId}`)
|
|
485
488
|
};
|
|
486
489
|
registry.instances[instanceId] = instance;
|
|
487
490
|
await this.saveRegistry(registry);
|
|
488
491
|
await this.monitorProcessHealth(instanceId);
|
|
489
|
-
if ('development' === process.env.EXTENSION_ENV) console.log(
|
|
492
|
+
if ('development' === process.env.EXTENSION_ENV) console.log(_webpack_webpack_lib_messages__WEBPACK_IMPORTED_MODULE_5__.pU(registry));
|
|
490
493
|
return instance;
|
|
491
494
|
}
|
|
492
495
|
async updateInstance(instanceId, updates) {
|
|
@@ -569,7 +572,7 @@ var __webpack_modules__ = {
|
|
|
569
572
|
_define_property(this, "healthChecks", new Map());
|
|
570
573
|
this.basePort = basePort;
|
|
571
574
|
this.baseWebSocketPort = baseWebSocketPort;
|
|
572
|
-
this.registryPath =
|
|
575
|
+
this.registryPath = path__WEBPACK_IMPORTED_MODULE_1__.join(this.getDataDirectory(), 'instances.json');
|
|
573
576
|
}
|
|
574
577
|
}
|
|
575
578
|
},
|
|
@@ -3052,28 +3055,28 @@ var __webpack_modules__ = {
|
|
|
3052
3055
|
yz: ()=>portManagerErrorAllocatingPorts,
|
|
3053
3056
|
zd: ()=>instanceManagerHealthMonitoringOrphaned
|
|
3054
3057
|
});
|
|
3055
|
-
var
|
|
3056
|
-
var
|
|
3057
|
-
var
|
|
3058
|
+
var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("path");
|
|
3059
|
+
var pintor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("pintor");
|
|
3060
|
+
var pintor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/ __webpack_require__.n(pintor__WEBPACK_IMPORTED_MODULE_1__);
|
|
3058
3061
|
var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./webpack/webpack-lib/constants.ts");
|
|
3059
3062
|
function getLoggingPrefix(feature, type) {
|
|
3060
|
-
if ('error' === type) return `${
|
|
3061
|
-
if ('warn' === type) return `${
|
|
3062
|
-
const arrow = 'info' === type ?
|
|
3063
|
+
if ('error' === type) return `${pintor__WEBPACK_IMPORTED_MODULE_1___default().red('ERROR')} ${feature}`;
|
|
3064
|
+
if ('warn' === type) return `${pintor__WEBPACK_IMPORTED_MODULE_1___default().brightYellow("\u25BA\u25BA\u25BA")} ${feature}`;
|
|
3065
|
+
const arrow = 'info' === type ? pintor__WEBPACK_IMPORTED_MODULE_1___default().blue("\u25BA\u25BA\u25BA") : pintor__WEBPACK_IMPORTED_MODULE_1___default().green("\u25BA\u25BA\u25BA");
|
|
3063
3066
|
return `${arrow} ${feature}`;
|
|
3064
3067
|
}
|
|
3065
3068
|
function boring(manifestName, duration, stats) {
|
|
3066
3069
|
let didShow = false;
|
|
3067
3070
|
if (!didShow) {
|
|
3068
|
-
const arrow = stats.hasErrors() ?
|
|
3069
|
-
return `${arrow} ${manifestName} compiled ${stats.hasErrors() ?
|
|
3071
|
+
const arrow = stats.hasErrors() ? pintor__WEBPACK_IMPORTED_MODULE_1___default().red("\u25BA\u25BA\u25BA") : pintor__WEBPACK_IMPORTED_MODULE_1___default().blue("\u25BA\u25BA\u25BA");
|
|
3072
|
+
return `${arrow} ${manifestName} compiled ${stats.hasErrors() ? pintor__WEBPACK_IMPORTED_MODULE_1___default().red('with errors') : pintor__WEBPACK_IMPORTED_MODULE_1___default().green('successfully')} in ${duration} ms.`;
|
|
3070
3073
|
}
|
|
3071
3074
|
}
|
|
3072
3075
|
function integrationNotInstalled(integration, packageManager) {
|
|
3073
|
-
return `${getLoggingPrefix(integration, 'info')} Using ${integration}. Installing required dependencies via ${
|
|
3076
|
+
return `${getLoggingPrefix(integration, 'info')} Using ${integration}. Installing required dependencies via ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(packageManager)}...`;
|
|
3074
3077
|
}
|
|
3075
3078
|
function isUsingIntegration(integration) {
|
|
3076
|
-
return `${
|
|
3079
|
+
return `${pintor__WEBPACK_IMPORTED_MODULE_1___default().blue("\u25BA\u25BA\u25BA")} Using ${pintor__WEBPACK_IMPORTED_MODULE_1___default().brightBlue(integration)}...`;
|
|
3077
3080
|
}
|
|
3078
3081
|
function youAreAllSet(integration) {
|
|
3079
3082
|
return `${getLoggingPrefix(integration, 'success')} installation completed. Run the program again and happy hacking.`;
|
|
@@ -3082,14 +3085,14 @@ var __webpack_modules__ = {
|
|
|
3082
3085
|
return `${getLoggingPrefix(integration, 'info')} dependencies are being installed. This only happens for core contributors...`;
|
|
3083
3086
|
}
|
|
3084
3087
|
function integrationInstalledSuccessfully(integration) {
|
|
3085
|
-
return `${getLoggingPrefix(integration, 'success')} dependencies installed ${
|
|
3088
|
+
return `${getLoggingPrefix(integration, 'success')} dependencies installed ${pintor__WEBPACK_IMPORTED_MODULE_1___default().green('successfully')}.`;
|
|
3086
3089
|
}
|
|
3087
3090
|
function failedToInstallIntegration(integration, error) {
|
|
3088
|
-
return `${getLoggingPrefix('Integration', 'error')} ${
|
|
3091
|
+
return `${getLoggingPrefix('Integration', 'error')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(integration)} Installation Error\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red('Failed to detect package manager or install dependencies.')}\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red(String(error ?? ''))}`;
|
|
3089
3092
|
}
|
|
3090
3093
|
function fileNotFound(errorSourcePath, missingFilePath) {
|
|
3091
3094
|
if (!errorSourcePath) throw new Error('This operation is impossible. Please report a bug.');
|
|
3092
|
-
switch(
|
|
3095
|
+
switch(path__WEBPACK_IMPORTED_MODULE_0__.extname(missingFilePath)){
|
|
3093
3096
|
case '.js':
|
|
3094
3097
|
case '.ts':
|
|
3095
3098
|
case '.jsx':
|
|
@@ -3109,99 +3112,99 @@ var __webpack_modules__ = {
|
|
|
3109
3112
|
const contentIndex = manifestField.split('-')[1];
|
|
3110
3113
|
const isPage = manifestField.startsWith('pages');
|
|
3111
3114
|
const field = manifestName.includes("content_scripts") ? `(index ${contentIndex})\n\n` : manifestFieldName;
|
|
3112
|
-
return `${getLoggingPrefix('manifest.json', 'error')} File Not Found\n\n${isPage ? `Check the ${
|
|
3115
|
+
return `${getLoggingPrefix('manifest.json', 'error')} File Not Found\n\n${isPage ? `Check the ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('pages')} folder in your project root directory.\n\n` : `Check the ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow(field)} field in your ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('manifest.json')} file.\n\n`}${pintor__WEBPACK_IMPORTED_MODULE_1___default().red('NOT FOUND')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(filePath)}`;
|
|
3113
3116
|
}
|
|
3114
3117
|
function entryNotFoundWarn(manifestField, filePath) {
|
|
3115
|
-
return `File Not Found\n\nCheck the ${
|
|
3118
|
+
return `File Not Found\n\nCheck the ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow(manifestField)} field in your ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('manifest.json')} file.\n\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red('NOT FOUND')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(filePath)}`;
|
|
3116
3119
|
}
|
|
3117
3120
|
function manifestInvalidError(error) {
|
|
3118
|
-
return `${getLoggingPrefix('manifest.json', 'error')} Invalid Manifest\n\nUpdate your ${
|
|
3121
|
+
return `${getLoggingPrefix('manifest.json', 'error')} Invalid Manifest\n\nUpdate your ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('manifest.json')} file and try again.\n\n` + pintor__WEBPACK_IMPORTED_MODULE_1___default().red(error.toString());
|
|
3119
3122
|
}
|
|
3120
3123
|
function serverRestartRequiredFromManifestError(fileAdded, fileRemoved) {
|
|
3121
|
-
const fileRemovedText = fileRemoved ? `${
|
|
3122
|
-
const fileAddedText = fileAdded ? `${
|
|
3124
|
+
const fileRemovedText = fileRemoved ? `${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('PATH')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().red('REMOVED')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(fileRemoved)}\n` : '';
|
|
3125
|
+
const fileAddedText = fileAdded ? `${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('PATH')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().green('ADDED')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(fileAdded)}` : '';
|
|
3123
3126
|
return `${getLoggingPrefix('manifest.json', 'error')} Manifest Entry Point Modification\nChanging the path of HTML or script files in manifest.json after compilation requires a server restart.\n` + fileRemovedText + fileAddedText;
|
|
3124
3127
|
}
|
|
3125
3128
|
function serverRestartRequiredFromSpecialFolderError(addingOrRemoving, folder, typeOfAsset, pathRelative) {
|
|
3126
|
-
return `${getLoggingPrefix('manifest.json', 'error')} Manifest Entry Point Modification\n${
|
|
3129
|
+
return `${getLoggingPrefix('manifest.json', 'error')} Manifest Entry Point Modification\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(pathRelative)} in the ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(folder + '/')} folder after compilation requires a server restart.`;
|
|
3127
3130
|
}
|
|
3128
3131
|
function manifestNotFoundError(manifestName, manifestPath) {
|
|
3129
|
-
return `${getLoggingPrefix('manifest.json', 'error')} Manifest Not Found\n\nEnsure you have a ${
|
|
3132
|
+
return `${getLoggingPrefix('manifest.json', 'error')} Manifest Not Found\n\nEnsure you have a ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('manifest.json')} file at the root directory of your project.\n\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red('NOT FOUND')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(manifestPath)}`;
|
|
3130
3133
|
}
|
|
3131
3134
|
function creatingTSConfig() {
|
|
3132
|
-
return `${getLoggingPrefix('TypeScript', 'info')} is being used but no config file was found. Creating ${
|
|
3135
|
+
return `${getLoggingPrefix('TypeScript', 'info')} is being used but no config file was found. Creating ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('tsconfig.json')}...`;
|
|
3133
3136
|
}
|
|
3134
3137
|
function backgroundIsRequired(backgroundChunkName, filePath) {
|
|
3135
|
-
return `${getLoggingPrefix('manifest.json', 'error')} File Not Found\nCheck the ${
|
|
3138
|
+
return `${getLoggingPrefix('manifest.json', 'error')} File Not Found\nCheck the ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow(backgroundChunkName.replace('/', '.'))} field in your ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('manifest.json')} file.\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red('NOT FOUND')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(filePath)}`;
|
|
3136
3139
|
}
|
|
3137
3140
|
function serverRestartRequiredFromHtml(filePath) {
|
|
3138
|
-
return `${getLoggingPrefix('HTML', 'warn')} Entrypoint Change\nDetected changes to ${
|
|
3141
|
+
return `${getLoggingPrefix('HTML', 'warn')} Entrypoint Change\nDetected changes to ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow("<script>")} or ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('<link rel="stylesheet">')} references in HTML. The extension will undergo a full recompilation and a reload.\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('PATH')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(filePath)}`;
|
|
3139
3142
|
}
|
|
3140
3143
|
function javaScriptError(errorSourcePath, missingFilePath) {
|
|
3141
|
-
return `${getLoggingPrefix('HTML', 'error')} File Not Found\nCheck your ${
|
|
3144
|
+
return `${getLoggingPrefix('HTML', 'error')} File Not Found\nCheck your ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow("<script>")} tags in ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(errorSourcePath)}.\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red('NOT FOUND')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(missingFilePath)}`;
|
|
3142
3145
|
}
|
|
3143
3146
|
function cssError(errorSourcePath, missingFilePath) {
|
|
3144
|
-
return `${getLoggingPrefix('HTML', 'error')} File Not Found\nCheck your ${
|
|
3147
|
+
return `${getLoggingPrefix('HTML', 'error')} File Not Found\nCheck your ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('<link>')} tags in ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(errorSourcePath)}.\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red('NOT FOUND')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(missingFilePath)}`;
|
|
3145
3148
|
}
|
|
3146
3149
|
function staticAssetError(errorSourcePath, missingFilePath) {
|
|
3147
|
-
const extname =
|
|
3148
|
-
return `${getLoggingPrefix('HTML', 'warn')} File Not Found\nCheck your ${
|
|
3150
|
+
const extname = path__WEBPACK_IMPORTED_MODULE_0__.extname(missingFilePath);
|
|
3151
|
+
return `${getLoggingPrefix('HTML', 'warn')} File Not Found\nCheck your ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('*' + extname)} assets in ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(errorSourcePath)}.\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red('NOT FOUND')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(missingFilePath)}`;
|
|
3149
3152
|
}
|
|
3150
3153
|
function certRequired() {
|
|
3151
|
-
return `${
|
|
3154
|
+
return `${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('Note')}: Firefox requires a secure certificate for localhost connections, needed for the reloader to work.\nBy default, your ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('manifest.json')} file is not being watched. To enable this feature, run:\n\n npx -y ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('mkcert-cli')} \\\n ${pintor__WEBPACK_IMPORTED_MODULE_1___default().blue('--outDir')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(_constants__WEBPACK_IMPORTED_MODULE_2__.KI)} \\\n ${pintor__WEBPACK_IMPORTED_MODULE_1___default().blue('--cert')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('localhost.cert')} \\\n ${pintor__WEBPACK_IMPORTED_MODULE_1___default().blue('--key')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('localhost.key')}\n\nThis will enable the secure certificate needed for Firefox via ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('mkcert')}.\n\nLearn more about ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('mkcert')}: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline('https://github.com/FiloSottile/mkcert')}`;
|
|
3152
3155
|
}
|
|
3153
3156
|
function defaultPortInUse(port) {
|
|
3154
|
-
return `${getLoggingPrefix('Port', 'error')} Selected port ${
|
|
3157
|
+
return `${getLoggingPrefix('Port', 'error')} Selected port ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(port.toString())} in use. Choose a new port. `;
|
|
3155
3158
|
}
|
|
3156
3159
|
function portInUse(requestedPort, newPort) {
|
|
3157
|
-
return `${getLoggingPrefix('Port', 'warn')} Requested port ${
|
|
3160
|
+
return `${getLoggingPrefix('Port', 'warn')} Requested port ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(requestedPort.toString())} is in use; using ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(newPort.toString())} instead.`;
|
|
3158
3161
|
}
|
|
3159
3162
|
function noExtensionIdError() {
|
|
3160
|
-
return `${getLoggingPrefix('manifest.json', 'error')} Extension ID Not Defined\nFor MAIN world content_scripts, the extension ID must be specified.\nEnsure your extension have a fixed ID and that the ${
|
|
3163
|
+
return `${getLoggingPrefix('manifest.json', 'error')} Extension ID Not Defined\nFor MAIN world content_scripts, the extension ID must be specified.\nEnsure your extension have a fixed ID and that the ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('publicPath')}\nof your ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow('extension.config.js')} is defined as your extension URL.`;
|
|
3161
3164
|
}
|
|
3162
3165
|
function isUsingCustomLoader(file) {
|
|
3163
3166
|
const loaderName = file.split('.').shift() || 'custom';
|
|
3164
3167
|
const capitalizedLoaderName = loaderName.charAt(0).toUpperCase() + loaderName.slice(1);
|
|
3165
|
-
return `${getLoggingPrefix(capitalizedLoaderName, 'info')} Using custom loader configuration from ${
|
|
3168
|
+
return `${getLoggingPrefix(capitalizedLoaderName, 'info')} Using custom loader configuration from ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(file)}`;
|
|
3166
3169
|
}
|
|
3167
3170
|
function webextensionPolyfillNotFound() {
|
|
3168
|
-
return `${getLoggingPrefix('Warning', 'warn')} ${
|
|
3171
|
+
return `${getLoggingPrefix('Warning', 'warn')} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('webextension-polyfill')} not found. Browser API polyfill will not be available.\nTo fix this, install ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('webextension-polyfill')}: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().blue('npm install webextension-polyfill')}`;
|
|
3169
3172
|
}
|
|
3170
3173
|
function registrySaved(registryPath) {
|
|
3171
|
-
return `${getLoggingPrefix('Instance Manager', 'info')} registry saved to: ${
|
|
3174
|
+
return `${getLoggingPrefix('Instance Manager', 'info')} registry saved to: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(registryPath)}`;
|
|
3172
3175
|
}
|
|
3173
3176
|
function registrySaveError(error) {
|
|
3174
|
-
return `${getLoggingPrefix('Instance Manager', 'error')} error saving registry:\n${
|
|
3177
|
+
return `${getLoggingPrefix('Instance Manager', 'error')} error saving registry:\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red(String(error))}`;
|
|
3175
3178
|
}
|
|
3176
3179
|
function smartPortAllocationExistingPorts(usedPorts) {
|
|
3177
|
-
return `${getLoggingPrefix('Smart Port Allocation', 'info')} existing ports: ${
|
|
3180
|
+
return `${getLoggingPrefix('Smart Port Allocation', 'info')} existing ports: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(JSON.stringify(usedPorts))}`;
|
|
3178
3181
|
}
|
|
3179
3182
|
function smartPortAllocationExistingWebSocketPorts(usedWebSocketPorts) {
|
|
3180
|
-
return `${getLoggingPrefix('Smart Port Allocation', 'info')} existing WebSocket ports: ${
|
|
3183
|
+
return `${getLoggingPrefix('Smart Port Allocation', 'info')} existing WebSocket ports: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(JSON.stringify(usedWebSocketPorts))}`;
|
|
3181
3184
|
}
|
|
3182
3185
|
function smartPortAllocationUsingRequestedPort(port, webSocketPort) {
|
|
3183
|
-
return `${getLoggingPrefix('Smart Port Allocation', 'info')} using requested port ${
|
|
3186
|
+
return `${getLoggingPrefix('Smart Port Allocation', 'info')} using requested port ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(port.toString())}; WebSocket ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(webSocketPort.toString())}`;
|
|
3184
3187
|
}
|
|
3185
3188
|
function smartPortAllocationRequestedPortUnavailable(port) {
|
|
3186
|
-
return `${getLoggingPrefix('Smart Port Allocation', 'warn')} requested port is unavailable: ${
|
|
3189
|
+
return `${getLoggingPrefix('Smart Port Allocation', 'warn')} requested port is unavailable: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(port.toString())}`;
|
|
3187
3190
|
}
|
|
3188
3191
|
function smartPortAllocationAllocatedPorts(port, webSocketPort) {
|
|
3189
|
-
return `${getLoggingPrefix('Smart Port Allocation', 'success')} allocated ports ${
|
|
3192
|
+
return `${getLoggingPrefix('Smart Port Allocation', 'success')} allocated ports ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(port.toString())} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('(port)')} and ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(webSocketPort.toString())} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('(WebSocket)')}`;
|
|
3190
3193
|
}
|
|
3191
3194
|
function instanceManagerCreateInstanceCalled(params) {
|
|
3192
|
-
return `${getLoggingPrefix('Instance Manager', 'info')} createInstance called ${
|
|
3195
|
+
return `${getLoggingPrefix('Instance Manager', 'info')} createInstance called ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(JSON.stringify(params))}`;
|
|
3193
3196
|
}
|
|
3194
3197
|
function instanceManagerRegistryAfterCreateInstance(registry) {
|
|
3195
|
-
return `${getLoggingPrefix('Instance Manager', 'info')} registry after createInstance: ${
|
|
3198
|
+
return `${getLoggingPrefix('Instance Manager', 'info')} registry after createInstance: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(JSON.stringify(registry))}`;
|
|
3196
3199
|
}
|
|
3197
3200
|
function extensionManagerCopyFilesWarning(error) {
|
|
3198
|
-
return `${getLoggingPrefix('Extension.js DevTools', 'warn')} could not copy extension files: ${
|
|
3201
|
+
return `${getLoggingPrefix('Extension.js DevTools', 'warn')} could not copy extension files: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow(String(error))}`;
|
|
3199
3202
|
}
|
|
3200
3203
|
function extensionManagerInstanceNotFoundWarning(instanceId) {
|
|
3201
|
-
return `${getLoggingPrefix('Extension.js DevTools', 'warn')} instance ${
|
|
3204
|
+
return `${getLoggingPrefix('Extension.js DevTools', 'warn')} instance ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow(instanceId)} not found for cleanup`;
|
|
3202
3205
|
}
|
|
3203
3206
|
function extensionManagerCleanupWarning(error) {
|
|
3204
|
-
return `${getLoggingPrefix('Extension.js DevTools', 'warn')} could not cleanup temp extensions: ${
|
|
3207
|
+
return `${getLoggingPrefix('Extension.js DevTools', 'warn')} could not cleanup temp extensions: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().yellow(String(error))}`;
|
|
3205
3208
|
}
|
|
3206
3209
|
function firefoxDetectedFlatpak() {
|
|
3207
3210
|
return `${getLoggingPrefix('Firefox Detector', 'info')} detected a Flatpak Firefox installation`;
|
|
@@ -3210,88 +3213,88 @@ var __webpack_modules__ = {
|
|
|
3210
3213
|
return `${getLoggingPrefix('Firefox Detector', 'info')} detected a Snap Firefox installation`;
|
|
3211
3214
|
}
|
|
3212
3215
|
function firefoxDetectedTraditional(firefoxPath) {
|
|
3213
|
-
return `${getLoggingPrefix('Firefox Detector', 'info')} detected traditional Firefox at: ${
|
|
3216
|
+
return `${getLoggingPrefix('Firefox Detector', 'info')} detected traditional Firefox at: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(firefoxPath)}`;
|
|
3214
3217
|
}
|
|
3215
3218
|
function firefoxDetectedCustom(firefoxPath) {
|
|
3216
|
-
return `${getLoggingPrefix('Firefox Detector', 'info')} detected custom Firefox build at: ${
|
|
3219
|
+
return `${getLoggingPrefix('Firefox Detector', 'info')} detected custom Firefox build at: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(firefoxPath)}`;
|
|
3217
3220
|
}
|
|
3218
3221
|
function firefoxUsingFlatpakWithSandbox() {
|
|
3219
3222
|
return `${getLoggingPrefix('Firefox Detector', 'info')} using Flatpak Firefox with sandbox permissions`;
|
|
3220
3223
|
}
|
|
3221
3224
|
function firefoxVersion(version) {
|
|
3222
|
-
return `${getLoggingPrefix('Firefox Detector', 'info')} Firefox version is: ${
|
|
3225
|
+
return `${getLoggingPrefix('Firefox Detector', 'info')} Firefox version is: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(version)}`;
|
|
3223
3226
|
}
|
|
3224
3227
|
function portManagerErrorAllocatingPorts(error) {
|
|
3225
|
-
return `${getLoggingPrefix('Port Manager', 'error')} Failed to allocate ports.\n${
|
|
3228
|
+
return `${getLoggingPrefix('Port Manager', 'error')} Failed to allocate ports.\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red(String(error))}`;
|
|
3226
3229
|
}
|
|
3227
3230
|
function browserPluginFailedToLoad(browser, error) {
|
|
3228
|
-
return `${getLoggingPrefix('Browser Plugin', 'error')} Failed to load the ${
|
|
3231
|
+
return `${getLoggingPrefix('Browser Plugin', 'error')} Failed to load the ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(browser)} plugin.\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red(String(error))}`;
|
|
3229
3232
|
}
|
|
3230
3233
|
function extensionJsRunnerError(error) {
|
|
3231
|
-
return `${getLoggingPrefix('Extension.js Runner', 'error')} Error in the Extension.js runner.\n${
|
|
3234
|
+
return `${getLoggingPrefix('Extension.js Runner', 'error')} Error in the Extension.js runner.\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red(String(error))}`;
|
|
3232
3235
|
}
|
|
3233
3236
|
function extensionJsRunnerCleanupError(error) {
|
|
3234
|
-
return `${getLoggingPrefix('Extension.js Runner', 'error')} Error during cleanup.\n${
|
|
3237
|
+
return `${getLoggingPrefix('Extension.js Runner', 'error')} Error during cleanup.\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red(String(error))}`;
|
|
3235
3238
|
}
|
|
3236
3239
|
function extensionJsRunnerUncaughtException(error) {
|
|
3237
|
-
return `${getLoggingPrefix('Extension.js Runner', 'error')} Uncaught exception.\n${
|
|
3240
|
+
return `${getLoggingPrefix('Extension.js Runner', 'error')} Uncaught exception.\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red(String(error))}`;
|
|
3238
3241
|
}
|
|
3239
3242
|
function extensionJsRunnerUnhandledRejection(promise, reason) {
|
|
3240
|
-
return `${getLoggingPrefix('Extension.js Runner', 'error')} unhandled rejection at: ${
|
|
3243
|
+
return `${getLoggingPrefix('Extension.js Runner', 'error')} unhandled rejection at: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(promise.toString())} reason: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().red(String(reason))}`;
|
|
3241
3244
|
}
|
|
3242
3245
|
function autoExitModeEnabled(ms) {
|
|
3243
|
-
return `${getLoggingPrefix('Auto Mode', 'info')} is enabled. The program will exit automatically after ${
|
|
3246
|
+
return `${getLoggingPrefix('Auto Mode', 'info')} is enabled. The program will exit automatically after ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('(' + ms.toString() + 'ms)')}.`;
|
|
3244
3247
|
}
|
|
3245
3248
|
function autoExitTriggered(ms) {
|
|
3246
|
-
return `${getLoggingPrefix('Auto Mode', 'warn')} timer has elapsed ${
|
|
3249
|
+
return `${getLoggingPrefix('Auto Mode', 'warn')} timer has elapsed ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('(' + ms.toString() + 'ms)')}. Cleaning up\u{2026}`;
|
|
3247
3250
|
}
|
|
3248
3251
|
function autoExitForceKill(ms) {
|
|
3249
|
-
return `${getLoggingPrefix('Auto Mode', 'error')} is force-killing the process after the fallback ${
|
|
3252
|
+
return `${getLoggingPrefix('Auto Mode', 'error')} is force-killing the process after the fallback ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('(' + ms.toString() + 'ms)')}.`;
|
|
3250
3253
|
}
|
|
3251
3254
|
function instanceManagerHealthMonitoringStart(instanceId) {
|
|
3252
|
-
return `${getLoggingPrefix('Instance Manager', 'info')} starting health monitoring for instance ${
|
|
3255
|
+
return `${getLoggingPrefix('Instance Manager', 'info')} starting health monitoring for instance ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(instanceId.slice(0, 8))}`;
|
|
3253
3256
|
}
|
|
3254
3257
|
function instanceManagerHealthMonitoringPassed(instanceId) {
|
|
3255
|
-
return `${getLoggingPrefix('Instance Manager', 'success')} instance ${
|
|
3258
|
+
return `${getLoggingPrefix('Instance Manager', 'success')} instance ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(instanceId.slice(0, 8))} health check passed`;
|
|
3256
3259
|
}
|
|
3257
3260
|
function instanceManagerHealthMonitoringOrphaned(instanceId) {
|
|
3258
|
-
return `${getLoggingPrefix('Instance Manager', 'warn')} instance ${
|
|
3261
|
+
return `${getLoggingPrefix('Instance Manager', 'warn')} instance ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(instanceId.slice(0, 8))} appears orphaned, cleaning up`;
|
|
3259
3262
|
}
|
|
3260
3263
|
function instanceManagerHealthMonitoringFailed(instanceId, error) {
|
|
3261
|
-
return `${getLoggingPrefix('Instance Manager', 'error')} health check failed for instance ${
|
|
3264
|
+
return `${getLoggingPrefix('Instance Manager', 'error')} health check failed for instance ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(instanceId.slice(0, 8))}:\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red(String(error))}`;
|
|
3262
3265
|
}
|
|
3263
3266
|
function instanceManagerForceCleanupProject(projectPath) {
|
|
3264
|
-
return `${getLoggingPrefix('Instance Manager', 'info')} force cleaning up all processes for project: ${
|
|
3267
|
+
return `${getLoggingPrefix('Instance Manager', 'info')} force cleaning up all processes for project: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().underline(projectPath)}`;
|
|
3265
3268
|
}
|
|
3266
3269
|
function instanceManagerForceCleanupFound(instanceCount) {
|
|
3267
|
-
return `${getLoggingPrefix('Instance Manager', 'info')} found ${
|
|
3270
|
+
return `${getLoggingPrefix('Instance Manager', 'info')} found ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(instanceCount.toString())} instances to clean up`;
|
|
3268
3271
|
}
|
|
3269
3272
|
function instanceManagerForceCleanupInstance(instanceId) {
|
|
3270
|
-
return `${getLoggingPrefix('Instance Manager', 'info')} cleaning up instance ${
|
|
3273
|
+
return `${getLoggingPrefix('Instance Manager', 'info')} cleaning up instance ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(instanceId.slice(0, 8))}`;
|
|
3271
3274
|
}
|
|
3272
3275
|
function instanceManagerForceCleanupTerminating(processId) {
|
|
3273
|
-
return `${getLoggingPrefix('Instance Manager', 'info')} terminating process ${
|
|
3276
|
+
return `${getLoggingPrefix('Instance Manager', 'info')} terminating process ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(processId.toString())}`;
|
|
3274
3277
|
}
|
|
3275
3278
|
function instanceManagerForceCleanupForceKilled(processId) {
|
|
3276
|
-
return `${getLoggingPrefix('Instance Manager', 'error')} force killed process ${
|
|
3279
|
+
return `${getLoggingPrefix('Instance Manager', 'error')} force killed process ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(processId.toString())}`;
|
|
3277
3280
|
}
|
|
3278
3281
|
function instanceManagerForceCleanupInstanceTerminated(instanceId) {
|
|
3279
|
-
return `${getLoggingPrefix('Instance Manager', 'success')} instance ${
|
|
3282
|
+
return `${getLoggingPrefix('Instance Manager', 'success')} instance ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(instanceId.slice(0, 8))} marked as terminated`;
|
|
3280
3283
|
}
|
|
3281
3284
|
function instanceManagerForceCleanupError(instanceId, error) {
|
|
3282
|
-
return `${getLoggingPrefix('Instance Manager', 'error')} error terminating instance ${
|
|
3285
|
+
return `${getLoggingPrefix('Instance Manager', 'error')} error terminating instance ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(instanceId)}:\n${pintor__WEBPACK_IMPORTED_MODULE_1___default().red(String(error))}`;
|
|
3283
3286
|
}
|
|
3284
3287
|
function instanceManagerForceCleanupComplete() {
|
|
3285
3288
|
return `${getLoggingPrefix('Instance Manager', 'success')} project cleanup completed`;
|
|
3286
3289
|
}
|
|
3287
3290
|
function instanceManagerProcessNoLongerRunning(instanceId, processId) {
|
|
3288
|
-
return `${
|
|
3291
|
+
return `${pintor__WEBPACK_IMPORTED_MODULE_1___default().brightMagenta("\u25BA\u25BA\u25BA")} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().brightMagenta('Instance Manager')} process ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(processId.toString())} for instance ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(instanceId.slice(0, 8))} is no longer running`;
|
|
3289
3292
|
}
|
|
3290
3293
|
function instanceManagerPortsNotInUse(instanceId, port, webSocketPort) {
|
|
3291
|
-
return `${
|
|
3294
|
+
return `${pintor__WEBPACK_IMPORTED_MODULE_1___default().brightMagenta("\u25BA\u25BA\u25BA")} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().brightMagenta('Instance Manager')} ports ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(port.toString())} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('(')}${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('port')}${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(')')}/${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(webSocketPort.toString())} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('(')}${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray('WebSocket')}${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(')')} for instance ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(instanceId.slice(0, 8))} are not in use`;
|
|
3292
3295
|
}
|
|
3293
3296
|
function instanceManagerCleanedUpOrphanedInstance(instanceId) {
|
|
3294
|
-
return `${
|
|
3297
|
+
return `${pintor__WEBPACK_IMPORTED_MODULE_1___default().brightMagenta("\u25BA\u25BA\u25BA")} ${pintor__WEBPACK_IMPORTED_MODULE_1___default().brightMagenta('Instance Manager')} cleaned up orphaned instance: ${pintor__WEBPACK_IMPORTED_MODULE_1___default().gray(instanceId.slice(0, 8))}`;
|
|
3295
3298
|
}
|
|
3296
3299
|
},
|
|
3297
3300
|
child_process: function(module) {
|
|
@@ -3309,6 +3312,9 @@ var __webpack_modules__ = {
|
|
|
3309
3312
|
net: function(module) {
|
|
3310
3313
|
module.exports = require("net");
|
|
3311
3314
|
},
|
|
3315
|
+
os: function(module) {
|
|
3316
|
+
module.exports = require("os");
|
|
3317
|
+
},
|
|
3312
3318
|
path: function(module) {
|
|
3313
3319
|
module.exports = require("path");
|
|
3314
3320
|
},
|
|
@@ -3319,7 +3325,7 @@ var __webpack_modules__ = {
|
|
|
3319
3325
|
module.exports = require("util");
|
|
3320
3326
|
},
|
|
3321
3327
|
"./package.json": function(module) {
|
|
3322
|
-
module.exports = JSON.parse('{"i8":"2.0.
|
|
3328
|
+
module.exports = JSON.parse('{"i8":"2.0.3","HO":{"@rspack/core":"^1.4.8","@rspack/dev-server":"^1.1.3","@swc/helpers":"^0.5.15","@types/webextension-polyfill":"0.12.3","@vue/compiler-sfc":"^3.5.13","adm-zip":"^0.5.16","axios":"^1.9.0","case-sensitive-paths-webpack-plugin":"^2.4.0","chokidar":"^4.0.1","chrome-location2":"2.0.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^16.4.7","dotenv-webpack":"^8.1.0","edge-location":"^1.1.1","firefox-location2":"1.0.0","firefox-profile":"^4.7.0","go-git-it":"^5.0.0","ignore":"^6.0.2","loader-utils":"^3.3.1","locate-path":"^7.2.0","micromatch":"^4.0.8","package-manager-detector":"^0.2.7","parse5":"^7.2.1","parse5-utilities":"^1.0.0","pintor":"0.3.0","postcss":"^8.4.49","preact":"^10.22.0","progress":"^2.0.3","schema-utils":"^4.2.0","slugify":"^1.6.6","tiny-glob":"^0.2.9","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.18.0"},"Lq":{"@prefresh/core":"^1.5.2","@prefresh/utils":"^1.2.0","@prefresh/webpack":"^4.0.1","@rspack/plugin-preact-refresh":"^1.1.2","@rspack/plugin-react-refresh":"^1.0.1","babel-loader":"^9.2.1","less-loader":"^12.2.0","postcss-loader":"^8.1.1","postcss-preset-env":"^10.1.1","react-refresh":"^0.14.2","sass-loader":"^16.0.4","svelte-loader":"^3.2.4","vue-loader":"^17.4.2","vue-style-loader":"^4.1.3"}}');
|
|
3323
3329
|
}
|
|
3324
3330
|
};
|
|
3325
3331
|
var __webpack_module_cache__ = {};
|
|
@@ -3383,6 +3389,7 @@ var __webpack_exports__ = {};
|
|
|
3383
3389
|
const external_case_sensitive_paths_webpack_plugin_namespaceObject = require("case-sensitive-paths-webpack-plugin");
|
|
3384
3390
|
var external_case_sensitive_paths_webpack_plugin_default = /*#__PURE__*/ __webpack_require__.n(external_case_sensitive_paths_webpack_plugin_namespaceObject);
|
|
3385
3391
|
const external_dotenv_namespaceObject = require("dotenv");
|
|
3392
|
+
var external_dotenv_default = /*#__PURE__*/ __webpack_require__.n(external_dotenv_namespaceObject);
|
|
3386
3393
|
function _define_property(obj, key, value) {
|
|
3387
3394
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
3388
3395
|
value: value,
|
|
@@ -3562,6 +3569,8 @@ var __webpack_exports__ = {};
|
|
|
3562
3569
|
}
|
|
3563
3570
|
}
|
|
3564
3571
|
plugin_compilation_define_property(CompilationPlugin, "name", 'plugin-compilation');
|
|
3572
|
+
var external_os_ = __webpack_require__("os");
|
|
3573
|
+
var external_crypto_ = __webpack_require__("crypto");
|
|
3565
3574
|
var external_child_process_ = __webpack_require__("child_process");
|
|
3566
3575
|
const external_package_manager_detector_namespaceObject = require("package-manager-detector");
|
|
3567
3576
|
var constants = __webpack_require__("./webpack/webpack-lib/constants.ts");
|
|
@@ -3682,6 +3691,62 @@ var __webpack_exports__ = {};
|
|
|
3682
3691
|
const distPath = external_path_.dirname(outputPath);
|
|
3683
3692
|
return !external_fs_.existsSync(external_path_.resolve(distPath, 'extension-js', 'profiles', `${browser}-profile`));
|
|
3684
3693
|
}
|
|
3694
|
+
function getDataDirectory() {
|
|
3695
|
+
const platform = process.platform;
|
|
3696
|
+
const isWSL = process.env.WSL_DISTRO_NAME || process.env.WSLENV;
|
|
3697
|
+
switch(platform){
|
|
3698
|
+
case 'darwin':
|
|
3699
|
+
return external_path_.join(external_os_.homedir(), 'Library', 'Application Support', 'extension-js');
|
|
3700
|
+
case 'win32':
|
|
3701
|
+
return external_path_.join(process.env.APPDATA || '', 'extension-js');
|
|
3702
|
+
case 'linux':
|
|
3703
|
+
if (isWSL) {
|
|
3704
|
+
const windowsAppData = process.env.APPDATA;
|
|
3705
|
+
if (windowsAppData) return external_path_.join(windowsAppData, 'extension-js');
|
|
3706
|
+
}
|
|
3707
|
+
return external_path_.join(external_os_.homedir(), '.config', 'extension-js');
|
|
3708
|
+
default:
|
|
3709
|
+
return external_path_.join(external_os_.homedir(), '.extension-js');
|
|
3710
|
+
}
|
|
3711
|
+
}
|
|
3712
|
+
function getFirstRunFlagsDir() {
|
|
3713
|
+
return external_path_.join(getDataDirectory(), 'first-run');
|
|
3714
|
+
}
|
|
3715
|
+
function hashProject(projectPath) {
|
|
3716
|
+
try {
|
|
3717
|
+
return external_crypto_.createHash('sha1').update(projectPath).digest('hex').slice(0, 12);
|
|
3718
|
+
} catch {
|
|
3719
|
+
return Buffer.from(projectPath).toString('hex').slice(0, 12);
|
|
3720
|
+
}
|
|
3721
|
+
}
|
|
3722
|
+
function getFirstRunFlagPath(projectPath, browser) {
|
|
3723
|
+
const dir = getFirstRunFlagsDir();
|
|
3724
|
+
const key = `${hashProject(projectPath)}-${browser}.flag`;
|
|
3725
|
+
return external_path_.join(dir, key);
|
|
3726
|
+
}
|
|
3727
|
+
function hasShownFirstRunMessage(projectPath, browser) {
|
|
3728
|
+
try {
|
|
3729
|
+
const flagPath = getFirstRunFlagPath(projectPath, browser);
|
|
3730
|
+
return external_fs_.existsSync(flagPath);
|
|
3731
|
+
} catch {
|
|
3732
|
+
return false;
|
|
3733
|
+
}
|
|
3734
|
+
}
|
|
3735
|
+
function markFirstRunMessageShown(projectPath, browser) {
|
|
3736
|
+
try {
|
|
3737
|
+
const dir = getFirstRunFlagsDir();
|
|
3738
|
+
if (!external_fs_.existsSync(dir)) external_fs_.mkdirSync(dir, {
|
|
3739
|
+
recursive: true
|
|
3740
|
+
});
|
|
3741
|
+
const flagPath = getFirstRunFlagPath(projectPath, browser);
|
|
3742
|
+
external_fs_.writeFileSync(flagPath, '1', 'utf8');
|
|
3743
|
+
} catch {}
|
|
3744
|
+
}
|
|
3745
|
+
function shouldShowFirstRun(outputPath, browser, projectPath) {
|
|
3746
|
+
const firstByProfile = isFirstRun(outputPath, browser);
|
|
3747
|
+
if (!firstByProfile) return false;
|
|
3748
|
+
return !hasShownFirstRunMessage(projectPath, browser);
|
|
3749
|
+
}
|
|
3685
3750
|
function filterKeysForThisBrowser(manifest, browser) {
|
|
3686
3751
|
const patchedManifest = JSON.parse(JSON.stringify(manifest), function(key, value) {
|
|
3687
3752
|
const indexOfColon = key.indexOf(':');
|
|
@@ -7815,9 +7880,12 @@ var __webpack_exports__ = {};
|
|
|
7815
7880
|
});
|
|
7816
7881
|
console.log(emptyLine());
|
|
7817
7882
|
console.log(runningInDevelopment(manifest, options.browser, message));
|
|
7818
|
-
|
|
7883
|
+
const projectPath = compiler.options.context || process.cwd();
|
|
7884
|
+
const outPath = compiler.options.output.path;
|
|
7885
|
+
if (shouldShowFirstRun(outPath, options.browser, projectPath)) {
|
|
7819
7886
|
console.log(emptyLine());
|
|
7820
7887
|
console.log(messages_isFirstRun(options.browser));
|
|
7888
|
+
markFirstRunMessageShown(projectPath, options.browser);
|
|
7821
7889
|
}
|
|
7822
7890
|
console.log(emptyLine());
|
|
7823
7891
|
}
|
|
@@ -9948,13 +10016,77 @@ var __webpack_exports__ = {};
|
|
|
9948
10016
|
throw error;
|
|
9949
10017
|
}
|
|
9950
10018
|
}
|
|
10019
|
+
function preloadEnvFiles(projectDir) {
|
|
10020
|
+
try {
|
|
10021
|
+
const defaultsPath = external_path_.join(projectDir, '.env.defaults');
|
|
10022
|
+
if (external_fs_.existsSync(defaultsPath)) external_dotenv_default().config({
|
|
10023
|
+
path: defaultsPath
|
|
10024
|
+
});
|
|
10025
|
+
const envCandidates = [
|
|
10026
|
+
'.env.development',
|
|
10027
|
+
'.env.local',
|
|
10028
|
+
'.env'
|
|
10029
|
+
];
|
|
10030
|
+
for (const filename of envCandidates){
|
|
10031
|
+
const filePath = external_path_.join(projectDir, filename);
|
|
10032
|
+
if (external_fs_.existsSync(filePath)) {
|
|
10033
|
+
external_dotenv_default().config({
|
|
10034
|
+
path: filePath
|
|
10035
|
+
});
|
|
10036
|
+
break;
|
|
10037
|
+
}
|
|
10038
|
+
}
|
|
10039
|
+
} catch {}
|
|
10040
|
+
}
|
|
9951
10041
|
async function loadConfigFile(configPath) {
|
|
9952
10042
|
const absolutePath = external_path_.resolve(configPath);
|
|
10043
|
+
const projectDir = external_path_.dirname(absolutePath);
|
|
10044
|
+
preloadEnvFiles(projectDir);
|
|
9953
10045
|
try {
|
|
9954
|
-
|
|
10046
|
+
if (absolutePath.endsWith('.cjs')) {
|
|
10047
|
+
const requireFn = (0, external_module_namespaceObject.createRequire)(__rslib_import_meta_url__);
|
|
10048
|
+
const required = requireFn(absolutePath);
|
|
10049
|
+
return (null == required ? void 0 : required.default) || required;
|
|
10050
|
+
}
|
|
10051
|
+
let esmImportPath = absolutePath;
|
|
10052
|
+
try {
|
|
10053
|
+
const originalContent = external_fs_.readFileSync(absolutePath, 'utf-8');
|
|
10054
|
+
if (originalContent.includes('import.meta.env')) {
|
|
10055
|
+
const tmpDir = external_fs_.mkdtempSync(external_path_.join(external_os_.tmpdir(), 'extension-config-esm-'));
|
|
10056
|
+
const tmpPath = external_path_.join(tmpDir, external_path_.basename(absolutePath));
|
|
10057
|
+
const envObjectLiteral = JSON.stringify(Object.fromEntries(Object.entries(process.env).map(([k, v])=>[
|
|
10058
|
+
k,
|
|
10059
|
+
v
|
|
10060
|
+
])), null, 0);
|
|
10061
|
+
const shimHeader = `const __IMPORT_META_ENV__ = Object.freeze(${envObjectLiteral});\n`;
|
|
10062
|
+
const replaced = originalContent.replace(/import\.meta\.env/g, '__IMPORT_META_ENV__');
|
|
10063
|
+
external_fs_.writeFileSync(tmpPath, `${shimHeader}${replaced}`, 'utf-8');
|
|
10064
|
+
esmImportPath = tmpPath;
|
|
10065
|
+
}
|
|
10066
|
+
} catch {}
|
|
10067
|
+
const module = await import((0, external_url_namespaceObject.pathToFileURL)(esmImportPath).href);
|
|
9955
10068
|
return module.default || module;
|
|
9956
10069
|
} catch (err) {
|
|
9957
10070
|
const error = err;
|
|
10071
|
+
try {
|
|
10072
|
+
if (!absolutePath.endsWith('.mjs')) {
|
|
10073
|
+
const requireFn = (0, external_module_namespaceObject.createRequire)(__rslib_import_meta_url__);
|
|
10074
|
+
let required;
|
|
10075
|
+
try {
|
|
10076
|
+
required = requireFn(absolutePath);
|
|
10077
|
+
} catch (requireErr) {
|
|
10078
|
+
const message = String((null == error ? void 0 : error.message) || '') + ' ' + String((null == requireErr ? void 0 : requireErr.message) || '');
|
|
10079
|
+
const looksLikeCommonJsInEsm = message.includes('require is not defined in ES module scope') || message.includes('Cannot use import statement outside a module') || message.includes('ERR_REQUIRE_ESM');
|
|
10080
|
+
if (looksLikeCommonJsInEsm) {
|
|
10081
|
+
const tmpDir = external_fs_.mkdtempSync(external_path_.join(external_os_.tmpdir(), 'extension-config-'));
|
|
10082
|
+
const tmpCjsPath = external_path_.join(tmpDir, external_path_.basename(absolutePath, external_path_.extname(absolutePath)) + '.cjs');
|
|
10083
|
+
external_fs_.copyFileSync(absolutePath, tmpCjsPath);
|
|
10084
|
+
required = requireFn(tmpCjsPath);
|
|
10085
|
+
} else throw requireErr;
|
|
10086
|
+
}
|
|
10087
|
+
return (null == required ? void 0 : required.default) || required;
|
|
10088
|
+
}
|
|
10089
|
+
} catch {}
|
|
9958
10090
|
try {
|
|
9959
10091
|
const content = external_fs_.readFileSync(absolutePath, 'utf-8');
|
|
9960
10092
|
return JSON.parse(content);
|
|
@@ -9966,14 +10098,20 @@ var __webpack_exports__ = {};
|
|
|
9966
10098
|
async function loadCustomWebpackConfig(projectPath) {
|
|
9967
10099
|
const userConfigPath = external_path_.join(projectPath, 'extension.config.js');
|
|
9968
10100
|
const moduleUserConfigPath = external_path_.join(projectPath, 'extension.config.mjs');
|
|
9969
|
-
|
|
9970
|
-
|
|
10101
|
+
const commonJsUserConfigPath = external_path_.join(projectPath, 'extension.config.cjs');
|
|
10102
|
+
const candidates = [
|
|
10103
|
+
userConfigPath,
|
|
10104
|
+
moduleUserConfigPath,
|
|
10105
|
+
commonJsUserConfigPath
|
|
10106
|
+
];
|
|
10107
|
+
const configPath = candidates.find((p)=>external_fs_.existsSync(p));
|
|
10108
|
+
if (configPath) {
|
|
9971
10109
|
if (await get_extension_config_isUsingExperimentalConfig(projectPath)) try {
|
|
9972
10110
|
const userConfig = await loadConfigFile(configPath);
|
|
9973
10111
|
if (userConfig && 'function' == typeof userConfig.config) return userConfig.config;
|
|
9974
10112
|
} catch (err) {
|
|
9975
10113
|
const error = err;
|
|
9976
|
-
console.error(configLoadingError(
|
|
10114
|
+
console.error(configLoadingError(configPath, error));
|
|
9977
10115
|
throw err;
|
|
9978
10116
|
}
|
|
9979
10117
|
}
|
|
@@ -9982,14 +10120,20 @@ var __webpack_exports__ = {};
|
|
|
9982
10120
|
async function loadCommandConfig(projectPath, command) {
|
|
9983
10121
|
const userConfigPath = external_path_.join(projectPath, 'extension.config.js');
|
|
9984
10122
|
const moduleUserConfigPath = external_path_.join(projectPath, 'extension.config.mjs');
|
|
9985
|
-
const
|
|
9986
|
-
|
|
10123
|
+
const commonJsUserConfigPath = external_path_.join(projectPath, 'extension.config.cjs');
|
|
10124
|
+
const candidates = [
|
|
10125
|
+
userConfigPath,
|
|
10126
|
+
moduleUserConfigPath,
|
|
10127
|
+
commonJsUserConfigPath
|
|
10128
|
+
];
|
|
10129
|
+
const configPath = candidates.find((p)=>external_fs_.existsSync(p));
|
|
10130
|
+
if (configPath) {
|
|
9987
10131
|
if (await get_extension_config_isUsingExperimentalConfig(projectPath)) try {
|
|
9988
10132
|
const userConfig = await loadConfigFile(configPath);
|
|
9989
10133
|
if (userConfig && userConfig.commands && userConfig.commands[command]) return userConfig.commands[command];
|
|
9990
10134
|
} catch (err) {
|
|
9991
10135
|
const error = err;
|
|
9992
|
-
console.error(configLoadingError(
|
|
10136
|
+
console.error(configLoadingError(configPath, error));
|
|
9993
10137
|
throw err;
|
|
9994
10138
|
}
|
|
9995
10139
|
}
|
|
@@ -9998,14 +10142,20 @@ var __webpack_exports__ = {};
|
|
|
9998
10142
|
async function loadBrowserConfig(projectPath, browser = 'chrome') {
|
|
9999
10143
|
const userConfigPath = external_path_.join(projectPath, 'extension.config.js');
|
|
10000
10144
|
const moduleUserConfigPath = external_path_.join(projectPath, 'extension.config.mjs');
|
|
10001
|
-
const
|
|
10002
|
-
|
|
10145
|
+
const commonJsUserConfigPath = external_path_.join(projectPath, 'extension.config.cjs');
|
|
10146
|
+
const candidates = [
|
|
10147
|
+
userConfigPath,
|
|
10148
|
+
moduleUserConfigPath,
|
|
10149
|
+
commonJsUserConfigPath
|
|
10150
|
+
];
|
|
10151
|
+
const configPath = candidates.find((p)=>external_fs_.existsSync(p));
|
|
10152
|
+
if (configPath) {
|
|
10003
10153
|
if (await get_extension_config_isUsingExperimentalConfig(projectPath)) try {
|
|
10004
10154
|
const userConfig = await loadConfigFile(configPath);
|
|
10005
10155
|
if (userConfig && userConfig.browser && userConfig.browser[browser]) return userConfig.browser[browser];
|
|
10006
10156
|
} catch (err) {
|
|
10007
10157
|
const error = err;
|
|
10008
|
-
console.error(configLoadingError(
|
|
10158
|
+
console.error(configLoadingError(configPath, error));
|
|
10009
10159
|
throw err;
|
|
10010
10160
|
}
|
|
10011
10161
|
}
|
|
@@ -10017,8 +10167,14 @@ var __webpack_exports__ = {};
|
|
|
10017
10167
|
async function get_extension_config_isUsingExperimentalConfig(projectPath) {
|
|
10018
10168
|
const userConfigPath = external_path_.join(projectPath, 'extension.config.js');
|
|
10019
10169
|
const moduleUserConfigPath = external_path_.join(projectPath, 'extension.config.mjs');
|
|
10020
|
-
const
|
|
10021
|
-
|
|
10170
|
+
const commonJsUserConfigPath = external_path_.join(projectPath, 'extension.config.cjs');
|
|
10171
|
+
const candidates = [
|
|
10172
|
+
userConfigPath,
|
|
10173
|
+
moduleUserConfigPath,
|
|
10174
|
+
commonJsUserConfigPath
|
|
10175
|
+
];
|
|
10176
|
+
const configPath = candidates.find((p)=>external_fs_.existsSync(p));
|
|
10177
|
+
if (configPath) {
|
|
10022
10178
|
if (!get_extension_config_userMessageDelivered) {
|
|
10023
10179
|
console.log(isUsingExperimentalConfig('extension.config.js'));
|
|
10024
10180
|
get_extension_config_userMessageDelivered = true;
|
|
@@ -10314,7 +10470,11 @@ var __webpack_exports__ = {};
|
|
|
10314
10470
|
});
|
|
10315
10471
|
const customWebpackConfig = await loadCustomWebpackConfig(manifestDir);
|
|
10316
10472
|
const finalConfig = customWebpackConfig(baseConfig);
|
|
10317
|
-
const compilerConfig = (0, external_webpack_merge_namespaceObject.merge)(finalConfig
|
|
10473
|
+
const compilerConfig = (0, external_webpack_merge_namespaceObject.merge)(finalConfig, {
|
|
10474
|
+
infrastructureLogging: {
|
|
10475
|
+
level: 'error'
|
|
10476
|
+
}
|
|
10477
|
+
});
|
|
10318
10478
|
const compiler = (0, core_namespaceObject.rspack)(compilerConfig);
|
|
10319
10479
|
const port = portAllocation.port;
|
|
10320
10480
|
if (void 0 !== devOptions.port && devOptions.port !== port) {
|
|
@@ -10343,7 +10503,7 @@ var __webpack_exports__ = {};
|
|
|
10343
10503
|
}
|
|
10344
10504
|
},
|
|
10345
10505
|
client: {
|
|
10346
|
-
logging: '
|
|
10506
|
+
logging: 'none',
|
|
10347
10507
|
progress: false,
|
|
10348
10508
|
overlay: false
|
|
10349
10509
|
},
|
|
@@ -16,5 +16,8 @@ export declare function isFromNpx(): false | "npm";
|
|
|
16
16
|
export declare function installOptionalDependencies(integration: string, dependencies: string[]): Promise<void>;
|
|
17
17
|
export declare function isUsingJSFramework(projectPath: string): boolean;
|
|
18
18
|
export declare function isFirstRun(outputPath: string, browser: DevOptions['browser']): boolean;
|
|
19
|
+
export declare function hasShownFirstRunMessage(projectPath: string, browser: DevOptions['browser']): boolean;
|
|
20
|
+
export declare function markFirstRunMessageShown(projectPath: string, browser: DevOptions['browser']): void;
|
|
21
|
+
export declare function shouldShowFirstRun(outputPath: string, browser: DevOptions['browser'], projectPath: string): boolean;
|
|
19
22
|
export declare function filterKeysForThisBrowser(manifest: Manifest, browser: DevOptions['browser']): any;
|
|
20
23
|
export declare function hasDependency(projectPath: string, dependency: string): boolean;
|