extension-develop 3.8.14 → 3.9.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/323.cjs +26 -0
- package/dist/535.cjs +44 -13
- package/dist/928.cjs +7 -2
- package/dist/module.cjs +153 -92
- package/package.json +3 -2
- package/webpack/webpack-lib/optional-dependencies.json +20 -0
package/dist/323.cjs
CHANGED
|
@@ -387,6 +387,32 @@ exports.modules = {
|
|
|
387
387
|
} catch {}
|
|
388
388
|
return null;
|
|
389
389
|
}
|
|
390
|
+
getDeveloperModeStatus() {
|
|
391
|
+
if (!this.profilePath) return 'unknown';
|
|
392
|
+
const prefCandidates = [];
|
|
393
|
+
const seen = new Set();
|
|
394
|
+
const addPrefCandidate = (dir)=>{
|
|
395
|
+
const prefPath = external_path_.join(dir, 'Preferences');
|
|
396
|
+
if (!external_fs_.existsSync(prefPath)) return;
|
|
397
|
+
const dedupeKey = external_path_.resolve(prefPath);
|
|
398
|
+
if (seen.has(dedupeKey)) return;
|
|
399
|
+
seen.add(dedupeKey);
|
|
400
|
+
prefCandidates.push(prefPath);
|
|
401
|
+
};
|
|
402
|
+
try {
|
|
403
|
+
addPrefCandidate(this.profilePath);
|
|
404
|
+
addPrefCandidate(external_path_.join(this.profilePath, 'Default'));
|
|
405
|
+
for (const entry of external_fs_.readdirSync(this.profilePath))if (/^Profile\s+\d+$/i.test(entry)) addPrefCandidate(external_path_.join(this.profilePath, entry));
|
|
406
|
+
} catch {}
|
|
407
|
+
for (const prefPath of prefCandidates)try {
|
|
408
|
+
const prefs = JSON.parse(external_fs_.readFileSync(prefPath, 'utf-8'));
|
|
409
|
+
const uiFlag = prefs?.extensions?.ui?.developer_mode;
|
|
410
|
+
if ('boolean' == typeof uiFlag) return uiFlag ? 'enabled' : 'disabled';
|
|
411
|
+
const legacyFlag = prefs?.extensions?.developer_mode;
|
|
412
|
+
if ('boolean' == typeof legacyFlag) return legacyFlag ? 'enabled' : 'disabled';
|
|
413
|
+
} catch {}
|
|
414
|
+
return 'unknown';
|
|
415
|
+
}
|
|
390
416
|
async hardReload() {
|
|
391
417
|
if (!this.cdp || !this.extensionId) return false;
|
|
392
418
|
try {
|
package/dist/535.cjs
CHANGED
|
@@ -400,6 +400,36 @@ exports.modules = {
|
|
|
400
400
|
else obj[key] = value;
|
|
401
401
|
return obj;
|
|
402
402
|
}
|
|
403
|
+
function findNearestWorkspaceRoot(startDir) {
|
|
404
|
+
let current = external_path_.isAbsolute(startDir) ? external_path_.normalize(startDir) : external_path_.resolve(startDir);
|
|
405
|
+
while(true){
|
|
406
|
+
if (external_fs_.existsSync(external_path_.join(current, 'pnpm-workspace.yaml'))) return current;
|
|
407
|
+
const parent = external_path_.dirname(current);
|
|
408
|
+
if (parent === current) return;
|
|
409
|
+
current = parent;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
function resolveEnvPaths(projectPath, envFiles) {
|
|
413
|
+
const localEnvPath = envFiles.map((file)=>external_path_.join(projectPath, file)).find((filePath)=>external_fs_.existsSync(filePath)) || '';
|
|
414
|
+
const localDefaultsPath = external_path_.join(projectPath, '.env.defaults');
|
|
415
|
+
if (localEnvPath || external_fs_.existsSync(localDefaultsPath)) return {
|
|
416
|
+
envPath: localEnvPath,
|
|
417
|
+
defaultsPath: localDefaultsPath
|
|
418
|
+
};
|
|
419
|
+
const workspaceRoot = findNearestWorkspaceRoot(projectPath);
|
|
420
|
+
if (workspaceRoot && workspaceRoot !== projectPath) {
|
|
421
|
+
const workspaceEnvPath = envFiles.map((file)=>external_path_.join(workspaceRoot, file)).find((filePath)=>external_fs_.existsSync(filePath)) || '';
|
|
422
|
+
const workspaceDefaultsPath = external_path_.join(workspaceRoot, '.env.defaults');
|
|
423
|
+
if (workspaceEnvPath || external_fs_.existsSync(workspaceDefaultsPath)) return {
|
|
424
|
+
envPath: workspaceEnvPath,
|
|
425
|
+
defaultsPath: workspaceDefaultsPath
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
return {
|
|
429
|
+
envPath: '',
|
|
430
|
+
defaultsPath: localDefaultsPath
|
|
431
|
+
};
|
|
432
|
+
}
|
|
403
433
|
class EnvPlugin {
|
|
404
434
|
apply(compiler) {
|
|
405
435
|
const projectPath = compiler.options.context || (this.manifestPath ? external_path_.dirname(this.manifestPath) : '');
|
|
@@ -412,20 +442,12 @@ exports.modules = {
|
|
|
412
442
|
'.env',
|
|
413
443
|
'.env.example'
|
|
414
444
|
];
|
|
415
|
-
|
|
416
|
-
for (const file of envFiles){
|
|
417
|
-
const filePath = external_path_.join(projectPath, file);
|
|
418
|
-
if (external_fs_.existsSync(filePath)) {
|
|
419
|
-
envPath = filePath;
|
|
420
|
-
break;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
445
|
+
const { envPath, defaultsPath } = resolveEnvPaths(projectPath, envFiles);
|
|
423
446
|
if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(envSelectedFile(envPath));
|
|
424
447
|
const envVars = envPath ? external_dotenv_.config({
|
|
425
448
|
path: envPath,
|
|
426
449
|
quiet: true
|
|
427
450
|
}).parsed || {} : {};
|
|
428
|
-
const defaultsPath = external_path_.join(projectPath, '.env.defaults');
|
|
429
451
|
const defaultsVars = external_fs_.existsSync(defaultsPath) ? external_dotenv_.config({
|
|
430
452
|
path: defaultsPath,
|
|
431
453
|
quiet: true
|
|
@@ -1422,7 +1444,7 @@ exports.modules = {
|
|
|
1422
1444
|
module: {
|
|
1423
1445
|
type: 'es6'
|
|
1424
1446
|
},
|
|
1425
|
-
minify:
|
|
1447
|
+
minify: false,
|
|
1426
1448
|
isModule: true,
|
|
1427
1449
|
sourceMap: wantsSourceMaps,
|
|
1428
1450
|
env: {
|
|
@@ -8105,6 +8127,14 @@ Set background.noDynamicEntryWarning to true to disable this warning.
|
|
|
8105
8127
|
if (this.firstSuccessfulBuildAtMs && now - this.firstSuccessfulBuildAtMs < ChromiumHardReloadPlugin.INITIAL_RELOAD_COOLDOWN_MS) return void this.logger?.info?.(`[reload] skipping early reload during startup cooldown (reason:${reason})`);
|
|
8106
8128
|
const ctrl = this.ctx.getController();
|
|
8107
8129
|
if (!ctrl) return;
|
|
8130
|
+
const developerModeStatus = 'function' == typeof ctrl.getDeveloperModeStatus ? ctrl.getDeveloperModeStatus() : 'unknown';
|
|
8131
|
+
if ('disabled' === developerModeStatus) {
|
|
8132
|
+
if (!this.warnedDevMode) {
|
|
8133
|
+
this.warnedDevMode = true;
|
|
8134
|
+
this.logger?.warn?.(browsers_lib_messages.KE0(this.options?.browser));
|
|
8135
|
+
}
|
|
8136
|
+
return;
|
|
8137
|
+
}
|
|
8108
8138
|
this.logger?.info?.(`[reload] reloading extension (reason:${reason})`);
|
|
8109
8139
|
if (this.shouldEmitReloadActionEvent()) emitActionEvent('extension_reload', {
|
|
8110
8140
|
reason: reason || 'unknown',
|
|
@@ -8120,9 +8150,9 @@ Set background.noDynamicEntryWarning to true to disable this warning.
|
|
|
8120
8150
|
}, reloadTimeoutMs);
|
|
8121
8151
|
})
|
|
8122
8152
|
]);
|
|
8123
|
-
if (!ok && !this.
|
|
8124
|
-
this.
|
|
8125
|
-
this.logger?.warn?.(browsers_lib_messages.
|
|
8153
|
+
if (!ok && !this.warnedHardReloadFailure) {
|
|
8154
|
+
this.warnedHardReloadFailure = true;
|
|
8155
|
+
this.logger?.warn?.(browsers_lib_messages.WsE(this.options?.browser));
|
|
8126
8156
|
}
|
|
8127
8157
|
});
|
|
8128
8158
|
}
|
|
@@ -8172,6 +8202,7 @@ Set background.noDynamicEntryWarning to true to disable this warning.
|
|
|
8172
8202
|
chromium_hard_reload_define_property(this, "ctx", void 0);
|
|
8173
8203
|
chromium_hard_reload_define_property(this, "logger", void 0);
|
|
8174
8204
|
chromium_hard_reload_define_property(this, "warnedDevMode", void 0);
|
|
8205
|
+
chromium_hard_reload_define_property(this, "warnedHardReloadFailure", void 0);
|
|
8175
8206
|
chromium_hard_reload_define_property(this, "hasCompletedSuccessfulBuild", void 0);
|
|
8176
8207
|
chromium_hard_reload_define_property(this, "firstSuccessfulBuildAtMs", void 0);
|
|
8177
8208
|
chromium_hard_reload_define_property(this, "serviceWorkerSourceDependencyPaths", void 0);
|
package/dist/928.cjs
CHANGED
|
@@ -109,6 +109,9 @@ exports.modules = {
|
|
|
109
109
|
`Try enabling verbose logs with ${external_pintor_default().brightBlue('EXTENSION_VERBOSE=1')} or review your extension config.`
|
|
110
110
|
].join('\n');
|
|
111
111
|
}
|
|
112
|
+
function spacerLine() {
|
|
113
|
+
return ' ';
|
|
114
|
+
}
|
|
112
115
|
var external_crypto_ = __webpack_require__("crypto");
|
|
113
116
|
var external_net_ = __webpack_require__("net");
|
|
114
117
|
var shared_utils = __webpack_require__("./webpack/plugin-browsers/browsers-lib/shared-utils.ts");
|
|
@@ -362,7 +365,7 @@ exports.modules = {
|
|
|
362
365
|
async function dev_server_devServer(projectStructure, devOptions) {
|
|
363
366
|
process.env.EXTENSION_BROWSER_LAUNCH_ENABLED = devOptions.noBrowser ? '0' : '1';
|
|
364
367
|
const { manifestPath, packageJsonPath } = projectStructure;
|
|
365
|
-
|
|
368
|
+
external_path_.dirname(manifestPath);
|
|
366
369
|
const packageJsonDir = external_path_.dirname(packageJsonPath);
|
|
367
370
|
const commandConfig = await (0, config_loader.eY)(packageJsonDir, 'dev');
|
|
368
371
|
const browserConfig = await (0, config_loader.xY)(packageJsonDir, devOptions.browser);
|
|
@@ -402,7 +405,7 @@ exports.modules = {
|
|
|
402
405
|
path: external_path_.join(packageJsonDir, 'dist', devOptions.browser)
|
|
403
406
|
}
|
|
404
407
|
});
|
|
405
|
-
const customWebpackConfig = await (0, config_loader.Tu)(
|
|
408
|
+
const customWebpackConfig = await (0, config_loader.Tu)(packageJsonDir);
|
|
406
409
|
const finalConfig = customWebpackConfig(baseConfig);
|
|
407
410
|
const compilerConfig = (0, external_webpack_merge_.merge)(finalConfig, {});
|
|
408
411
|
compilerConfig.devServer = {
|
|
@@ -478,12 +481,14 @@ exports.modules = {
|
|
|
478
481
|
}, START_TIMEOUT_MS);
|
|
479
482
|
await devServer.start();
|
|
480
483
|
if (startTimeout) clearTimeout(startTimeout);
|
|
484
|
+
console.log(spacerLine());
|
|
481
485
|
console.log(messages_ready('development', devOptions.browser));
|
|
482
486
|
if (devOptions.noBrowser) console.log(browserRunnerDisabled({
|
|
483
487
|
browser: String(devOptions.browser || 'chromium'),
|
|
484
488
|
manifestPath,
|
|
485
489
|
readyPath: metadata.readyPath
|
|
486
490
|
}));
|
|
491
|
+
console.log(spacerLine());
|
|
487
492
|
} catch (error) {
|
|
488
493
|
if (startTimeout) clearTimeout(startTimeout);
|
|
489
494
|
metadata.writeError('dev_server_start_failed', error instanceof Error ? error.message : String(error));
|
package/dist/module.cjs
CHANGED
|
@@ -127656,6 +127656,7 @@ var __webpack_modules__ = {
|
|
|
127656
127656
|
VkK: ()=>enhancedProcessManagementCleanup,
|
|
127657
127657
|
WVu: ()=>addonInstallError,
|
|
127658
127658
|
WVz: ()=>sourceInspectorHTMLOutputFooter,
|
|
127659
|
+
WsE: ()=>chromiumHardReloadFailed,
|
|
127659
127660
|
Ww: ()=>sourceInspectorTargetCreated,
|
|
127660
127661
|
X6h: ()=>firefoxRemoteDebuggingReady,
|
|
127661
127662
|
XHr: ()=>enhancedProcessManagementTerminating,
|
|
@@ -128261,7 +128262,7 @@ var __webpack_modules__ = {
|
|
|
128261
128262
|
return lines.join('\n');
|
|
128262
128263
|
}
|
|
128263
128264
|
function emptyLine() {
|
|
128264
|
-
return '';
|
|
128265
|
+
return ' ';
|
|
128265
128266
|
}
|
|
128266
128267
|
function separatorLine() {
|
|
128267
128268
|
return ''.padEnd(80, '=');
|
|
@@ -128327,6 +128328,11 @@ var __webpack_modules__ = {
|
|
|
128327
128328
|
exts = 'edge' === browser ? pintor__rspack_import_4_default().underline('edge://extensions') : pintor__rspack_import_4_default().underline('chrome://extensions');
|
|
128328
128329
|
return `${getLoggingPrefix('warn')} Configuration required\nEnable ${pintor__rspack_import_4_default().yellow('Developer mode')} in ${exts} for reliable reloads.\nWithout it, hard reloads may disable your unpacked extension.`;
|
|
128329
128330
|
}
|
|
128331
|
+
function chromiumHardReloadFailed(browser) {
|
|
128332
|
+
let exts = '';
|
|
128333
|
+
exts = 'edge' === browser ? pintor__rspack_import_4_default().underline('edge://extensions') : pintor__rspack_import_4_default().underline('chrome://extensions');
|
|
128334
|
+
return `${getLoggingPrefix('warn')} Reload failed\nChromium could not reload your unpacked extension.\nIf you are using an existing profile, verify ${pintor__rspack_import_4_default().yellow('Developer mode')} is enabled in ${exts}.`;
|
|
128335
|
+
}
|
|
128330
128336
|
},
|
|
128331
128337
|
"./webpack/plugin-browsers/browsers-lib/output-binaries-resolver.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
128332
128338
|
"use strict";
|
|
@@ -131452,16 +131458,20 @@ var __webpack_modules__ = {
|
|
|
131452
131458
|
__webpack_require__.d(__webpack_exports__, {
|
|
131453
131459
|
Dy: ()=>installOptionalDependenciesBatch,
|
|
131454
131460
|
He: ()=>resolveDevelopInstallRoot,
|
|
131461
|
+
Iy: ()=>resolveOptionalInstallRoot,
|
|
131455
131462
|
tm: ()=>installOptionalDependencies,
|
|
131456
131463
|
ws: ()=>hasDependency
|
|
131457
131464
|
});
|
|
131458
131465
|
var path__rspack_import_0 = __webpack_require__("path");
|
|
131459
131466
|
var fs__rspack_import_1 = __webpack_require__("fs");
|
|
131460
|
-
var
|
|
131461
|
-
var
|
|
131462
|
-
var
|
|
131463
|
-
var
|
|
131464
|
-
var
|
|
131467
|
+
var os__rspack_import_2 = __webpack_require__("os");
|
|
131468
|
+
var _messages__rspack_import_3 = __webpack_require__("./webpack/plugin-css/css-lib/messages.ts");
|
|
131469
|
+
var pintor__rspack_import_4 = __webpack_require__("pintor");
|
|
131470
|
+
var pintor__rspack_import_4_default = /*#__PURE__*/ __webpack_require__.n(pintor__rspack_import_4);
|
|
131471
|
+
var _package_json__rspack_import_5 = __webpack_require__("./package.json");
|
|
131472
|
+
var _webpack_lib_check_build_dependencies__rspack_import_6 = __webpack_require__("./webpack/webpack-lib/check-build-dependencies.ts");
|
|
131473
|
+
var _webpack_lib_optional_dependencies__rspack_import_7 = __webpack_require__("./webpack/webpack-lib/optional-dependencies.ts");
|
|
131474
|
+
var _webpack_lib_package_manager__rspack_import_8 = __webpack_require__("./webpack/webpack-lib/package-manager.ts");
|
|
131465
131475
|
function parseJsonSafe(text) {
|
|
131466
131476
|
const s = text && 0xfeff === text.charCodeAt(0) ? text.slice(1) : text;
|
|
131467
131477
|
return JSON.parse(s || '{}');
|
|
@@ -131569,13 +131579,13 @@ var __webpack_modules__ = {
|
|
|
131569
131579
|
}
|
|
131570
131580
|
async function execInstallWithFallback(command, options) {
|
|
131571
131581
|
try {
|
|
131572
|
-
await (0,
|
|
131582
|
+
await (0, _webpack_lib_package_manager__rspack_import_8.Qt)(command.command, command.args, {
|
|
131573
131583
|
cwd: options.cwd,
|
|
131574
131584
|
stdio: 'inherit'
|
|
131575
131585
|
});
|
|
131576
131586
|
return;
|
|
131577
131587
|
} catch (error) {
|
|
131578
|
-
if (options.fallbackNpmCommand && (isMissingManagerError(error) || options.allowFallbackOnFailure && isInstallExitFailure(error))) return void await (0,
|
|
131588
|
+
if (options.fallbackNpmCommand && (isMissingManagerError(error) || options.allowFallbackOnFailure && isInstallExitFailure(error))) return void await (0, _webpack_lib_package_manager__rspack_import_8.Qt)(options.fallbackNpmCommand.command, options.fallbackNpmCommand.args, {
|
|
131579
131589
|
cwd: options.cwd,
|
|
131580
131590
|
stdio: 'inherit'
|
|
131581
131591
|
});
|
|
@@ -131583,7 +131593,7 @@ var __webpack_modules__ = {
|
|
|
131583
131593
|
}
|
|
131584
131594
|
}
|
|
131585
131595
|
function resolveDevelopInstallRoot() {
|
|
131586
|
-
const directRoot = (0,
|
|
131596
|
+
const directRoot = (0, _webpack_lib_check_build_dependencies__rspack_import_6.w1)();
|
|
131587
131597
|
if (directRoot) return directRoot;
|
|
131588
131598
|
try {
|
|
131589
131599
|
const candidateRoot = findDevelopRootFrom(__dirname);
|
|
@@ -131600,43 +131610,67 @@ var __webpack_modules__ = {
|
|
|
131600
131610
|
return;
|
|
131601
131611
|
}
|
|
131602
131612
|
}
|
|
131613
|
+
function getExtensionJsCacheBaseDir() {
|
|
131614
|
+
const override = process.env.EXTENSION_JS_CACHE_DIR;
|
|
131615
|
+
if (override) return path__rspack_import_0.resolve(override);
|
|
131616
|
+
if ('win32' === process.platform && process.env.LOCALAPPDATA) return path__rspack_import_0.join(process.env.LOCALAPPDATA, 'extensionjs');
|
|
131617
|
+
if (process.env.XDG_CACHE_HOME) return path__rspack_import_0.join(process.env.XDG_CACHE_HOME, 'extensionjs');
|
|
131618
|
+
return path__rspack_import_0.join(os__rspack_import_2.homedir(), '.cache', 'extensionjs');
|
|
131619
|
+
}
|
|
131620
|
+
function resolveOptionalInstallRoot() {
|
|
131621
|
+
return path__rspack_import_0.join(getExtensionJsCacheBaseDir(), 'optional-deps', _package_json__rspack_import_5.rE);
|
|
131622
|
+
}
|
|
131623
|
+
function ensureOptionalInstallBaseDir(installBaseDir) {
|
|
131624
|
+
fs__rspack_import_1.mkdirSync(installBaseDir, {
|
|
131625
|
+
recursive: true
|
|
131626
|
+
});
|
|
131627
|
+
const packageJsonPath = path__rspack_import_0.join(installBaseDir, 'package.json');
|
|
131628
|
+
if (!fs__rspack_import_1.existsSync(packageJsonPath)) fs__rspack_import_1.writeFileSync(packageJsonPath, JSON.stringify({
|
|
131629
|
+
name: `extensionjs-optional-deps-${_package_json__rspack_import_5.rE}`,
|
|
131630
|
+
private: true,
|
|
131631
|
+
version: _package_json__rspack_import_5.rE
|
|
131632
|
+
}, null, 2) + '\n');
|
|
131633
|
+
}
|
|
131603
131634
|
function getOptionalInstallCommand(pm, dependencies, installBaseDir) {
|
|
131604
131635
|
const pmName = pm.name;
|
|
131605
|
-
|
|
131636
|
+
const dependencySpecs = (0, _webpack_lib_optional_dependencies__rspack_import_7.ad)(dependencies);
|
|
131637
|
+
if ('yarn' === pmName) return (0, _webpack_lib_package_manager__rspack_import_8.tj)(pm, [
|
|
131606
131638
|
'--silent',
|
|
131607
131639
|
'add',
|
|
131608
|
-
...
|
|
131640
|
+
...dependencySpecs,
|
|
131609
131641
|
'--cwd',
|
|
131610
131642
|
installBaseDir,
|
|
131611
131643
|
'--optional'
|
|
131612
131644
|
]);
|
|
131613
|
-
if ('npm' === pmName) return (0,
|
|
131645
|
+
if ('npm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_8.tj)(pm, [
|
|
131614
131646
|
'--silent',
|
|
131615
131647
|
'install',
|
|
131616
|
-
...
|
|
131648
|
+
...dependencySpecs,
|
|
131617
131649
|
'--prefix',
|
|
131618
131650
|
installBaseDir,
|
|
131619
131651
|
'--save-optional'
|
|
131620
131652
|
]);
|
|
131621
|
-
if ('pnpm' === pmName) return (0,
|
|
131653
|
+
if ('pnpm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_8.tj)(pm, [
|
|
131622
131654
|
'add',
|
|
131623
|
-
...
|
|
131655
|
+
...dependencySpecs,
|
|
131624
131656
|
'--dir',
|
|
131625
131657
|
installBaseDir,
|
|
131626
131658
|
'--save-optional',
|
|
131659
|
+
'--ignore-workspace',
|
|
131660
|
+
'--lockfile=false',
|
|
131627
131661
|
'--silent'
|
|
131628
131662
|
]);
|
|
131629
|
-
if ('bun' === pmName) return (0,
|
|
131663
|
+
if ('bun' === pmName) return (0, _webpack_lib_package_manager__rspack_import_8.tj)(pm, [
|
|
131630
131664
|
'add',
|
|
131631
|
-
...
|
|
131665
|
+
...dependencySpecs,
|
|
131632
131666
|
'--cwd',
|
|
131633
131667
|
installBaseDir,
|
|
131634
131668
|
'--optional'
|
|
131635
131669
|
]);
|
|
131636
|
-
return (0,
|
|
131670
|
+
return (0, _webpack_lib_package_manager__rspack_import_8.tj)(pm, [
|
|
131637
131671
|
'--silent',
|
|
131638
131672
|
'install',
|
|
131639
|
-
...
|
|
131673
|
+
...dependencySpecs,
|
|
131640
131674
|
'--cwd',
|
|
131641
131675
|
installBaseDir,
|
|
131642
131676
|
'--optional'
|
|
@@ -131657,26 +131691,28 @@ var __webpack_modules__ = {
|
|
|
131657
131691
|
'--prefix',
|
|
131658
131692
|
installBaseDir
|
|
131659
131693
|
] : [];
|
|
131660
|
-
if ('yarn' === pmName) return (0,
|
|
131694
|
+
if ('yarn' === pmName) return (0, _webpack_lib_package_manager__rspack_import_8.tj)(pm, [
|
|
131661
131695
|
'install',
|
|
131662
131696
|
'--silent',
|
|
131663
131697
|
...dirArgs
|
|
131664
131698
|
]);
|
|
131665
|
-
if ('npm' === pmName) return (0,
|
|
131699
|
+
if ('npm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_8.tj)(pm, [
|
|
131666
131700
|
'install',
|
|
131667
131701
|
'--silent',
|
|
131668
131702
|
...dirArgs
|
|
131669
131703
|
]);
|
|
131670
|
-
if ('pnpm' === pmName) return (0,
|
|
131704
|
+
if ('pnpm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_8.tj)(pm, [
|
|
131671
131705
|
'install',
|
|
131672
131706
|
'--silent',
|
|
131673
|
-
...dirArgs
|
|
131707
|
+
...dirArgs,
|
|
131708
|
+
'--ignore-workspace',
|
|
131709
|
+
'--lockfile=false'
|
|
131674
131710
|
]);
|
|
131675
|
-
if ('bun' === pmName) return (0,
|
|
131711
|
+
if ('bun' === pmName) return (0, _webpack_lib_package_manager__rspack_import_8.tj)(pm, [
|
|
131676
131712
|
'install',
|
|
131677
131713
|
...dirArgs
|
|
131678
131714
|
]);
|
|
131679
|
-
return (0,
|
|
131715
|
+
return (0, _webpack_lib_package_manager__rspack_import_8.tj)(pm, [
|
|
131680
131716
|
'install',
|
|
131681
131717
|
'--silent',
|
|
131682
131718
|
...dirArgs
|
|
@@ -131688,15 +131724,15 @@ var __webpack_modules__ = {
|
|
|
131688
131724
|
let wslContext;
|
|
131689
131725
|
let installBaseDir;
|
|
131690
131726
|
try {
|
|
131691
|
-
installBaseDir =
|
|
131692
|
-
|
|
131693
|
-
pm = (0,
|
|
131727
|
+
installBaseDir = resolveOptionalInstallRoot();
|
|
131728
|
+
ensureOptionalInstallBaseDir(installBaseDir);
|
|
131729
|
+
pm = (0, _webpack_lib_package_manager__rspack_import_8._c)({
|
|
131694
131730
|
cwd: installBaseDir
|
|
131695
131731
|
});
|
|
131696
131732
|
wslContext = resolveWslContext(installBaseDir);
|
|
131697
131733
|
if (!wslContext.useWsl) pm = await preferCorepackFallback(pm);
|
|
131698
131734
|
const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
|
|
131699
|
-
const setupMessages =
|
|
131735
|
+
const setupMessages = _messages__rspack_import_3._j([
|
|
131700
131736
|
integration
|
|
131701
131737
|
], integration, isAuthor);
|
|
131702
131738
|
const setupMessage = setupMessages[0];
|
|
@@ -131709,10 +131745,12 @@ var __webpack_modules__ = {
|
|
|
131709
131745
|
dependency
|
|
131710
131746
|
], wslContext.installDir || installBaseDir);
|
|
131711
131747
|
const execCommand = wrapCommandForWsl(installCommand, wslContext);
|
|
131712
|
-
const fallbackNpmCommand = wslContext.useWsl ? void 0 : (0,
|
|
131748
|
+
const fallbackNpmCommand = wslContext.useWsl ? void 0 : (0, _webpack_lib_package_manager__rspack_import_8.sX)([
|
|
131713
131749
|
'--silent',
|
|
131714
131750
|
'install',
|
|
131715
|
-
|
|
131751
|
+
...(0, _webpack_lib_optional_dependencies__rspack_import_7.ad)([
|
|
131752
|
+
dependency
|
|
131753
|
+
]),
|
|
131716
131754
|
'--prefix',
|
|
131717
131755
|
installBaseDir,
|
|
131718
131756
|
'--save-optional'
|
|
@@ -131725,10 +131763,10 @@ var __webpack_modules__ = {
|
|
|
131725
131763
|
}
|
|
131726
131764
|
await new Promise((resolve)=>setTimeout(resolve, 500));
|
|
131727
131765
|
if (isAuthor) {
|
|
131728
|
-
console.log(
|
|
131766
|
+
console.log(_messages__rspack_import_3.cr(integration));
|
|
131729
131767
|
const rootInstall = getRootInstallCommand(pm, wslContext.useWsl ? wslContext.installDir : void 0);
|
|
131730
131768
|
const rootCommand = wrapCommandForWsl(rootInstall, wslContext);
|
|
131731
|
-
const rootFallbackCommand = wslContext.useWsl ? void 0 : (0,
|
|
131769
|
+
const rootFallbackCommand = wslContext.useWsl ? void 0 : (0, _webpack_lib_package_manager__rspack_import_8.sX)([
|
|
131732
131770
|
'--silent',
|
|
131733
131771
|
'install',
|
|
131734
131772
|
'--prefix',
|
|
@@ -131739,7 +131777,7 @@ var __webpack_modules__ = {
|
|
|
131739
131777
|
fallbackNpmCommand: rootFallbackCommand,
|
|
131740
131778
|
allowFallbackOnFailure: !wslContext.useWsl && 'npm' !== pm.name && void 0 !== rootFallbackCommand
|
|
131741
131779
|
});
|
|
131742
|
-
console.log(
|
|
131780
|
+
console.log(_messages__rspack_import_3.ys(integration));
|
|
131743
131781
|
}
|
|
131744
131782
|
return true;
|
|
131745
131783
|
} catch (error) {
|
|
@@ -131757,17 +131795,19 @@ var __webpack_modules__ = {
|
|
|
131757
131795
|
npm_config_userconfig: process.env.npm_config_userconfig,
|
|
131758
131796
|
installBaseDir,
|
|
131759
131797
|
wslContext,
|
|
131760
|
-
pm
|
|
131798
|
+
pm,
|
|
131799
|
+
errorCode: error?.code,
|
|
131800
|
+
errorMessage: error instanceof Error ? error.message : String(error || 'unknown error')
|
|
131761
131801
|
});
|
|
131762
131802
|
const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
|
|
131763
|
-
if (isMissingManagerError(error)) console.error(
|
|
131764
|
-
else console.error(
|
|
131803
|
+
if (isMissingManagerError(error)) console.error(_messages__rspack_import_3.Vo(integration));
|
|
131804
|
+
else console.error(_messages__rspack_import_3.DX(integration, error, isAuthor));
|
|
131765
131805
|
return false;
|
|
131766
131806
|
}
|
|
131767
131807
|
}
|
|
131768
131808
|
async function installOptionalDependenciesBatch(plans) {
|
|
131769
131809
|
if (!plans.length) return;
|
|
131770
|
-
console.log(`${
|
|
131810
|
+
console.log(`${pintor__rspack_import_4_default().gray('►►►')} Found ${pintor__rspack_import_4_default().yellow(String(plans.length))} specialized integration${1 === plans.length ? '' : 's'} needing installation...`);
|
|
131771
131811
|
for (const [index, plan] of plans.entries()){
|
|
131772
131812
|
const didInstall = await installOptionalDependencies(plan.integration, plan.dependencies, {
|
|
131773
131813
|
index: index + 1,
|
|
@@ -131834,7 +131874,6 @@ var __webpack_modules__ = {
|
|
|
131834
131874
|
Vo: ()=>optionalInstallManagerMissing,
|
|
131835
131875
|
_j: ()=>optionalToolingSetup,
|
|
131836
131876
|
cr: ()=>optionalToolingRootInstall,
|
|
131837
|
-
eG: ()=>optionalInstallRootMissing,
|
|
131838
131877
|
fD: ()=>cssConfigsDetected,
|
|
131839
131878
|
uo: ()=>cssIntegrationsEnabled,
|
|
131840
131879
|
ys: ()=>optionalToolingReady,
|
|
@@ -131871,14 +131910,6 @@ var __webpack_modules__ = {
|
|
|
131871
131910
|
const prefix = isAuthor ? pintor__rspack_import_0_default().brightMagenta('ERROR Author says') : pintor__rspack_import_0_default().red('ERROR');
|
|
131872
131911
|
return `${prefix} [${integration}] Failed to install dependencies.\n${pintor__rspack_import_0_default().red(String(error?.message || error))}`;
|
|
131873
131912
|
}
|
|
131874
|
-
function optionalInstallRootMissing(integration) {
|
|
131875
|
-
const prefix = pintor__rspack_import_0_default().red('ERROR');
|
|
131876
|
-
return [
|
|
131877
|
-
`${prefix} [${integration}] Failed to locate the extension-develop runtime.`,
|
|
131878
|
-
'Optional tooling must install into the extension-develop package, not the user project.',
|
|
131879
|
-
'Reinstall Extension.js or run the command from a valid Extension.js installation.'
|
|
131880
|
-
].join('\n');
|
|
131881
|
-
}
|
|
131882
131913
|
function optionalInstallManagerMissing(integration) {
|
|
131883
131914
|
const prefix = pintor__rspack_import_0_default().red('ERROR');
|
|
131884
131915
|
return [
|
|
@@ -133935,7 +133966,8 @@ var __webpack_modules__ = {
|
|
|
133935
133966
|
}
|
|
133936
133967
|
function buildWebpack(projectDir, stats, browser) {
|
|
133937
133968
|
const statsJson = stats?.toJson();
|
|
133938
|
-
const
|
|
133969
|
+
const outputPath = 'string' == typeof stats?.compilation?.outputOptions?.path ? stats.compilation.outputOptions.path : '';
|
|
133970
|
+
const manifestPath = outputPath ? path__rspack_import_1.join(outputPath, 'manifest.json') : path__rspack_import_1.join(projectDir, 'manifest.json');
|
|
133939
133971
|
const manifest = JSON.parse(fs__rspack_import_0.readFileSync(manifestPath, 'utf8'));
|
|
133940
133972
|
const assets = statsJson?.assets;
|
|
133941
133973
|
const heading = `${getLoggingPrefix('info')} Building ${pintor__rspack_import_2_default().blue(manifest.name)} extension using ${capitalizedBrowserName(browser)} defaults...\n`;
|
|
@@ -134174,6 +134206,50 @@ var __webpack_modules__ = {
|
|
|
134174
134206
|
return `${getLoggingPrefix('error')} Your project declares dependencies that are managed by ${pintor__rspack_import_2_default().blue('Extension.js')} and referenced in ${pintor__rspack_import_2_default().underline('extension.config.js')}\n${pintor__rspack_import_2_default().red('This can cause version conflicts and break the development/build process.')}\n\n${pintor__rspack_import_2_default().gray('Managed dependencies (remove these from your package.json):')}\n${list}\n\n${pintor__rspack_import_2_default().gray('PATH')} ${pintor__rspack_import_2_default().underline(userPackageJsonPath)}\nIf you need a different version, open an issue so we can consider bundling it safely.\nOperation aborted.`;
|
|
134175
134207
|
}
|
|
134176
134208
|
},
|
|
134209
|
+
"./webpack/webpack-lib/optional-dependencies.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
134210
|
+
"use strict";
|
|
134211
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
134212
|
+
ad: ()=>resolveOptionalDependencySpecs,
|
|
134213
|
+
oR: ()=>getOptionalDependenciesSignature
|
|
134214
|
+
});
|
|
134215
|
+
var fs__rspack_import_0 = __webpack_require__("fs");
|
|
134216
|
+
var path__rspack_import_1 = __webpack_require__("path");
|
|
134217
|
+
var crypto__rspack_import_2 = __webpack_require__("crypto");
|
|
134218
|
+
function getOptionalDependenciesPath() {
|
|
134219
|
+
const candidates = [
|
|
134220
|
+
path__rspack_import_1.join(__dirname, 'optional-dependencies.json'),
|
|
134221
|
+
path__rspack_import_1.resolve(__dirname, '..', 'webpack', 'webpack-lib', 'optional-dependencies.json')
|
|
134222
|
+
];
|
|
134223
|
+
for (const candidate of candidates)if (fs__rspack_import_0.existsSync(candidate)) return candidate;
|
|
134224
|
+
return candidates[0];
|
|
134225
|
+
}
|
|
134226
|
+
function loadOptionalDependencies() {
|
|
134227
|
+
const metadataPath = getOptionalDependenciesPath();
|
|
134228
|
+
if (!fs__rspack_import_0.existsSync(metadataPath)) throw new Error(`optional-dependencies.json not found at ${metadataPath}. This indicates a corrupted installation.`);
|
|
134229
|
+
try {
|
|
134230
|
+
const content = fs__rspack_import_0.readFileSync(metadataPath, 'utf8');
|
|
134231
|
+
const parsed = JSON.parse(content);
|
|
134232
|
+
if (!parsed || 'object' != typeof parsed || Array.isArray(parsed)) throw new Error('optional-dependencies.json must contain an object');
|
|
134233
|
+
return parsed;
|
|
134234
|
+
} catch (error) {
|
|
134235
|
+
throw new Error(`Failed to load optional-dependencies.json: ${error.message}`);
|
|
134236
|
+
}
|
|
134237
|
+
}
|
|
134238
|
+
function resolveOptionalDependencySpecs(dependencies) {
|
|
134239
|
+
const metadata = loadOptionalDependencies();
|
|
134240
|
+
const missingFromMetadata = dependencies.filter((dep)=>!(dep in metadata));
|
|
134241
|
+
if (missingFromMetadata.length > 0) throw new Error(`Dependencies not found in optional-dependencies.json: ${missingFromMetadata.join(', ')}`);
|
|
134242
|
+
return dependencies.map((dep)=>`${dep}@${metadata[dep]}`);
|
|
134243
|
+
}
|
|
134244
|
+
function getOptionalDependenciesSignature() {
|
|
134245
|
+
const metadata = loadOptionalDependencies();
|
|
134246
|
+
const stable = JSON.stringify(Object.keys(metadata).sort().reduce((acc, key)=>{
|
|
134247
|
+
acc[key] = metadata[key];
|
|
134248
|
+
return acc;
|
|
134249
|
+
}, {}));
|
|
134250
|
+
return (0, crypto__rspack_import_2.createHash)('sha1').update(stable).digest('hex');
|
|
134251
|
+
}
|
|
134252
|
+
},
|
|
134177
134253
|
"./webpack/webpack-lib/optional-deps-resolver.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
134178
134254
|
"use strict";
|
|
134179
134255
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -134187,12 +134263,15 @@ var __webpack_modules__ = {
|
|
|
134187
134263
|
var _plugin_css_css_lib_integrations__rspack_import_3 = __webpack_require__("./webpack/plugin-css/css-lib/integrations.ts");
|
|
134188
134264
|
const installSingleFlight = new Map();
|
|
134189
134265
|
function getResolutionBases(projectPath) {
|
|
134266
|
+
const optionalInstallRoot = (0, _plugin_css_css_lib_integrations__rspack_import_3.Iy)();
|
|
134190
134267
|
const extensionRoot = (0, _plugin_css_css_lib_integrations__rspack_import_3.He)();
|
|
134191
134268
|
const bases = [
|
|
134192
134269
|
projectPath,
|
|
134270
|
+
optionalInstallRoot && fs__rspack_import_0.existsSync(optionalInstallRoot) ? optionalInstallRoot : void 0,
|
|
134193
134271
|
extensionRoot || void 0,
|
|
134194
134272
|
process.cwd()
|
|
134195
134273
|
].filter(Boolean);
|
|
134274
|
+
if (optionalInstallRoot && optionalInstallRoot.includes('.pnpm')) bases.push(path__rspack_import_1.join(optionalInstallRoot, '..', '..'));
|
|
134196
134275
|
if (extensionRoot && extensionRoot.includes('.pnpm')) bases.push(path__rspack_import_1.join(extensionRoot, '..', '..'));
|
|
134197
134276
|
return Array.from(new Set(bases));
|
|
134198
134277
|
}
|
|
@@ -134364,7 +134443,7 @@ var __webpack_modules__ = {
|
|
|
134364
134443
|
}
|
|
134365
134444
|
}
|
|
134366
134445
|
async function ensureInstalledAndVerified(input) {
|
|
134367
|
-
const installRoot = (0, _plugin_css_css_lib_integrations__rspack_import_3.
|
|
134446
|
+
const installRoot = (0, _plugin_css_css_lib_integrations__rspack_import_3.Iy)();
|
|
134368
134447
|
const key = [
|
|
134369
134448
|
installRoot || 'missing-install-root',
|
|
134370
134449
|
...input.installDependencies.slice().sort()
|
|
@@ -134387,7 +134466,7 @@ var __webpack_modules__ = {
|
|
|
134387
134466
|
}
|
|
134388
134467
|
}
|
|
134389
134468
|
function resolveOptionalDependencySync(dependencyId, projectPath) {
|
|
134390
|
-
const installRoot = (0, _plugin_css_css_lib_integrations__rspack_import_3.
|
|
134469
|
+
const installRoot = (0, _plugin_css_css_lib_integrations__rspack_import_3.Iy)();
|
|
134391
134470
|
const resolved = resolveFromKnownLocations(dependencyId, projectPath, installRoot);
|
|
134392
134471
|
if (resolved) return resolved;
|
|
134393
134472
|
const bases = getResolutionBases(projectPath);
|
|
@@ -134398,7 +134477,7 @@ var __webpack_modules__ = {
|
|
|
134398
134477
|
input.dependencyId
|
|
134399
134478
|
];
|
|
134400
134479
|
const verifyPackageIds = input.verifyPackageIds || installDependencies;
|
|
134401
|
-
const installRoot = (0, _plugin_css_css_lib_integrations__rspack_import_3.
|
|
134480
|
+
const installRoot = (0, _plugin_css_css_lib_integrations__rspack_import_3.Iy)();
|
|
134402
134481
|
const resolvedBeforeInstall = resolveFromKnownLocations(input.dependencyId, input.projectPath, installRoot);
|
|
134403
134482
|
const missingBeforeInstall = resolvedBeforeInstall ? getModuleContextMissingDependencies(resolvedBeforeInstall, verifyPackageIds, input.dependencyId, {
|
|
134404
134483
|
integration: input.integration
|
|
@@ -134475,7 +134554,7 @@ var __webpack_modules__ = {
|
|
|
134475
134554
|
integration: input.integration,
|
|
134476
134555
|
dependencyId: input.dependencyId,
|
|
134477
134556
|
projectPath: input.projectPath,
|
|
134478
|
-
installRoot: (0, _plugin_css_css_lib_integrations__rspack_import_3.
|
|
134557
|
+
installRoot: (0, _plugin_css_css_lib_integrations__rspack_import_3.Iy)(),
|
|
134479
134558
|
installDependencies: input.installDependencies || [
|
|
134480
134559
|
input.dependencyId
|
|
134481
134560
|
],
|
|
@@ -134593,7 +134672,7 @@ var __webpack_modules__ = {
|
|
|
134593
134672
|
}
|
|
134594
134673
|
function getPackageManagerOverride() {
|
|
134595
134674
|
const name = normalizePackageManager(process.env.EXTENSION_JS_PACKAGE_MANAGER);
|
|
134596
|
-
const execPath = process.env.EXTENSION_JS_PM_EXEC_PATH;
|
|
134675
|
+
const execPath = process.env.EXTENSION_JS_PM_EXEC_PATH || process.env.npm_execpath || process.env.NPM_EXEC_PATH;
|
|
134597
134676
|
if (!name && !execPath) return;
|
|
134598
134677
|
const inferredName = name || inferPackageManagerFromPath(execPath) || 'npm';
|
|
134599
134678
|
return {
|
|
@@ -134603,19 +134682,23 @@ var __webpack_modules__ = {
|
|
|
134603
134682
|
}
|
|
134604
134683
|
function detectPackageManagerFromEnv() {
|
|
134605
134684
|
const userAgent = process.env.npm_config_user_agent || '';
|
|
134685
|
+
const execPath = process.env.npm_execpath || process.env.NPM_EXEC_PATH || '';
|
|
134606
134686
|
if (userAgent.includes('pnpm')) return {
|
|
134607
|
-
name: 'pnpm'
|
|
134687
|
+
name: 'pnpm',
|
|
134688
|
+
execPath: execPath || void 0
|
|
134608
134689
|
};
|
|
134609
134690
|
if (userAgent.includes('yarn')) return {
|
|
134610
|
-
name: 'yarn'
|
|
134691
|
+
name: 'yarn',
|
|
134692
|
+
execPath: execPath || void 0
|
|
134611
134693
|
};
|
|
134612
134694
|
if (userAgent.includes('bun')) return {
|
|
134613
|
-
name: 'bun'
|
|
134695
|
+
name: 'bun',
|
|
134696
|
+
execPath: execPath || void 0
|
|
134614
134697
|
};
|
|
134615
134698
|
if (userAgent.includes('npm')) return {
|
|
134616
|
-
name: 'npm'
|
|
134699
|
+
name: 'npm',
|
|
134700
|
+
execPath: execPath || void 0
|
|
134617
134701
|
};
|
|
134618
|
-
const execPath = process.env.npm_execpath || process.env.NPM_EXEC_PATH || '';
|
|
134619
134702
|
if (execPath) {
|
|
134620
134703
|
const inferred = inferPackageManagerFromPath(execPath) || 'npm';
|
|
134621
134704
|
return {
|
|
@@ -135106,7 +135189,7 @@ var __webpack_modules__ = {
|
|
|
135106
135189
|
},
|
|
135107
135190
|
"./package.json" (module) {
|
|
135108
135191
|
"use strict";
|
|
135109
|
-
module.exports = JSON.parse('{"rE":"3.
|
|
135192
|
+
module.exports = JSON.parse('{"rE":"3.9.0-next.0","El":{"@rspack/core":"^1.7.5","@rspack/dev-server":"^1.1.5","@swc/core":"^1.15.8","@swc/helpers":"^0.5.18","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","chrome-location2":"4.0.0","chromium-location":"2.0.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","edge-location":"2.2.0","extension-from-store":"^0.1.1","firefox-location2":"3.0.0","go-git-it":"^5.1.1","ignore":"^7.0.5","loader-utils":"^3.3.1","magic-string":"^0.30.21","parse5":"^8.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","schema-utils":"^4.3.3","tiny-glob":"^0.2.9","unique-names-generator":"^4.7.1","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.19.0"}}');
|
|
135110
135193
|
}
|
|
135111
135194
|
};
|
|
135112
135195
|
var __webpack_module_cache__ = {};
|
|
@@ -135667,6 +135750,7 @@ var __webpack_exports__ = {};
|
|
|
135667
135750
|
var external_pintor_ = __webpack_require__("pintor");
|
|
135668
135751
|
var external_pintor_default = /*#__PURE__*/ __webpack_require__.n(external_pintor_);
|
|
135669
135752
|
var external_crypto_ = __webpack_require__("crypto");
|
|
135753
|
+
var optional_dependencies = __webpack_require__("./webpack/webpack-lib/optional-dependencies.ts");
|
|
135670
135754
|
function getPreflightCacheDir(packageRoot) {
|
|
135671
135755
|
return external_path_.join(packageRoot, '.cache', 'extensionjs', 'preflight');
|
|
135672
135756
|
}
|
|
@@ -135677,12 +135761,12 @@ var __webpack_exports__ = {};
|
|
|
135677
135761
|
return external_path_.join(cacheDir, 'version.json');
|
|
135678
135762
|
}
|
|
135679
135763
|
function getProjectDepsHash(projectPath) {
|
|
135680
|
-
const
|
|
135764
|
+
const optionalDepsSignature = (0, optional_dependencies.oR)();
|
|
135681
135765
|
try {
|
|
135682
135766
|
const packageJsonPath = external_path_.join(projectPath, 'package.json');
|
|
135683
135767
|
if (!external_fs_.existsSync(packageJsonPath)) return (0, external_crypto_.createHash)('sha1').update(JSON.stringify({
|
|
135684
135768
|
packageJson: 'no-package-json',
|
|
135685
|
-
|
|
135769
|
+
optionalDeps: optionalDepsSignature
|
|
135686
135770
|
})).digest('hex');
|
|
135687
135771
|
const raw = external_fs_.readFileSync(packageJsonPath, 'utf8');
|
|
135688
135772
|
const parsed = JSON.parse(raw || '{}');
|
|
@@ -135697,42 +135781,16 @@ var __webpack_exports__ = {};
|
|
|
135697
135781
|
const stable = JSON.stringify({
|
|
135698
135782
|
dependencies: normalize(deps),
|
|
135699
135783
|
devDependencies: normalize(devDeps),
|
|
135700
|
-
|
|
135784
|
+
optionalDeps: optionalDepsSignature
|
|
135701
135785
|
});
|
|
135702
135786
|
return (0, external_crypto_.createHash)('sha1').update(stable).digest('hex');
|
|
135703
135787
|
} catch {
|
|
135704
135788
|
return (0, external_crypto_.createHash)('sha1').update(JSON.stringify({
|
|
135705
135789
|
packageJson: 'invalid-package-json',
|
|
135706
|
-
|
|
135790
|
+
optionalDeps: optionalDepsSignature
|
|
135707
135791
|
})).digest('hex');
|
|
135708
135792
|
}
|
|
135709
135793
|
}
|
|
135710
|
-
function getNearestLockfileSignature(projectPath) {
|
|
135711
|
-
const lockfileNames = [
|
|
135712
|
-
'pnpm-lock.yaml',
|
|
135713
|
-
'package-lock.json',
|
|
135714
|
-
'yarn.lock',
|
|
135715
|
-
'bun.lock',
|
|
135716
|
-
'bun.lockb'
|
|
135717
|
-
];
|
|
135718
|
-
let current = external_path_.resolve(projectPath);
|
|
135719
|
-
while(true){
|
|
135720
|
-
for (const lockfileName of lockfileNames){
|
|
135721
|
-
const lockfilePath = external_path_.join(current, lockfileName);
|
|
135722
|
-
if (external_fs_.existsSync(lockfilePath)) try {
|
|
135723
|
-
const content = external_fs_.readFileSync(lockfilePath);
|
|
135724
|
-
const digest = (0, external_crypto_.createHash)('sha1').update(content).digest('hex');
|
|
135725
|
-
return `${lockfileName}:${digest}`;
|
|
135726
|
-
} catch {
|
|
135727
|
-
return `${lockfileName}:unreadable`;
|
|
135728
|
-
}
|
|
135729
|
-
}
|
|
135730
|
-
const parent = external_path_.dirname(current);
|
|
135731
|
-
if (parent === current) break;
|
|
135732
|
-
current = parent;
|
|
135733
|
-
}
|
|
135734
|
-
return 'none';
|
|
135735
|
-
}
|
|
135736
135794
|
function ensureCacheVersion(cacheDir) {
|
|
135737
135795
|
const versionPath = getCacheVersionPath(cacheDir);
|
|
135738
135796
|
const expectedVersion = package_0.rE;
|
|
@@ -135820,12 +135878,15 @@ var __webpack_exports__ = {};
|
|
|
135820
135878
|
var postcss = __webpack_require__("./webpack/plugin-css/css-tools/postcss.ts");
|
|
135821
135879
|
var js_frameworks_lib_messages = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/messages.ts");
|
|
135822
135880
|
function getResolutionPaths(projectPath) {
|
|
135881
|
+
const optionalInstallRoot = (0, integrations.Iy)();
|
|
135823
135882
|
const extensionRoot = (0, integrations.He)();
|
|
135824
135883
|
const paths = [
|
|
135825
135884
|
projectPath || void 0,
|
|
135885
|
+
optionalInstallRoot && external_fs_.existsSync(optionalInstallRoot) ? optionalInstallRoot : void 0,
|
|
135826
135886
|
extensionRoot || void 0,
|
|
135827
135887
|
process.cwd()
|
|
135828
135888
|
].filter(Boolean);
|
|
135889
|
+
if (optionalInstallRoot && optionalInstallRoot.includes('.pnpm')) paths.push(external_path_.join(optionalInstallRoot, '..', '..'));
|
|
135829
135890
|
if (extensionRoot && extensionRoot.includes('.pnpm')) paths.push(external_path_.join(extensionRoot, '..', '..'));
|
|
135830
135891
|
return Array.from(new Set(paths));
|
|
135831
135892
|
}
|
|
@@ -136013,7 +136074,7 @@ var __webpack_exports__ = {};
|
|
|
136013
136074
|
]);
|
|
136014
136075
|
const debug = isAuthor;
|
|
136015
136076
|
if (projectStructure.packageJsonPath) assertNoManagedDependencyConflicts(projectStructure.packageJsonPath, manifestDir);
|
|
136016
|
-
const commandConfig = await (0, config_loader.eY)(
|
|
136077
|
+
const commandConfig = await (0, config_loader.eY)(packageJsonDir, 'build');
|
|
136017
136078
|
const specialFoldersData = (0, get_data.H)(packageJsonDir);
|
|
136018
136079
|
const distPath = (0, webpack_lib_paths.q4)(packageJsonDir, browser);
|
|
136019
136080
|
if (debug) {
|
|
@@ -136039,7 +136100,7 @@ var __webpack_exports__ = {};
|
|
|
136039
136100
|
}
|
|
136040
136101
|
});
|
|
136041
136102
|
const allPluginsButBrowserRunners = baseConfig.plugins?.filter((plugin)=>plugin?.constructor.name !== 'plugin-browsers');
|
|
136042
|
-
const userExtensionConfig = await (0, config_loader.Tu)(
|
|
136103
|
+
const userExtensionConfig = await (0, config_loader.Tu)(packageJsonDir);
|
|
136043
136104
|
const userConfig = userExtensionConfig({
|
|
136044
136105
|
...baseConfig,
|
|
136045
136106
|
plugins: allPluginsButBrowserRunners
|
|
@@ -136306,8 +136367,8 @@ var __webpack_exports__ = {};
|
|
|
136306
136367
|
async function extensionPreview(pathOrRemoteUrl, previewOptions) {
|
|
136307
136368
|
const projectStructure = await getProjectStructure(pathOrRemoteUrl);
|
|
136308
136369
|
const debug = 'true' === process.env.EXTENSION_AUTHOR_MODE;
|
|
136309
|
-
if (projectStructure.packageJsonPath) assertNoManagedDependencyConflicts(projectStructure.packageJsonPath, external_path_.dirname(projectStructure.manifestPath));
|
|
136310
136370
|
const { manifestDir, packageJsonDir } = (0, webpack_lib_paths.fu)(projectStructure);
|
|
136371
|
+
if (projectStructure.packageJsonPath) assertNoManagedDependencyConflicts(projectStructure.packageJsonPath, packageJsonDir);
|
|
136311
136372
|
const browser = (0, webpack_lib_paths.YN)(previewOptions.browser || 'chrome', previewOptions.chromiumBinary, previewOptions.geckoBinary || previewOptions.firefoxBinary);
|
|
136312
136373
|
const outputPath = (0, webpack_lib_paths.u2)(projectStructure, browser, previewOptions.outputPath);
|
|
136313
136374
|
const distPath = (0, webpack_lib_paths.q4)(packageJsonDir, browser);
|
package/package.json
CHANGED
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
"types": "./dist/module.d.ts",
|
|
22
22
|
"files": [
|
|
23
23
|
"dist",
|
|
24
|
-
"webpack/webpack-lib/build-dependencies.json"
|
|
24
|
+
"webpack/webpack-lib/build-dependencies.json",
|
|
25
|
+
"webpack/webpack-lib/optional-dependencies.json"
|
|
25
26
|
],
|
|
26
27
|
"name": "extension-develop",
|
|
27
|
-
"version": "3.
|
|
28
|
+
"version": "3.9.0-next.0",
|
|
28
29
|
"description": "Develop, build, preview, and package Extension.js projects.",
|
|
29
30
|
"author": {
|
|
30
31
|
"name": "Cezar Augusto",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"typescript": "5.9.3",
|
|
3
|
+
"react-refresh": "0.18.0",
|
|
4
|
+
"@rspack/plugin-react-refresh": "1.6.0",
|
|
5
|
+
"preact": "10.27.2",
|
|
6
|
+
"@prefresh/core": "1.5.9",
|
|
7
|
+
"@prefresh/utils": "1.2.1",
|
|
8
|
+
"@rspack/plugin-preact-refresh": "1.1.4",
|
|
9
|
+
"vue": "3.5.26",
|
|
10
|
+
"vue-loader": "17.4.2",
|
|
11
|
+
"@vue/compiler-sfc": "3.5.26",
|
|
12
|
+
"svelte-loader": "3.2.4",
|
|
13
|
+
"less": "4.5.1",
|
|
14
|
+
"less-loader": "12.3.0",
|
|
15
|
+
"postcss": "8.5.6",
|
|
16
|
+
"postcss-loader": "8.2.0",
|
|
17
|
+
"postcss-preset-env": "11.1.1",
|
|
18
|
+
"postcss-scss": "4.0.9",
|
|
19
|
+
"sass-loader": "16.0.6"
|
|
20
|
+
}
|