extension-develop 3.9.1 → 3.9.4
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 +233 -45
- package/package.json +1 -1
package/dist/module.cjs
CHANGED
|
@@ -127904,6 +127904,65 @@ var __webpack_modules__ = {
|
|
|
127904
127904
|
if (hasEnv) return true;
|
|
127905
127905
|
return /microsoft/i.test(os__rspack_import_2.release());
|
|
127906
127906
|
}
|
|
127907
|
+
function findNearestPackageJson(startPath) {
|
|
127908
|
+
let current = path__rspack_import_0.resolve(startPath);
|
|
127909
|
+
for(let i = 0; i < 6; i += 1){
|
|
127910
|
+
const candidate = path__rspack_import_0.join(current, 'package.json');
|
|
127911
|
+
if (fs__rspack_import_1.existsSync(candidate)) return candidate;
|
|
127912
|
+
const parent = path__rspack_import_0.dirname(current);
|
|
127913
|
+
if (parent === current) break;
|
|
127914
|
+
current = parent;
|
|
127915
|
+
}
|
|
127916
|
+
return null;
|
|
127917
|
+
}
|
|
127918
|
+
function safeReadPackageJson(filePath) {
|
|
127919
|
+
try {
|
|
127920
|
+
return JSON.parse(fs__rspack_import_1.readFileSync(filePath, 'utf8'));
|
|
127921
|
+
} catch {
|
|
127922
|
+
return null;
|
|
127923
|
+
}
|
|
127924
|
+
}
|
|
127925
|
+
function detectCurrentPackageManager(projectRoot, pkg) {
|
|
127926
|
+
const userAgent = String(process.env.npm_config_user_agent || '').toLowerCase();
|
|
127927
|
+
if (userAgent.includes('pnpm')) return 'pnpm';
|
|
127928
|
+
if (userAgent.includes('yarn')) return 'yarn';
|
|
127929
|
+
if (userAgent.includes('bun')) return 'bun';
|
|
127930
|
+
if (userAgent.includes('npm')) return 'npm';
|
|
127931
|
+
const declared = String(pkg?.packageManager || '').trim().toLowerCase();
|
|
127932
|
+
if (declared.startsWith('pnpm@')) return 'pnpm';
|
|
127933
|
+
if (declared.startsWith('yarn@')) return 'yarn';
|
|
127934
|
+
if (declared.startsWith('bun@')) return 'bun';
|
|
127935
|
+
if (declared.startsWith('npm@')) return 'npm';
|
|
127936
|
+
if (fs__rspack_import_1.existsSync(path__rspack_import_0.join(projectRoot, 'pnpm-lock.yaml'))) return 'pnpm';
|
|
127937
|
+
if (fs__rspack_import_1.existsSync(path__rspack_import_0.join(projectRoot, 'yarn.lock'))) return 'yarn';
|
|
127938
|
+
if (fs__rspack_import_1.existsSync(path__rspack_import_0.join(projectRoot, 'bun.lockb'))) return 'bun';
|
|
127939
|
+
if (fs__rspack_import_1.existsSync(path__rspack_import_0.join(projectRoot, 'bun.lock'))) return 'bun';
|
|
127940
|
+
if (fs__rspack_import_1.existsSync(path__rspack_import_0.join(projectRoot, 'package-lock.json'))) return 'npm';
|
|
127941
|
+
return 'unknown';
|
|
127942
|
+
}
|
|
127943
|
+
function preferredManagedInstallCommand(browser) {
|
|
127944
|
+
const packageJsonPath = findNearestPackageJson(process.cwd());
|
|
127945
|
+
const pkg = packageJsonPath ? safeReadPackageJson(packageJsonPath) : null;
|
|
127946
|
+
const projectRoot = packageJsonPath ? path__rspack_import_0.dirname(packageJsonPath) : process.cwd();
|
|
127947
|
+
const hasExtensionScript = Boolean(pkg?.scripts?.extension);
|
|
127948
|
+
const packageManager = detectCurrentPackageManager(projectRoot, pkg);
|
|
127949
|
+
if (hasExtensionScript) {
|
|
127950
|
+
if ('pnpm' === packageManager) return `pnpm extension install ${browser}`;
|
|
127951
|
+
if ('npm' === packageManager) return `npm run extension -- install ${browser}`;
|
|
127952
|
+
if ('bun' === packageManager) return `bun run extension -- install ${browser}`;
|
|
127953
|
+
if ('yarn' === packageManager) return `yarn extension install ${browser}`;
|
|
127954
|
+
}
|
|
127955
|
+
if ('pnpm' === packageManager) return `pnpm exec extension install ${browser}`;
|
|
127956
|
+
if ('bun' === packageManager) return `bunx extension install ${browser}`;
|
|
127957
|
+
return `npx extension install ${browser}`;
|
|
127958
|
+
}
|
|
127959
|
+
function managedBrowserDisplayName(browser) {
|
|
127960
|
+
if ('chrome' === browser) return 'Chrome for Testing';
|
|
127961
|
+
if ('chromium' === browser) return 'Chromium';
|
|
127962
|
+
if ('firefox' === browser) return 'Firefox';
|
|
127963
|
+
if ('edge' === browser) return 'Edge';
|
|
127964
|
+
return browser;
|
|
127965
|
+
}
|
|
127907
127966
|
function capitalizedBrowserName(browser) {
|
|
127908
127967
|
return `${browser.charAt(0).toUpperCase() + browser.slice(1)}`;
|
|
127909
127968
|
}
|
|
@@ -128048,44 +128107,25 @@ var __webpack_modules__ = {
|
|
|
128048
128107
|
function prettyPuppeteerInstallGuidance(browser, rawGuidance, cacheDir) {
|
|
128049
128108
|
const dim = pintor__rspack_import_4_default().gray;
|
|
128050
128109
|
const body = [];
|
|
128051
|
-
let cleaned = String(rawGuidance || '').replace(/^Error:\s*/i, '').trim();
|
|
128052
|
-
try {
|
|
128053
|
-
const looksMinimal = cleaned.split(/\r?\n/).filter(Boolean).length < 2;
|
|
128054
|
-
if (looksMinimal) {
|
|
128055
|
-
const b = String(browser || '').toLowerCase();
|
|
128056
|
-
if ('chromium' === b || 'chromium-based' === b) try {
|
|
128057
|
-
const txt = (0, chromium_location__rspack_import_6.getInstallGuidance)();
|
|
128058
|
-
if (txt && 'string' == typeof txt) cleaned = String(txt).trim();
|
|
128059
|
-
} catch {}
|
|
128060
|
-
else if ('chrome' === b) try {
|
|
128061
|
-
const txt = (0, chrome_location2__rspack_import_5.getInstallGuidance)();
|
|
128062
|
-
if (txt && 'string' == typeof txt) cleaned = String(txt).trim();
|
|
128063
|
-
} catch {}
|
|
128064
|
-
else if ('firefox' === b || 'gecko-based' === b) try {
|
|
128065
|
-
const txt = (0, firefox_location2__rspack_import_8.getInstallGuidance)();
|
|
128066
|
-
if (txt && 'string' == typeof txt) cleaned = String(txt).trim();
|
|
128067
|
-
} catch {}
|
|
128068
|
-
else if ('edge' === b) try {
|
|
128069
|
-
const txt = (0, edge_location__rspack_import_7.getInstallGuidance)();
|
|
128070
|
-
if (txt && 'string' == typeof txt) cleaned = String(txt).trim();
|
|
128071
|
-
} catch {}
|
|
128072
|
-
}
|
|
128073
|
-
} catch {}
|
|
128074
128110
|
let browserNorm = 'chromium';
|
|
128075
128111
|
if ('chromium-based' === browser) browserNorm = 'chromium';
|
|
128076
128112
|
else if ('gecko-based' === browser) browserNorm = 'firefox';
|
|
128077
128113
|
else if ('chrome' === browser || 'chromium' === browser || 'firefox' === browser || 'edge' === browser) browserNorm = browser;
|
|
128078
128114
|
const finalCachePath = browserNorm && cacheDir ? path__rspack_import_0.join(cacheDir, browserNorm) : cacheDir;
|
|
128079
|
-
|
|
128080
|
-
|
|
128081
|
-
|
|
128082
|
-
|
|
128083
|
-
|
|
128084
|
-
|
|
128085
|
-
|
|
128086
|
-
|
|
128087
|
-
body.push(
|
|
128088
|
-
if (finalCachePath)
|
|
128115
|
+
const installCommand = preferredManagedInstallCommand(browserNorm);
|
|
128116
|
+
const browserDisplay = managedBrowserDisplayName(browserNorm);
|
|
128117
|
+
body.push(`${getLoggingPrefix('warn')} Browser setup required`);
|
|
128118
|
+
body.push('');
|
|
128119
|
+
body.push(`${browserDisplay} is not available in the managed browser cache.`);
|
|
128120
|
+
body.push('');
|
|
128121
|
+
body.push(pintor__rspack_import_4_default().gray(`Install ${browserDisplay} into the managed browser cache:`));
|
|
128122
|
+
body.push('');
|
|
128123
|
+
body.push(` ${pintor__rspack_import_4_default().bold(pintor__rspack_import_4_default().blue(installCommand))}`);
|
|
128124
|
+
if (finalCachePath) {
|
|
128125
|
+
body.push('');
|
|
128126
|
+
body.push(`${dim('INSTALL PATH')} ${pintor__rspack_import_4_default().underline(finalCachePath)}`);
|
|
128127
|
+
}
|
|
128128
|
+
body.push(`${dim('NEXT')} Re-run your command after the install finishes.`);
|
|
128089
128129
|
return body.join('\n') + '\n';
|
|
128090
128130
|
}
|
|
128091
128131
|
function firefoxLaunchCalled() {
|
|
@@ -128647,13 +128687,17 @@ var __webpack_modules__ = {
|
|
|
128647
128687
|
"use strict";
|
|
128648
128688
|
__webpack_require__.d(__webpack_exports__, {
|
|
128649
128689
|
CW: ()=>cleanupOldTempProfiles,
|
|
128690
|
+
J1: ()=>prepareChromiumProfileForLaunch,
|
|
128691
|
+
RE: ()=>markManagedEphemeralProfile,
|
|
128650
128692
|
aY: ()=>findAvailablePortNear,
|
|
128651
128693
|
jl: ()=>deriveDebugPortWithInstance,
|
|
128652
128694
|
ov: ()=>filterBrowserFlags
|
|
128653
128695
|
});
|
|
128654
128696
|
var fs__rspack_import_0 = __webpack_require__("fs");
|
|
128655
|
-
var
|
|
128656
|
-
var
|
|
128697
|
+
var os__rspack_import_1 = __webpack_require__("os");
|
|
128698
|
+
var path__rspack_import_2 = __webpack_require__("path");
|
|
128699
|
+
var net__rspack_import_3 = __webpack_require__("net");
|
|
128700
|
+
const MANAGED_EPHEMERAL_PROFILE_MARKER = '.extension-js-managed-profile';
|
|
128657
128701
|
function shortInstanceId(instanceId) {
|
|
128658
128702
|
return instanceId ? String(instanceId).slice(0, 8) : '';
|
|
128659
128703
|
}
|
|
@@ -128675,7 +128719,7 @@ var __webpack_modules__ = {
|
|
|
128675
128719
|
async function findAvailablePortNear(startPort, maxAttempts = 20, host = '127.0.0.1') {
|
|
128676
128720
|
function tryPort(port) {
|
|
128677
128721
|
return new Promise((resolve)=>{
|
|
128678
|
-
const server =
|
|
128722
|
+
const server = net__rspack_import_3.createServer();
|
|
128679
128723
|
server.once('error', ()=>{
|
|
128680
128724
|
resolve(false);
|
|
128681
128725
|
});
|
|
@@ -128693,6 +128737,77 @@ var __webpack_modules__ = {
|
|
|
128693
128737
|
}
|
|
128694
128738
|
return startPort;
|
|
128695
128739
|
}
|
|
128740
|
+
function isProcessLikelyAlive(pid) {
|
|
128741
|
+
if (!Number.isInteger(pid) || pid <= 0) return false;
|
|
128742
|
+
try {
|
|
128743
|
+
process.kill(pid, 0);
|
|
128744
|
+
return true;
|
|
128745
|
+
} catch {
|
|
128746
|
+
return false;
|
|
128747
|
+
}
|
|
128748
|
+
}
|
|
128749
|
+
function parseChromiumSingletonOwner(raw) {
|
|
128750
|
+
const value = String(raw || '').trim();
|
|
128751
|
+
const lastDash = value.lastIndexOf('-');
|
|
128752
|
+
if (lastDash <= 0) return null;
|
|
128753
|
+
const host = value.slice(0, lastDash).trim();
|
|
128754
|
+
const pid = parseInt(value.slice(lastDash + 1).trim(), 10);
|
|
128755
|
+
if (!host || !Number.isInteger(pid) || pid <= 0) return null;
|
|
128756
|
+
return {
|
|
128757
|
+
host,
|
|
128758
|
+
pid
|
|
128759
|
+
};
|
|
128760
|
+
}
|
|
128761
|
+
function readChromiumSingletonOwner(profilePath) {
|
|
128762
|
+
const lockPath = path__rspack_import_2.join(profilePath, 'SingletonLock');
|
|
128763
|
+
if (!fs__rspack_import_0.existsSync(lockPath)) return null;
|
|
128764
|
+
try {
|
|
128765
|
+
const stat = fs__rspack_import_0.lstatSync(lockPath);
|
|
128766
|
+
if (stat.isSymbolicLink()) return parseChromiumSingletonOwner(fs__rspack_import_0.readlinkSync(lockPath));
|
|
128767
|
+
} catch {}
|
|
128768
|
+
try {
|
|
128769
|
+
return parseChromiumSingletonOwner(fs__rspack_import_0.readFileSync(lockPath, 'utf8'));
|
|
128770
|
+
} catch {
|
|
128771
|
+
return null;
|
|
128772
|
+
}
|
|
128773
|
+
}
|
|
128774
|
+
function removeChromiumSingletonArtifacts(profilePath) {
|
|
128775
|
+
const removed = [];
|
|
128776
|
+
for (const name of [
|
|
128777
|
+
'SingletonLock',
|
|
128778
|
+
'SingletonSocket',
|
|
128779
|
+
'SingletonCookie'
|
|
128780
|
+
]){
|
|
128781
|
+
const full = path__rspack_import_2.join(profilePath, name);
|
|
128782
|
+
if (fs__rspack_import_0.existsSync(full)) try {
|
|
128783
|
+
fs__rspack_import_0.rmSync(full, {
|
|
128784
|
+
recursive: true,
|
|
128785
|
+
force: true
|
|
128786
|
+
});
|
|
128787
|
+
removed.push(name);
|
|
128788
|
+
} catch {}
|
|
128789
|
+
}
|
|
128790
|
+
return removed;
|
|
128791
|
+
}
|
|
128792
|
+
function prepareChromiumProfileForLaunch(profilePath) {
|
|
128793
|
+
const owner = readChromiumSingletonOwner(profilePath);
|
|
128794
|
+
if (!owner) return {
|
|
128795
|
+
removedArtifacts: []
|
|
128796
|
+
};
|
|
128797
|
+
const currentHost = os__rspack_import_1.hostname().trim().toLowerCase();
|
|
128798
|
+
const ownerHost = owner.host.trim().toLowerCase();
|
|
128799
|
+
const sameHost = currentHost.length > 0 && currentHost === ownerHost;
|
|
128800
|
+
const alive = isProcessLikelyAlive(owner.pid);
|
|
128801
|
+
if (!sameHost || !alive) return {
|
|
128802
|
+
removedArtifacts: removeChromiumSingletonArtifacts(profilePath)
|
|
128803
|
+
};
|
|
128804
|
+
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.`);
|
|
128805
|
+
}
|
|
128806
|
+
function markManagedEphemeralProfile(profilePath) {
|
|
128807
|
+
try {
|
|
128808
|
+
fs__rspack_import_0.writeFileSync(path__rspack_import_2.join(profilePath, MANAGED_EPHEMERAL_PROFILE_MARKER), 'managed-ephemeral-profile\n', 'utf8');
|
|
128809
|
+
} catch {}
|
|
128810
|
+
}
|
|
128696
128811
|
function cleanupOldTempProfiles(baseDir, excludeBasename, maxAgeHours = 12) {
|
|
128697
128812
|
try {
|
|
128698
128813
|
if (!fs__rspack_import_0.existsSync(baseDir)) return;
|
|
@@ -128703,9 +128818,11 @@ var __webpack_modules__ = {
|
|
|
128703
128818
|
for (const entry of entries){
|
|
128704
128819
|
if (!entry.isDirectory()) continue;
|
|
128705
128820
|
const name = entry.name;
|
|
128706
|
-
if (
|
|
128821
|
+
if ('dev' === name) continue;
|
|
128707
128822
|
if (excludeBasename && name === excludeBasename) continue;
|
|
128708
|
-
const full =
|
|
128823
|
+
const full = path__rspack_import_2.join(baseDir, name);
|
|
128824
|
+
const markerPath = path__rspack_import_2.join(full, MANAGED_EPHEMERAL_PROFILE_MARKER);
|
|
128825
|
+
if (!fs__rspack_import_0.existsSync(markerPath)) continue;
|
|
128709
128826
|
let mtime = 0;
|
|
128710
128827
|
try {
|
|
128711
128828
|
const st = fs__rspack_import_0.statSync(full);
|
|
@@ -128790,6 +128907,7 @@ var __webpack_modules__ = {
|
|
|
128790
128907
|
f: ()=>ChromiumLaunchPlugin
|
|
128791
128908
|
});
|
|
128792
128909
|
var external_fs_ = __webpack_require__("fs");
|
|
128910
|
+
const external_node_child_process_namespaceObject = require("node:child_process");
|
|
128793
128911
|
var external_chrome_location2_ = __webpack_require__("chrome-location2");
|
|
128794
128912
|
var external_chrome_location2_default = /*#__PURE__*/ __webpack_require__.n(external_chrome_location2_);
|
|
128795
128913
|
var external_chromium_location_ = __webpack_require__("chromium-location");
|
|
@@ -128996,6 +129114,7 @@ var __webpack_modules__ = {
|
|
|
128996
129114
|
external_fs_.mkdirSync(ephemDir, {
|
|
128997
129115
|
recursive: true
|
|
128998
129116
|
});
|
|
129117
|
+
(0, shared_utils.RE)(ephemDir);
|
|
128999
129118
|
userProfilePath = ephemDir;
|
|
129000
129119
|
try {
|
|
129001
129120
|
const maxAgeHours = parseInt(String(process.env.EXTENSION_TMP_PROFILE_MAX_AGE_HOURS || ''), 10);
|
|
@@ -129003,12 +129122,15 @@ var __webpack_modules__ = {
|
|
|
129003
129122
|
} catch {}
|
|
129004
129123
|
}
|
|
129005
129124
|
}
|
|
129006
|
-
if (userProfilePath)
|
|
129125
|
+
if (userProfilePath) {
|
|
129007
129126
|
external_fs_.mkdirSync(userProfilePath, {
|
|
129008
129127
|
recursive: true
|
|
129009
129128
|
});
|
|
129010
|
-
|
|
129011
|
-
|
|
129129
|
+
(0, shared_utils.J1)(userProfilePath);
|
|
129130
|
+
try {
|
|
129131
|
+
seedChromiumPreferences(userProfilePath, configOptions.browser, configOptions.preferences);
|
|
129132
|
+
} catch {}
|
|
129133
|
+
}
|
|
129012
129134
|
const excludeFlags = configOptions.excludeBrowserFlags || [];
|
|
129013
129135
|
const filteredFlags = (0, shared_utils.ov)(DEFAULT_BROWSER_FLAGS, excludeFlags);
|
|
129014
129136
|
const cdpPort = (0, shared_utils.jl)(configOptions.port, configOptions.instanceId);
|
|
@@ -129265,7 +129387,14 @@ var __webpack_modules__ = {
|
|
|
129265
129387
|
if ('chromium' === browser || 'chromium-based' === browser) return (0, external_chromium_location_.getChromiumVersion)(bin, {
|
|
129266
129388
|
allowExec: true
|
|
129267
129389
|
}) || '';
|
|
129268
|
-
|
|
129390
|
+
const versionResult = (0, external_node_child_process_namespaceObject.spawnSync)(bin, [
|
|
129391
|
+
'--version'
|
|
129392
|
+
], {
|
|
129393
|
+
stdio: 'pipe',
|
|
129394
|
+
encoding: 'utf8'
|
|
129395
|
+
});
|
|
129396
|
+
const versionLine = String(versionResult.stdout || '').trim();
|
|
129397
|
+
return versionLine || (0, external_chrome_location2_.getChromeVersion)(bin, {
|
|
129269
129398
|
allowExec: true
|
|
129270
129399
|
}) || '';
|
|
129271
129400
|
} catch {
|
|
@@ -130370,6 +130499,7 @@ var __webpack_modules__ = {
|
|
|
130370
130499
|
external_fs_.mkdirSync(tmp, {
|
|
130371
130500
|
recursive: true
|
|
130372
130501
|
});
|
|
130502
|
+
(0, shared_utils.RE)(tmp);
|
|
130373
130503
|
profilePath = tmp;
|
|
130374
130504
|
}
|
|
130375
130505
|
try {
|
|
@@ -134607,6 +134737,57 @@ var __webpack_modules__ = {
|
|
|
134607
134737
|
function getPackageDirFromInstallRoot(dependencyId, installRoot) {
|
|
134608
134738
|
return path__rspack_import_1.join(installRoot, 'node_modules', ...dependencyId.split('/'));
|
|
134609
134739
|
}
|
|
134740
|
+
function listInstalledPackageDirs(nodeModulesDir) {
|
|
134741
|
+
if (!fs__rspack_import_0.existsSync(nodeModulesDir)) return [];
|
|
134742
|
+
try {
|
|
134743
|
+
const entries = fs__rspack_import_0.readdirSync(nodeModulesDir, {
|
|
134744
|
+
withFileTypes: true
|
|
134745
|
+
});
|
|
134746
|
+
const packageDirs = [];
|
|
134747
|
+
for (const entry of entries){
|
|
134748
|
+
if (!entry.isDirectory() || '.bin' === entry.name) continue;
|
|
134749
|
+
const entryPath = path__rspack_import_1.join(nodeModulesDir, entry.name);
|
|
134750
|
+
if (!entry.name.startsWith('@')) {
|
|
134751
|
+
packageDirs.push(entryPath);
|
|
134752
|
+
continue;
|
|
134753
|
+
}
|
|
134754
|
+
const scopedEntries = fs__rspack_import_0.readdirSync(entryPath, {
|
|
134755
|
+
withFileTypes: true
|
|
134756
|
+
});
|
|
134757
|
+
for (const scopedEntry of scopedEntries)if (scopedEntry.isDirectory()) packageDirs.push(path__rspack_import_1.join(entryPath, scopedEntry.name));
|
|
134758
|
+
}
|
|
134759
|
+
return packageDirs;
|
|
134760
|
+
} catch {
|
|
134761
|
+
return [];
|
|
134762
|
+
}
|
|
134763
|
+
}
|
|
134764
|
+
function findNestedPackageDir(dependencyId, installRoot) {
|
|
134765
|
+
const targetPackageJson = path__rspack_import_1.join(installRoot, 'node_modules', ...dependencyId.split('/'), 'package.json');
|
|
134766
|
+
if (fs__rspack_import_0.existsSync(targetPackageJson)) return path__rspack_import_1.dirname(targetPackageJson);
|
|
134767
|
+
const visited = new Set();
|
|
134768
|
+
const queue = [
|
|
134769
|
+
{
|
|
134770
|
+
nodeModulesDir: path__rspack_import_1.join(installRoot, 'node_modules'),
|
|
134771
|
+
depth: 0
|
|
134772
|
+
}
|
|
134773
|
+
];
|
|
134774
|
+
const maxDepth = 4;
|
|
134775
|
+
while(queue.length > 0){
|
|
134776
|
+
const current = queue.shift();
|
|
134777
|
+
if (visited.has(current.nodeModulesDir)) continue;
|
|
134778
|
+
visited.add(current.nodeModulesDir);
|
|
134779
|
+
const candidatePackageJson = path__rspack_import_1.join(current.nodeModulesDir, ...dependencyId.split('/'), 'package.json');
|
|
134780
|
+
if (fs__rspack_import_0.existsSync(candidatePackageJson)) return path__rspack_import_1.dirname(candidatePackageJson);
|
|
134781
|
+
if (current.depth >= maxDepth) continue;
|
|
134782
|
+
for (const packageDir of listInstalledPackageDirs(current.nodeModulesDir)){
|
|
134783
|
+
const nestedNodeModulesDir = path__rspack_import_1.join(packageDir, 'node_modules');
|
|
134784
|
+
if (fs__rspack_import_0.existsSync(nestedNodeModulesDir)) queue.push({
|
|
134785
|
+
nodeModulesDir: nestedNodeModulesDir,
|
|
134786
|
+
depth: current.depth + 1
|
|
134787
|
+
});
|
|
134788
|
+
}
|
|
134789
|
+
}
|
|
134790
|
+
}
|
|
134610
134791
|
function readPackageJsonFromDir(packageDir) {
|
|
134611
134792
|
const manifestPath = path__rspack_import_1.join(packageDir, 'package.json');
|
|
134612
134793
|
if (!fs__rspack_import_0.existsSync(manifestPath)) return;
|
|
@@ -134638,8 +134819,7 @@ var __webpack_modules__ = {
|
|
|
134638
134819
|
if (fs__rspack_import_0.existsSync(absoluteEntry)) return absoluteEntry;
|
|
134639
134820
|
}
|
|
134640
134821
|
}
|
|
134641
|
-
function
|
|
134642
|
-
const packageDir = getPackageDirFromInstallRoot(dependencyId, installRoot);
|
|
134822
|
+
function resolveFromPackageDir(packageDir) {
|
|
134643
134823
|
if (!fs__rspack_import_0.existsSync(packageDir)) return;
|
|
134644
134824
|
try {
|
|
134645
134825
|
return require.resolve(packageDir);
|
|
@@ -134649,6 +134829,14 @@ var __webpack_modules__ = {
|
|
|
134649
134829
|
const candidateEntries = getPackageEntryCandidates(pkg);
|
|
134650
134830
|
return resolveFirstExistingEntry(packageDir, candidateEntries);
|
|
134651
134831
|
}
|
|
134832
|
+
function resolveFromInstallRootPackageDir(dependencyId, installRoot) {
|
|
134833
|
+
const packageDir = getPackageDirFromInstallRoot(dependencyId, installRoot);
|
|
134834
|
+
const directResolution = resolveFromPackageDir(packageDir);
|
|
134835
|
+
if (directResolution) return directResolution;
|
|
134836
|
+
const nestedPackageDir = findNestedPackageDir(dependencyId, installRoot);
|
|
134837
|
+
if (!nestedPackageDir || nestedPackageDir === packageDir) return;
|
|
134838
|
+
return resolveFromPackageDir(nestedPackageDir);
|
|
134839
|
+
}
|
|
134652
134840
|
function verifyPackageInInstallRoot(packageId, installRoot) {
|
|
134653
134841
|
if (tryResolveWithBase(packageId, installRoot)) return true;
|
|
134654
134842
|
if (resolveFromInstallRootPackageDir(packageId, installRoot)) return true;
|
|
@@ -135459,7 +135647,7 @@ var __webpack_modules__ = {
|
|
|
135459
135647
|
},
|
|
135460
135648
|
"./package.json" (module) {
|
|
135461
135649
|
"use strict";
|
|
135462
|
-
module.exports = JSON.parse('{"rE":"3.9.
|
|
135650
|
+
module.exports = JSON.parse('{"rE":"3.9.4","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"}}');
|
|
135463
135651
|
}
|
|
135464
135652
|
};
|
|
135465
135653
|
var __webpack_module_cache__ = {};
|
package/package.json
CHANGED