extension-develop 3.9.0-next.5 → 3.9.1-canary.233.8976161
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/module.cjs +231 -47
- package/package.json +1 -1
package/dist/module.cjs
CHANGED
|
@@ -128647,13 +128647,17 @@ var __webpack_modules__ = {
|
|
|
128647
128647
|
"use strict";
|
|
128648
128648
|
__webpack_require__.d(__webpack_exports__, {
|
|
128649
128649
|
CW: ()=>cleanupOldTempProfiles,
|
|
128650
|
+
J1: ()=>prepareChromiumProfileForLaunch,
|
|
128651
|
+
RE: ()=>markManagedEphemeralProfile,
|
|
128650
128652
|
aY: ()=>findAvailablePortNear,
|
|
128651
128653
|
jl: ()=>deriveDebugPortWithInstance,
|
|
128652
128654
|
ov: ()=>filterBrowserFlags
|
|
128653
128655
|
});
|
|
128654
128656
|
var fs__rspack_import_0 = __webpack_require__("fs");
|
|
128655
|
-
var
|
|
128656
|
-
var
|
|
128657
|
+
var os__rspack_import_1 = __webpack_require__("os");
|
|
128658
|
+
var path__rspack_import_2 = __webpack_require__("path");
|
|
128659
|
+
var net__rspack_import_3 = __webpack_require__("net");
|
|
128660
|
+
const MANAGED_EPHEMERAL_PROFILE_MARKER = '.extension-js-managed-profile';
|
|
128657
128661
|
function shortInstanceId(instanceId) {
|
|
128658
128662
|
return instanceId ? String(instanceId).slice(0, 8) : '';
|
|
128659
128663
|
}
|
|
@@ -128675,7 +128679,7 @@ var __webpack_modules__ = {
|
|
|
128675
128679
|
async function findAvailablePortNear(startPort, maxAttempts = 20, host = '127.0.0.1') {
|
|
128676
128680
|
function tryPort(port) {
|
|
128677
128681
|
return new Promise((resolve)=>{
|
|
128678
|
-
const server =
|
|
128682
|
+
const server = net__rspack_import_3.createServer();
|
|
128679
128683
|
server.once('error', ()=>{
|
|
128680
128684
|
resolve(false);
|
|
128681
128685
|
});
|
|
@@ -128693,6 +128697,77 @@ var __webpack_modules__ = {
|
|
|
128693
128697
|
}
|
|
128694
128698
|
return startPort;
|
|
128695
128699
|
}
|
|
128700
|
+
function isProcessLikelyAlive(pid) {
|
|
128701
|
+
if (!Number.isInteger(pid) || pid <= 0) return false;
|
|
128702
|
+
try {
|
|
128703
|
+
process.kill(pid, 0);
|
|
128704
|
+
return true;
|
|
128705
|
+
} catch {
|
|
128706
|
+
return false;
|
|
128707
|
+
}
|
|
128708
|
+
}
|
|
128709
|
+
function parseChromiumSingletonOwner(raw) {
|
|
128710
|
+
const value = String(raw || '').trim();
|
|
128711
|
+
const lastDash = value.lastIndexOf('-');
|
|
128712
|
+
if (lastDash <= 0) return null;
|
|
128713
|
+
const host = value.slice(0, lastDash).trim();
|
|
128714
|
+
const pid = parseInt(value.slice(lastDash + 1).trim(), 10);
|
|
128715
|
+
if (!host || !Number.isInteger(pid) || pid <= 0) return null;
|
|
128716
|
+
return {
|
|
128717
|
+
host,
|
|
128718
|
+
pid
|
|
128719
|
+
};
|
|
128720
|
+
}
|
|
128721
|
+
function readChromiumSingletonOwner(profilePath) {
|
|
128722
|
+
const lockPath = path__rspack_import_2.join(profilePath, 'SingletonLock');
|
|
128723
|
+
if (!fs__rspack_import_0.existsSync(lockPath)) return null;
|
|
128724
|
+
try {
|
|
128725
|
+
const stat = fs__rspack_import_0.lstatSync(lockPath);
|
|
128726
|
+
if (stat.isSymbolicLink()) return parseChromiumSingletonOwner(fs__rspack_import_0.readlinkSync(lockPath));
|
|
128727
|
+
} catch {}
|
|
128728
|
+
try {
|
|
128729
|
+
return parseChromiumSingletonOwner(fs__rspack_import_0.readFileSync(lockPath, 'utf8'));
|
|
128730
|
+
} catch {
|
|
128731
|
+
return null;
|
|
128732
|
+
}
|
|
128733
|
+
}
|
|
128734
|
+
function removeChromiumSingletonArtifacts(profilePath) {
|
|
128735
|
+
const removed = [];
|
|
128736
|
+
for (const name of [
|
|
128737
|
+
'SingletonLock',
|
|
128738
|
+
'SingletonSocket',
|
|
128739
|
+
'SingletonCookie'
|
|
128740
|
+
]){
|
|
128741
|
+
const full = path__rspack_import_2.join(profilePath, name);
|
|
128742
|
+
if (fs__rspack_import_0.existsSync(full)) try {
|
|
128743
|
+
fs__rspack_import_0.rmSync(full, {
|
|
128744
|
+
recursive: true,
|
|
128745
|
+
force: true
|
|
128746
|
+
});
|
|
128747
|
+
removed.push(name);
|
|
128748
|
+
} catch {}
|
|
128749
|
+
}
|
|
128750
|
+
return removed;
|
|
128751
|
+
}
|
|
128752
|
+
function prepareChromiumProfileForLaunch(profilePath) {
|
|
128753
|
+
const owner = readChromiumSingletonOwner(profilePath);
|
|
128754
|
+
if (!owner) return {
|
|
128755
|
+
removedArtifacts: []
|
|
128756
|
+
};
|
|
128757
|
+
const currentHost = os__rspack_import_1.hostname().trim().toLowerCase();
|
|
128758
|
+
const ownerHost = owner.host.trim().toLowerCase();
|
|
128759
|
+
const sameHost = currentHost.length > 0 && currentHost === ownerHost;
|
|
128760
|
+
const alive = isProcessLikelyAlive(owner.pid);
|
|
128761
|
+
if (!sameHost || !alive) return {
|
|
128762
|
+
removedArtifacts: removeChromiumSingletonArtifacts(profilePath)
|
|
128763
|
+
};
|
|
128764
|
+
throw new Error(`Chromium profile "${profilePath}" is already in use by process ${owner.pid} on host ${owner.host}. Close that browser session or use a different profile before starting Extension.js.`);
|
|
128765
|
+
}
|
|
128766
|
+
function markManagedEphemeralProfile(profilePath) {
|
|
128767
|
+
try {
|
|
128768
|
+
fs__rspack_import_0.writeFileSync(path__rspack_import_2.join(profilePath, MANAGED_EPHEMERAL_PROFILE_MARKER), 'managed-ephemeral-profile\n', 'utf8');
|
|
128769
|
+
} catch {}
|
|
128770
|
+
}
|
|
128696
128771
|
function cleanupOldTempProfiles(baseDir, excludeBasename, maxAgeHours = 12) {
|
|
128697
128772
|
try {
|
|
128698
128773
|
if (!fs__rspack_import_0.existsSync(baseDir)) return;
|
|
@@ -128703,9 +128778,11 @@ var __webpack_modules__ = {
|
|
|
128703
128778
|
for (const entry of entries){
|
|
128704
128779
|
if (!entry.isDirectory()) continue;
|
|
128705
128780
|
const name = entry.name;
|
|
128706
|
-
if (
|
|
128781
|
+
if ('dev' === name) continue;
|
|
128707
128782
|
if (excludeBasename && name === excludeBasename) continue;
|
|
128708
|
-
const full =
|
|
128783
|
+
const full = path__rspack_import_2.join(baseDir, name);
|
|
128784
|
+
const markerPath = path__rspack_import_2.join(full, MANAGED_EPHEMERAL_PROFILE_MARKER);
|
|
128785
|
+
if (!fs__rspack_import_0.existsSync(markerPath)) continue;
|
|
128709
128786
|
let mtime = 0;
|
|
128710
128787
|
try {
|
|
128711
128788
|
const st = fs__rspack_import_0.statSync(full);
|
|
@@ -128996,6 +129073,7 @@ var __webpack_modules__ = {
|
|
|
128996
129073
|
external_fs_.mkdirSync(ephemDir, {
|
|
128997
129074
|
recursive: true
|
|
128998
129075
|
});
|
|
129076
|
+
(0, shared_utils.RE)(ephemDir);
|
|
128999
129077
|
userProfilePath = ephemDir;
|
|
129000
129078
|
try {
|
|
129001
129079
|
const maxAgeHours = parseInt(String(process.env.EXTENSION_TMP_PROFILE_MAX_AGE_HOURS || ''), 10);
|
|
@@ -129003,12 +129081,15 @@ var __webpack_modules__ = {
|
|
|
129003
129081
|
} catch {}
|
|
129004
129082
|
}
|
|
129005
129083
|
}
|
|
129006
|
-
if (userProfilePath)
|
|
129084
|
+
if (userProfilePath) {
|
|
129007
129085
|
external_fs_.mkdirSync(userProfilePath, {
|
|
129008
129086
|
recursive: true
|
|
129009
129087
|
});
|
|
129010
|
-
|
|
129011
|
-
|
|
129088
|
+
(0, shared_utils.J1)(userProfilePath);
|
|
129089
|
+
try {
|
|
129090
|
+
seedChromiumPreferences(userProfilePath, configOptions.browser, configOptions.preferences);
|
|
129091
|
+
} catch {}
|
|
129092
|
+
}
|
|
129012
129093
|
const excludeFlags = configOptions.excludeBrowserFlags || [];
|
|
129013
129094
|
const filteredFlags = (0, shared_utils.ov)(DEFAULT_BROWSER_FLAGS, excludeFlags);
|
|
129014
129095
|
const cdpPort = (0, shared_utils.jl)(configOptions.port, configOptions.instanceId);
|
|
@@ -130370,6 +130451,7 @@ var __webpack_modules__ = {
|
|
|
130370
130451
|
external_fs_.mkdirSync(tmp, {
|
|
130371
130452
|
recursive: true
|
|
130372
130453
|
});
|
|
130454
|
+
(0, shared_utils.RE)(tmp);
|
|
130373
130455
|
profilePath = tmp;
|
|
130374
130456
|
}
|
|
130375
130457
|
try {
|
|
@@ -131966,30 +132048,25 @@ var __webpack_modules__ = {
|
|
|
131966
132048
|
const setupMessageWithIndex = hasIndex ? setupMessage.replace('►►► ', `►►► [${options?.index}/${options?.total}] `) : setupMessage;
|
|
131967
132049
|
if (isAuthor) console.warn(setupMessageWithIndex);
|
|
131968
132050
|
else console.log(setupMessageWithIndex);
|
|
131969
|
-
|
|
131970
|
-
|
|
131971
|
-
|
|
131972
|
-
|
|
131973
|
-
|
|
131974
|
-
|
|
131975
|
-
|
|
131976
|
-
|
|
131977
|
-
|
|
131978
|
-
|
|
131979
|
-
|
|
131980
|
-
|
|
131981
|
-
|
|
131982
|
-
|
|
131983
|
-
|
|
131984
|
-
await execInstallWithFallback(execCommand, {
|
|
131985
|
-
cwd: wslContext.useWsl ? void 0 : installBaseDir,
|
|
131986
|
-
fallbackNpmCommand,
|
|
131987
|
-
allowFallbackOnFailure: !wslContext.useWsl && 'npm' !== pm.name && void 0 !== fallbackNpmCommand
|
|
131988
|
-
});
|
|
131989
|
-
}
|
|
132051
|
+
const installCommand = getOptionalInstallCommand(pm, dependencies, wslContext.installDir || installBaseDir);
|
|
132052
|
+
const execCommand = wrapCommandForWsl(installCommand, wslContext);
|
|
132053
|
+
const fallbackNpmCommand = wslContext.useWsl ? void 0 : (0, _webpack_lib_package_manager__rspack_import_8.sX)([
|
|
132054
|
+
'--silent',
|
|
132055
|
+
'install',
|
|
132056
|
+
...(0, _webpack_lib_optional_dependencies__rspack_import_7.ad)(dependencies),
|
|
132057
|
+
'--prefix',
|
|
132058
|
+
installBaseDir,
|
|
132059
|
+
'--save-optional'
|
|
132060
|
+
]);
|
|
132061
|
+
await execInstallWithFallback(execCommand, {
|
|
132062
|
+
cwd: wslContext.useWsl ? void 0 : installBaseDir,
|
|
132063
|
+
fallbackNpmCommand,
|
|
132064
|
+
allowFallbackOnFailure: !wslContext.useWsl && 'npm' !== pm.name && void 0 !== fallbackNpmCommand
|
|
132065
|
+
});
|
|
131990
132066
|
await new Promise((resolve)=>setTimeout(resolve, 500));
|
|
131991
|
-
|
|
131992
|
-
|
|
132067
|
+
const needsRootRelink = isAuthor || dependencies.length > 1;
|
|
132068
|
+
if (needsRootRelink) {
|
|
132069
|
+
if (isAuthor) console.log(_messages__rspack_import_3.cr(integration));
|
|
131993
132070
|
const rootInstall = getRootInstallCommand(pm, wslContext.useWsl ? wslContext.installDir : void 0);
|
|
131994
132071
|
const rootCommand = wrapCommandForWsl(rootInstall, wslContext);
|
|
131995
132072
|
const rootFallbackCommand = wslContext.useWsl ? void 0 : (0, _webpack_lib_package_manager__rspack_import_8.sX)([
|
|
@@ -132003,7 +132080,7 @@ var __webpack_modules__ = {
|
|
|
132003
132080
|
fallbackNpmCommand: rootFallbackCommand,
|
|
132004
132081
|
allowFallbackOnFailure: !wslContext.useWsl && 'npm' !== pm.name && void 0 !== rootFallbackCommand
|
|
132005
132082
|
});
|
|
132006
|
-
console.log(_messages__rspack_import_3.ys(integration));
|
|
132083
|
+
if (isAuthor) console.log(_messages__rspack_import_3.ys(integration));
|
|
132007
132084
|
}
|
|
132008
132085
|
return true;
|
|
132009
132086
|
} catch (error) {
|
|
@@ -134191,13 +134268,17 @@ var __webpack_modules__ = {
|
|
|
134191
134268
|
return `${getLoggingPrefix('success')} Dependencies installed. Run the command again to proceed.`;
|
|
134192
134269
|
}
|
|
134193
134270
|
function buildWebpack(projectDir, stats, browser) {
|
|
134194
|
-
const statsJson = stats?.toJson(
|
|
134271
|
+
const statsJson = stats?.toJson({
|
|
134272
|
+
all: false,
|
|
134273
|
+
assets: true,
|
|
134274
|
+
time: true
|
|
134275
|
+
});
|
|
134195
134276
|
const outputPath = 'string' == typeof stats?.compilation?.outputOptions?.path ? stats.compilation.outputOptions.path : '';
|
|
134196
134277
|
const manifestPath = outputPath ? path__rspack_import_1.join(outputPath, 'manifest.json') : path__rspack_import_1.join(projectDir, 'manifest.json');
|
|
134197
134278
|
const manifest = JSON.parse(fs__rspack_import_0.readFileSync(manifestPath, 'utf8'));
|
|
134198
134279
|
const assets = statsJson?.assets;
|
|
134199
134280
|
const heading = `${getLoggingPrefix('info')} Building ${pintor__rspack_import_2_default().blue(manifest.name)} extension using ${capitalizedBrowserName(browser)} defaults...\n`;
|
|
134200
|
-
const buildTime = `\nBuild completed in ${((statsJson?.time || 0) / 1000).toFixed(2)} seconds
|
|
134281
|
+
const buildTime = `\nBuild completed in ${((statsJson?.time || 0) / 1000).toFixed(2)} seconds.\n`;
|
|
134201
134282
|
const buildTarget = `Build Target: ${pintor__rspack_import_2_default().gray(capitalizedBrowserName(browser))}\n`;
|
|
134202
134283
|
const buildStatus = `Build Status: ${stats?.hasErrors() ? pintor__rspack_import_2_default().red('Failed') : pintor__rspack_import_2_default().green('Success')}\n`;
|
|
134203
134284
|
const version1 = `\nVersion: ${pintor__rspack_import_2_default().gray(manifest.version)}\n`;
|
|
@@ -134258,13 +134339,13 @@ var __webpack_modules__ = {
|
|
|
134258
134339
|
if (haystack.includes('runtime') || haystack.includes('will fail') || haystack.includes('cannot resolve') || haystack.includes('service_worker')) return 'Runtime-risk';
|
|
134259
134340
|
return 'Warning';
|
|
134260
134341
|
}
|
|
134261
|
-
function
|
|
134262
|
-
if ('Performance' === category) return '
|
|
134263
|
-
if ('Deprecation' === category) return 'Move to the supported API
|
|
134342
|
+
function suggestedHintForWarning(category) {
|
|
134343
|
+
if ('Performance' === category) return 'Inspect the largest startup bundles and split optional code paths.';
|
|
134344
|
+
if ('Deprecation' === category) return 'Move to the supported API or plugin path before the next update.';
|
|
134264
134345
|
if ('Configuration' === category) return 'Review extension and bundler config keys, then remove or rename invalid options.';
|
|
134265
134346
|
if ('Compatibility' === category) return 'Verify browser target and manifest compatibility for this build.';
|
|
134266
|
-
if ('Runtime-risk' === category) return 'Address this
|
|
134267
|
-
return 'Re-run with
|
|
134347
|
+
if ('Runtime-risk' === category) return 'Address this before release; it may fail or degrade at runtime.';
|
|
134348
|
+
return 'Re-run with EXTENSION_VERBOSE=1 to inspect full warning details.';
|
|
134268
134349
|
}
|
|
134269
134350
|
function buildSuccessWithWarnings(warningCount) {
|
|
134270
134351
|
return `${getLoggingPrefix('warn')} Build succeeded with ${warningCount} warning(s). Your extension is ${pintor__rspack_import_2_default().green('ready for deployment')}.`;
|
|
@@ -134272,19 +134353,20 @@ var __webpack_modules__ = {
|
|
|
134272
134353
|
function buildWarningsDetails(warnings) {
|
|
134273
134354
|
if (!Array.isArray(warnings) || 0 === warnings.length) return '';
|
|
134274
134355
|
const blocks = [];
|
|
134275
|
-
const sectionHeader = `${getLoggingPrefix('warn')} Warning details\n`;
|
|
134276
134356
|
warnings.forEach((warning, index)=>{
|
|
134277
134357
|
const message = getWarningMessage(warning);
|
|
134278
134358
|
const source = getWarningSource(warning);
|
|
134279
134359
|
const artifact = getWarningArtifact(warning);
|
|
134280
134360
|
const category = classifyWarning(message, source);
|
|
134281
|
-
const
|
|
134282
|
-
if (!message) return void blocks.push(
|
|
134361
|
+
const hint = suggestedHintForWarning(category);
|
|
134362
|
+
if (!message) return void blocks.push(`${getLoggingPrefix('warn')} Warning ${index + 1}: details were suppressed by tool output.\n${formatWarningLabelLine('Source', pintor__rspack_import_2_default().gray(source))}\n${formatWarningLabelLine('Hint', 'Re-run with EXTENSION_VERBOSE=1 to inspect full warning messages.')}`);
|
|
134363
|
+
const performanceWarning = parsePerformanceWarning(warning, source, artifact);
|
|
134364
|
+
if (performanceWarning) return void blocks.push(performanceWarning);
|
|
134283
134365
|
const oneLine = message.replace(/\s+/g, ' ').trim();
|
|
134284
134366
|
const artifactSuffix = artifact ? ` ${pintor__rspack_import_2_default().gray(`(${artifact})`)}` : '';
|
|
134285
|
-
blocks.push(
|
|
134367
|
+
blocks.push(`${getLoggingPrefix('warn')} ${category}: ${oneLine}${artifactSuffix}\n${formatWarningLabelLine('Source', pintor__rspack_import_2_default().gray(source))}\n${formatWarningLabelLine('Hint', hint)}`);
|
|
134286
134368
|
});
|
|
134287
|
-
return
|
|
134369
|
+
return blocks.join('\n\n');
|
|
134288
134370
|
}
|
|
134289
134371
|
function fetchingProjectPath(owner, project) {
|
|
134290
134372
|
return fmt.block('Fetching project', [
|
|
@@ -134386,6 +134468,49 @@ var __webpack_modules__ = {
|
|
|
134386
134468
|
});
|
|
134387
134469
|
return `.\n${printTree(assetTree)}`;
|
|
134388
134470
|
}
|
|
134471
|
+
function formatWarningLabelLine(label, value) {
|
|
134472
|
+
return `${pintor__rspack_import_2_default().gray('│')} ${pintor__rspack_import_2_default().gray(`${label}:`)} ${value}`;
|
|
134473
|
+
}
|
|
134474
|
+
function parsePerformanceWarning(warning, source, _artifact) {
|
|
134475
|
+
const normalized = getWarningBody(warning).replace(/\r/g, '');
|
|
134476
|
+
const lower = normalized.toLowerCase();
|
|
134477
|
+
const threshold = normalized.match(/\(([\d.]+\s(?:KiB|MiB|GiB|KB|MB|GB))\)/)?.[1] || '';
|
|
134478
|
+
if (lower.includes('asset size limit')) return formatPerformanceWarningBlock({
|
|
134479
|
+
title: 'asset size limit exceeded',
|
|
134480
|
+
threshold,
|
|
134481
|
+
impact: 'Large emitted files can increase package size and slow extension startup.',
|
|
134482
|
+
source,
|
|
134483
|
+
hint: 'Inspect the largest startup bundles and split optional code paths.'
|
|
134484
|
+
});
|
|
134485
|
+
if (lower.includes('entrypoint size limit')) return formatPerformanceWarningBlock({
|
|
134486
|
+
title: 'entrypoint size limit exceeded',
|
|
134487
|
+
threshold,
|
|
134488
|
+
impact: 'Startup entrypoints are heavier than recommended.',
|
|
134489
|
+
source,
|
|
134490
|
+
hint: 'Keep startup entrypoints thin and defer non-critical code.'
|
|
134491
|
+
});
|
|
134492
|
+
}
|
|
134493
|
+
function formatPerformanceWarningBlock(options) {
|
|
134494
|
+
const lines = [
|
|
134495
|
+
`${getLoggingPrefix('warn')} Performance: ${options.title}`
|
|
134496
|
+
];
|
|
134497
|
+
if (options.threshold) lines.push(formatWarningLabelLine('Threshold', options.threshold));
|
|
134498
|
+
lines.push(formatWarningLabelLine('Impact', options.impact));
|
|
134499
|
+
lines.push(pintor__rspack_import_2_default().gray('│'));
|
|
134500
|
+
lines.push(formatWarningLabelLine('Source', pintor__rspack_import_2_default().gray(options.source)));
|
|
134501
|
+
lines.push(formatWarningLabelLine('Hint', options.hint));
|
|
134502
|
+
return lines.join('\n');
|
|
134503
|
+
}
|
|
134504
|
+
function getWarningBody(warning) {
|
|
134505
|
+
if (!warning) return '';
|
|
134506
|
+
if ('string' == typeof warning) return warning;
|
|
134507
|
+
return [
|
|
134508
|
+
warning.message,
|
|
134509
|
+
warning.details,
|
|
134510
|
+
warning.reason,
|
|
134511
|
+
warning.description
|
|
134512
|
+
].filter((value)=>'string' == typeof value && value.trim().length > 0).join('\n');
|
|
134513
|
+
}
|
|
134389
134514
|
function isUsingExperimentalConfig(integration) {
|
|
134390
134515
|
return `${getLoggingPrefix('info')} Using ${pintor__rspack_import_2_default().yellow(integration)}.`;
|
|
134391
134516
|
}
|
|
@@ -134564,6 +134689,57 @@ var __webpack_modules__ = {
|
|
|
134564
134689
|
function getPackageDirFromInstallRoot(dependencyId, installRoot) {
|
|
134565
134690
|
return path__rspack_import_1.join(installRoot, 'node_modules', ...dependencyId.split('/'));
|
|
134566
134691
|
}
|
|
134692
|
+
function listInstalledPackageDirs(nodeModulesDir) {
|
|
134693
|
+
if (!fs__rspack_import_0.existsSync(nodeModulesDir)) return [];
|
|
134694
|
+
try {
|
|
134695
|
+
const entries = fs__rspack_import_0.readdirSync(nodeModulesDir, {
|
|
134696
|
+
withFileTypes: true
|
|
134697
|
+
});
|
|
134698
|
+
const packageDirs = [];
|
|
134699
|
+
for (const entry of entries){
|
|
134700
|
+
if (!entry.isDirectory() || '.bin' === entry.name) continue;
|
|
134701
|
+
const entryPath = path__rspack_import_1.join(nodeModulesDir, entry.name);
|
|
134702
|
+
if (!entry.name.startsWith('@')) {
|
|
134703
|
+
packageDirs.push(entryPath);
|
|
134704
|
+
continue;
|
|
134705
|
+
}
|
|
134706
|
+
const scopedEntries = fs__rspack_import_0.readdirSync(entryPath, {
|
|
134707
|
+
withFileTypes: true
|
|
134708
|
+
});
|
|
134709
|
+
for (const scopedEntry of scopedEntries)if (scopedEntry.isDirectory()) packageDirs.push(path__rspack_import_1.join(entryPath, scopedEntry.name));
|
|
134710
|
+
}
|
|
134711
|
+
return packageDirs;
|
|
134712
|
+
} catch {
|
|
134713
|
+
return [];
|
|
134714
|
+
}
|
|
134715
|
+
}
|
|
134716
|
+
function findNestedPackageDir(dependencyId, installRoot) {
|
|
134717
|
+
const targetPackageJson = path__rspack_import_1.join(installRoot, 'node_modules', ...dependencyId.split('/'), 'package.json');
|
|
134718
|
+
if (fs__rspack_import_0.existsSync(targetPackageJson)) return path__rspack_import_1.dirname(targetPackageJson);
|
|
134719
|
+
const visited = new Set();
|
|
134720
|
+
const queue = [
|
|
134721
|
+
{
|
|
134722
|
+
nodeModulesDir: path__rspack_import_1.join(installRoot, 'node_modules'),
|
|
134723
|
+
depth: 0
|
|
134724
|
+
}
|
|
134725
|
+
];
|
|
134726
|
+
const maxDepth = 4;
|
|
134727
|
+
while(queue.length > 0){
|
|
134728
|
+
const current = queue.shift();
|
|
134729
|
+
if (visited.has(current.nodeModulesDir)) continue;
|
|
134730
|
+
visited.add(current.nodeModulesDir);
|
|
134731
|
+
const candidatePackageJson = path__rspack_import_1.join(current.nodeModulesDir, ...dependencyId.split('/'), 'package.json');
|
|
134732
|
+
if (fs__rspack_import_0.existsSync(candidatePackageJson)) return path__rspack_import_1.dirname(candidatePackageJson);
|
|
134733
|
+
if (current.depth >= maxDepth) continue;
|
|
134734
|
+
for (const packageDir of listInstalledPackageDirs(current.nodeModulesDir)){
|
|
134735
|
+
const nestedNodeModulesDir = path__rspack_import_1.join(packageDir, 'node_modules');
|
|
134736
|
+
if (fs__rspack_import_0.existsSync(nestedNodeModulesDir)) queue.push({
|
|
134737
|
+
nodeModulesDir: nestedNodeModulesDir,
|
|
134738
|
+
depth: current.depth + 1
|
|
134739
|
+
});
|
|
134740
|
+
}
|
|
134741
|
+
}
|
|
134742
|
+
}
|
|
134567
134743
|
function readPackageJsonFromDir(packageDir) {
|
|
134568
134744
|
const manifestPath = path__rspack_import_1.join(packageDir, 'package.json');
|
|
134569
134745
|
if (!fs__rspack_import_0.existsSync(manifestPath)) return;
|
|
@@ -134595,8 +134771,7 @@ var __webpack_modules__ = {
|
|
|
134595
134771
|
if (fs__rspack_import_0.existsSync(absoluteEntry)) return absoluteEntry;
|
|
134596
134772
|
}
|
|
134597
134773
|
}
|
|
134598
|
-
function
|
|
134599
|
-
const packageDir = getPackageDirFromInstallRoot(dependencyId, installRoot);
|
|
134774
|
+
function resolveFromPackageDir(packageDir) {
|
|
134600
134775
|
if (!fs__rspack_import_0.existsSync(packageDir)) return;
|
|
134601
134776
|
try {
|
|
134602
134777
|
return require.resolve(packageDir);
|
|
@@ -134606,6 +134781,14 @@ var __webpack_modules__ = {
|
|
|
134606
134781
|
const candidateEntries = getPackageEntryCandidates(pkg);
|
|
134607
134782
|
return resolveFirstExistingEntry(packageDir, candidateEntries);
|
|
134608
134783
|
}
|
|
134784
|
+
function resolveFromInstallRootPackageDir(dependencyId, installRoot) {
|
|
134785
|
+
const packageDir = getPackageDirFromInstallRoot(dependencyId, installRoot);
|
|
134786
|
+
const directResolution = resolveFromPackageDir(packageDir);
|
|
134787
|
+
if (directResolution) return directResolution;
|
|
134788
|
+
const nestedPackageDir = findNestedPackageDir(dependencyId, installRoot);
|
|
134789
|
+
if (!nestedPackageDir || nestedPackageDir === packageDir) return;
|
|
134790
|
+
return resolveFromPackageDir(nestedPackageDir);
|
|
134791
|
+
}
|
|
134609
134792
|
function verifyPackageInInstallRoot(packageId, installRoot) {
|
|
134610
134793
|
if (tryResolveWithBase(packageId, installRoot)) return true;
|
|
134611
134794
|
if (resolveFromInstallRootPackageDir(packageId, installRoot)) return true;
|
|
@@ -135416,7 +135599,7 @@ var __webpack_modules__ = {
|
|
|
135416
135599
|
},
|
|
135417
135600
|
"./package.json" (module) {
|
|
135418
135601
|
"use strict";
|
|
135419
|
-
module.exports = JSON.parse('{"rE":"3.9.
|
|
135602
|
+
module.exports = JSON.parse('{"rE":"3.9.1-canary.233.8976161","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"}}');
|
|
135420
135603
|
}
|
|
135421
135604
|
};
|
|
135422
135605
|
var __webpack_module_cache__ = {};
|
|
@@ -136333,6 +136516,7 @@ var __webpack_exports__ = {};
|
|
|
136333
136516
|
plugins: allPluginsButBrowserRunners
|
|
136334
136517
|
});
|
|
136335
136518
|
const compilerConfig = merge(userConfig);
|
|
136519
|
+
compilerConfig.stats = false;
|
|
136336
136520
|
const compiler = rspack(compilerConfig);
|
|
136337
136521
|
let summary = {
|
|
136338
136522
|
browser,
|
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"webpack/webpack-lib/optional-dependencies.json"
|
|
26
26
|
],
|
|
27
27
|
"name": "extension-develop",
|
|
28
|
-
"version": "3.9.
|
|
28
|
+
"version": "3.9.1-canary.233.8976161",
|
|
29
29
|
"description": "Develop, build, preview, and package Extension.js projects.",
|
|
30
30
|
"author": {
|
|
31
31
|
"name": "Cezar Augusto",
|