extension-develop 3.8.2 → 3.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.cjs +403 -321
- package/package.json +1 -1
package/dist/module.cjs
CHANGED
|
@@ -131823,7 +131823,6 @@ var __webpack_modules__ = {
|
|
|
131823
131823
|
"use strict";
|
|
131824
131824
|
__webpack_require__.d(__webpack_exports__, {
|
|
131825
131825
|
DX: ()=>optionalInstallFailed,
|
|
131826
|
-
Jv: ()=>youAreAllSet,
|
|
131827
131826
|
Se: ()=>missingSassDependency,
|
|
131828
131827
|
Vo: ()=>optionalInstallManagerMissing,
|
|
131829
131828
|
_j: ()=>optionalToolingSetup,
|
|
@@ -131847,9 +131846,6 @@ var __webpack_modules__ = {
|
|
|
131847
131846
|
function isUsingIntegration(name) {
|
|
131848
131847
|
return `${pintor__rspack_import_0_default().gray('►►►')} Using ${pintor__rspack_import_0_default().brightBlue(name)}...`;
|
|
131849
131848
|
}
|
|
131850
|
-
function youAreAllSet(name) {
|
|
131851
|
-
return `${pintor__rspack_import_0_default().green('►►►')} ${name} installation completed.`;
|
|
131852
|
-
}
|
|
131853
131849
|
function optionalToolingSetup(integrations, fallback, isAuthor) {
|
|
131854
131850
|
const list = integrations && integrations.length > 0 ? integrations : [
|
|
131855
131851
|
fallback
|
|
@@ -131913,57 +131909,39 @@ var __webpack_modules__ = {
|
|
|
131913
131909
|
V: ()=>maybeUseLess
|
|
131914
131910
|
});
|
|
131915
131911
|
var path__rspack_import_0 = __webpack_require__("path");
|
|
131916
|
-
var
|
|
131917
|
-
var
|
|
131918
|
-
var
|
|
131919
|
-
var
|
|
131920
|
-
var
|
|
131921
|
-
var
|
|
131912
|
+
var pintor__rspack_import_1 = __webpack_require__("pintor");
|
|
131913
|
+
var pintor__rspack_import_1_default = /*#__PURE__*/ __webpack_require__.n(pintor__rspack_import_1);
|
|
131914
|
+
var _css_lib_messages__rspack_import_2 = __webpack_require__("./webpack/plugin-css/css-lib/messages.ts");
|
|
131915
|
+
var _css_lib_integrations__rspack_import_3 = __webpack_require__("./webpack/plugin-css/css-lib/integrations.ts");
|
|
131916
|
+
var _css_lib_is_content_script__rspack_import_4 = __webpack_require__("./webpack/plugin-css/css-lib/is-content-script.ts");
|
|
131917
|
+
var _webpack_lib_optional_deps_resolver__rspack_import_5 = __webpack_require__("./webpack/webpack-lib/optional-deps-resolver.ts");
|
|
131922
131918
|
let userMessageDelivered = false;
|
|
131923
131919
|
function isUsingLess(projectPath) {
|
|
131924
|
-
if ((0,
|
|
131920
|
+
if ((0, _css_lib_integrations__rspack_import_3.ws)(projectPath, 'less')) {
|
|
131925
131921
|
if (!userMessageDelivered) {
|
|
131926
|
-
if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(`${
|
|
131922
|
+
if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(`${pintor__rspack_import_1_default().brightMagenta('►►► Author says')} ${_css_lib_messages__rspack_import_2.zA('LESS')}`);
|
|
131927
131923
|
userMessageDelivered = true;
|
|
131928
131924
|
}
|
|
131929
131925
|
return true;
|
|
131930
131926
|
}
|
|
131931
131927
|
return false;
|
|
131932
131928
|
}
|
|
131933
|
-
function resolveLessLoader(projectPath) {
|
|
131934
|
-
const extensionRoot = (0, _css_lib_integrations__rspack_import_4.He)();
|
|
131935
|
-
const bases = [
|
|
131936
|
-
projectPath,
|
|
131937
|
-
extensionRoot || void 0,
|
|
131938
|
-
process.cwd()
|
|
131939
|
-
].filter(Boolean);
|
|
131940
|
-
for (const base of bases)try {
|
|
131941
|
-
const req = (0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(base, 'package.json'));
|
|
131942
|
-
return req.resolve('less-loader');
|
|
131943
|
-
} catch {}
|
|
131944
|
-
try {
|
|
131945
|
-
return require.resolve('less-loader', {
|
|
131946
|
-
paths: bases
|
|
131947
|
-
});
|
|
131948
|
-
} catch {
|
|
131949
|
-
return;
|
|
131950
|
-
}
|
|
131951
|
-
}
|
|
131952
131929
|
async function maybeUseLess(projectPath, manifestPath) {
|
|
131953
131930
|
const resolvedManifestPath = manifestPath || path__rspack_import_0.join(projectPath, 'manifest.json');
|
|
131954
131931
|
if (!isUsingLess(projectPath)) return [];
|
|
131955
|
-
|
|
131956
|
-
|
|
131957
|
-
|
|
131932
|
+
const lessLoaderPath = await (0, _webpack_lib_optional_deps_resolver__rspack_import_5.f)({
|
|
131933
|
+
integration: 'LESS',
|
|
131934
|
+
projectPath,
|
|
131935
|
+
dependencyId: 'less-loader',
|
|
131936
|
+
installDependencies: [
|
|
131958
131937
|
'less',
|
|
131959
131938
|
'less-loader'
|
|
131960
|
-
]
|
|
131961
|
-
|
|
131962
|
-
|
|
131963
|
-
|
|
131964
|
-
|
|
131965
|
-
|
|
131966
|
-
}
|
|
131939
|
+
],
|
|
131940
|
+
verifyPackageIds: [
|
|
131941
|
+
'less',
|
|
131942
|
+
'less-loader'
|
|
131943
|
+
]
|
|
131944
|
+
});
|
|
131967
131945
|
return [
|
|
131968
131946
|
{
|
|
131969
131947
|
test: /\.less$/,
|
|
@@ -131995,7 +131973,7 @@ var __webpack_modules__ = {
|
|
|
131995
131973
|
generator: {
|
|
131996
131974
|
filename: "content_scripts/[name].[contenthash:8].css"
|
|
131997
131975
|
},
|
|
131998
|
-
issuer: (issuer)=>(0,
|
|
131976
|
+
issuer: (issuer)=>(0, _css_lib_is_content_script__rspack_import_4.z)(issuer, resolvedManifestPath, projectPath)
|
|
131999
131977
|
}
|
|
132000
131978
|
];
|
|
132001
131979
|
}
|
|
@@ -132014,8 +131992,7 @@ var __webpack_modules__ = {
|
|
|
132014
131992
|
var _css_lib_messages__rspack_import_4 = __webpack_require__("./webpack/plugin-css/css-lib/messages.ts");
|
|
132015
131993
|
var _css_lib_integrations__rspack_import_5 = __webpack_require__("./webpack/plugin-css/css-lib/integrations.ts");
|
|
132016
131994
|
var _tailwind__rspack_import_6 = __webpack_require__("./webpack/plugin-css/css-tools/tailwind.ts");
|
|
132017
|
-
var
|
|
132018
|
-
var _less__rspack_import_8 = __webpack_require__("./webpack/plugin-css/css-tools/less.ts");
|
|
131995
|
+
var _webpack_lib_optional_deps_resolver__rspack_import_7 = __webpack_require__("./webpack/webpack-lib/optional-deps-resolver.ts");
|
|
132019
131996
|
let userMessageDelivered = false;
|
|
132020
131997
|
const postCssConfigFiles = [
|
|
132021
131998
|
'.postcssrc',
|
|
@@ -132186,33 +132163,6 @@ var __webpack_modules__ = {
|
|
|
132186
132163
|
return false;
|
|
132187
132164
|
}
|
|
132188
132165
|
async function maybeUsePostCss(projectPath, opts) {
|
|
132189
|
-
const getResolutionPaths = ()=>{
|
|
132190
|
-
const extensionRoot = (0, _css_lib_integrations__rspack_import_5.He)();
|
|
132191
|
-
const paths = [
|
|
132192
|
-
projectPath,
|
|
132193
|
-
extensionRoot || void 0,
|
|
132194
|
-
process.cwd()
|
|
132195
|
-
].filter(Boolean);
|
|
132196
|
-
return Array.from(new Set(paths));
|
|
132197
|
-
};
|
|
132198
|
-
const resolveWithCreateRequire = (id)=>{
|
|
132199
|
-
const bases = getResolutionPaths();
|
|
132200
|
-
for (const base of bases)try {
|
|
132201
|
-
const req = (0, module__rspack_import_2.createRequire)(path__rspack_import_0.join(base, 'package.json'));
|
|
132202
|
-
return req.resolve(id);
|
|
132203
|
-
} catch {}
|
|
132204
|
-
};
|
|
132205
|
-
const resolvePostCssLoader = ()=>{
|
|
132206
|
-
const fromRuntimeRequire = resolveWithCreateRequire('postcss-loader');
|
|
132207
|
-
if (fromRuntimeRequire) return fromRuntimeRequire;
|
|
132208
|
-
try {
|
|
132209
|
-
return require.resolve('postcss-loader', {
|
|
132210
|
-
paths: getResolutionPaths()
|
|
132211
|
-
});
|
|
132212
|
-
} catch {
|
|
132213
|
-
return;
|
|
132214
|
-
}
|
|
132215
|
-
};
|
|
132216
132166
|
const userPostCssConfig = findPostCssConfig(projectPath);
|
|
132217
132167
|
const userConfigMentionsTailwind = userConfigMentionsTailwindPlugin(userPostCssConfig);
|
|
132218
132168
|
const userConfigUsesDirectTailwindReference = userConfigUsesDirectTailwindPluginReference(userPostCssConfig);
|
|
@@ -132235,20 +132185,19 @@ var __webpack_modules__ = {
|
|
|
132235
132185
|
const tailwindPresent = (0, _tailwind__rspack_import_6.F)(projectPath);
|
|
132236
132186
|
const tailwindConfigured = tailwindPresent || userConfigMentionsTailwind;
|
|
132237
132187
|
if (!userPostCssConfig && !pkgHasPostCss && !tailwindPresent) return {};
|
|
132238
|
-
|
|
132239
|
-
|
|
132240
|
-
|
|
132241
|
-
|
|
132242
|
-
|
|
132243
|
-
|
|
132244
|
-
|
|
132245
|
-
|
|
132246
|
-
|
|
132247
|
-
|
|
132248
|
-
|
|
132249
|
-
|
|
132250
|
-
|
|
132251
|
-
}
|
|
132188
|
+
const resolvedPostCssLoader = await (0, _webpack_lib_optional_deps_resolver__rspack_import_7.f)({
|
|
132189
|
+
integration: 'PostCSS',
|
|
132190
|
+
projectPath,
|
|
132191
|
+
dependencyId: 'postcss-loader',
|
|
132192
|
+
installDependencies: [
|
|
132193
|
+
'postcss',
|
|
132194
|
+
'postcss-loader'
|
|
132195
|
+
],
|
|
132196
|
+
verifyPackageIds: [
|
|
132197
|
+
'postcss',
|
|
132198
|
+
'postcss-loader'
|
|
132199
|
+
]
|
|
132200
|
+
});
|
|
132252
132201
|
let pluginsFromOptions;
|
|
132253
132202
|
const shouldInjectTailwindPlugin = tailwindConfigured && !pkgHasPostCss && (!userPostCssConfig || userConfigIsCjsInEsm || userConfigMentionsTailwind);
|
|
132254
132203
|
const declaredTailwindMajor = getDeclaredTailwindMajor(projectPath);
|
|
@@ -132377,6 +132326,7 @@ var __webpack_modules__ = {
|
|
|
132377
132326
|
var pintor__rspack_import_2_default = /*#__PURE__*/ __webpack_require__.n(pintor__rspack_import_2);
|
|
132378
132327
|
var _css_lib_messages__rspack_import_3 = __webpack_require__("./webpack/plugin-css/css-lib/messages.ts");
|
|
132379
132328
|
var _css_lib_integrations__rspack_import_4 = __webpack_require__("./webpack/plugin-css/css-lib/integrations.ts");
|
|
132329
|
+
var _webpack_lib_optional_deps_resolver__rspack_import_5 = __webpack_require__("./webpack/webpack-lib/optional-deps-resolver.ts");
|
|
132380
132330
|
let userMessageDelivered = false;
|
|
132381
132331
|
function isUsingSass(projectPath) {
|
|
132382
132332
|
if ((0, _css_lib_integrations__rspack_import_4.ws)(projectPath, 'sass')) {
|
|
@@ -132388,25 +132338,6 @@ var __webpack_modules__ = {
|
|
|
132388
132338
|
}
|
|
132389
132339
|
return false;
|
|
132390
132340
|
}
|
|
132391
|
-
function resolveSassLoader(projectPath) {
|
|
132392
|
-
const extensionRoot = (0, _css_lib_integrations__rspack_import_4.He)();
|
|
132393
|
-
const bases = [
|
|
132394
|
-
projectPath,
|
|
132395
|
-
extensionRoot || void 0,
|
|
132396
|
-
process.cwd()
|
|
132397
|
-
].filter(Boolean);
|
|
132398
|
-
for (const base of bases)try {
|
|
132399
|
-
const req = (0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(base, 'package.json'));
|
|
132400
|
-
return req.resolve('sass-loader');
|
|
132401
|
-
} catch {}
|
|
132402
|
-
try {
|
|
132403
|
-
return require.resolve('sass-loader', {
|
|
132404
|
-
paths: bases
|
|
132405
|
-
});
|
|
132406
|
-
} catch {
|
|
132407
|
-
return;
|
|
132408
|
-
}
|
|
132409
|
-
}
|
|
132410
132341
|
function resolveSassImplementation(projectPath) {
|
|
132411
132342
|
const extensionRoot = (0, _css_lib_integrations__rspack_import_4.He)();
|
|
132412
132343
|
const bases = [
|
|
@@ -132443,24 +132374,23 @@ var __webpack_modules__ = {
|
|
|
132443
132374
|
}
|
|
132444
132375
|
async function maybeUseSass(projectPath) {
|
|
132445
132376
|
if (!isUsingSass(projectPath)) return [];
|
|
132446
|
-
|
|
132447
|
-
|
|
132448
|
-
|
|
132377
|
+
const sassLoaderPath = await (0, _webpack_lib_optional_deps_resolver__rspack_import_5.f)({
|
|
132378
|
+
integration: 'SASS',
|
|
132379
|
+
projectPath,
|
|
132380
|
+
dependencyId: 'sass-loader',
|
|
132381
|
+
installDependencies: [
|
|
132449
132382
|
'postcss-loader',
|
|
132450
132383
|
'postcss-scss',
|
|
132451
|
-
'postcss-preset-env'
|
|
132452
|
-
];
|
|
132453
|
-
const didInstallPostCss = await (0, _css_lib_integrations__rspack_import_4.tm)('PostCSS', postCssDependencies);
|
|
132454
|
-
if (!didInstallPostCss) throw new Error('[PostCSS] Optional dependencies failed to install.');
|
|
132455
|
-
const sassDependencies = [
|
|
132384
|
+
'postcss-preset-env',
|
|
132456
132385
|
'sass-loader'
|
|
132457
|
-
]
|
|
132458
|
-
|
|
132459
|
-
|
|
132460
|
-
|
|
132461
|
-
|
|
132462
|
-
|
|
132463
|
-
|
|
132386
|
+
],
|
|
132387
|
+
verifyPackageIds: [
|
|
132388
|
+
'postcss-loader',
|
|
132389
|
+
'postcss-scss',
|
|
132390
|
+
'postcss-preset-env',
|
|
132391
|
+
'sass-loader'
|
|
132392
|
+
]
|
|
132393
|
+
});
|
|
132464
132394
|
return [
|
|
132465
132395
|
{
|
|
132466
132396
|
test: /\.(sass|scss)$/,
|
|
@@ -132520,9 +132450,7 @@ var __webpack_modules__ = {
|
|
|
132520
132450
|
"use strict";
|
|
132521
132451
|
__webpack_require__.d(__webpack_exports__, {
|
|
132522
132452
|
Dy: ()=>_plugin_css_css_lib_integrations__rspack_import_0.Dy,
|
|
132523
|
-
He: ()=>_plugin_css_css_lib_integrations__rspack_import_0.He,
|
|
132524
132453
|
qQ: ()=>isUsingJSFramework,
|
|
132525
|
-
tm: ()=>_plugin_css_css_lib_integrations__rspack_import_0.tm,
|
|
132526
132454
|
ws: ()=>_plugin_css_css_lib_integrations__rspack_import_0.ws
|
|
132527
132455
|
});
|
|
132528
132456
|
var _plugin_css_css_lib_integrations__rspack_import_0 = __webpack_require__("./webpack/plugin-css/css-lib/integrations.ts");
|
|
@@ -132585,7 +132513,6 @@ var __webpack_modules__ = {
|
|
|
132585
132513
|
"use strict";
|
|
132586
132514
|
__webpack_require__.d(__webpack_exports__, {
|
|
132587
132515
|
Ei: ()=>jsFrameworksHmrSummary,
|
|
132588
|
-
Jv: ()=>youAreAllSet,
|
|
132589
132516
|
LR: ()=>creatingTSConfig,
|
|
132590
132517
|
MH: ()=>jsFrameworksConfigsDetected,
|
|
132591
132518
|
Q2: ()=>optionalDepsReady,
|
|
@@ -132598,9 +132525,6 @@ var __webpack_modules__ = {
|
|
|
132598
132525
|
function isUsingIntegration(name) {
|
|
132599
132526
|
return `${pintor__rspack_import_0_default().gray('►►►')} Using ${pintor__rspack_import_0_default().brightBlue(name)}...`;
|
|
132600
132527
|
}
|
|
132601
|
-
function youAreAllSet(name) {
|
|
132602
|
-
return `${pintor__rspack_import_0_default().green('►►►')} ${name} installation completed.`;
|
|
132603
|
-
}
|
|
132604
132528
|
function optionalDepsReady(integrations) {
|
|
132605
132529
|
const list = integrations.length > 0 ? integrations.map((name)=>pintor__rspack_import_0_default().yellow(name)).join(', ') : pintor__rspack_import_0_default().gray('optional');
|
|
132606
132530
|
return `${pintor__rspack_import_0_default().green('►►►')} All set — ${list} tooling is ready.`;
|
|
@@ -132637,40 +132561,8 @@ var __webpack_modules__ = {
|
|
|
132637
132561
|
var pintor__rspack_import_2_default = /*#__PURE__*/ __webpack_require__.n(pintor__rspack_import_2);
|
|
132638
132562
|
var _js_frameworks_lib_messages__rspack_import_3 = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/messages.ts");
|
|
132639
132563
|
var _frameworks_lib_integrations__rspack_import_4 = __webpack_require__("./webpack/plugin-js-frameworks/frameworks-lib/integrations.ts");
|
|
132564
|
+
var _webpack_lib_optional_deps_resolver__rspack_import_5 = __webpack_require__("./webpack/webpack-lib/optional-deps-resolver.ts");
|
|
132640
132565
|
let userMessageDelivered = false;
|
|
132641
|
-
function resolveWithRuntimePaths(id, projectPath) {
|
|
132642
|
-
const extensionRoot = (0, _frameworks_lib_integrations__rspack_import_4.He)();
|
|
132643
|
-
const bases = [
|
|
132644
|
-
projectPath,
|
|
132645
|
-
extensionRoot || void 0,
|
|
132646
|
-
process.cwd()
|
|
132647
|
-
].filter(Boolean);
|
|
132648
|
-
for (const base of bases)try {
|
|
132649
|
-
const req = (0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(base, 'package.json'));
|
|
132650
|
-
return req.resolve(id);
|
|
132651
|
-
} catch {}
|
|
132652
|
-
try {
|
|
132653
|
-
return require.resolve(id, {
|
|
132654
|
-
paths: bases
|
|
132655
|
-
});
|
|
132656
|
-
} catch {
|
|
132657
|
-
return;
|
|
132658
|
-
}
|
|
132659
|
-
}
|
|
132660
|
-
function getPreactRefreshPlugin(projectPath) {
|
|
132661
|
-
const extensionRoot = (0, _frameworks_lib_integrations__rspack_import_4.He)();
|
|
132662
|
-
const bases = [
|
|
132663
|
-
projectPath,
|
|
132664
|
-
extensionRoot || void 0,
|
|
132665
|
-
process.cwd()
|
|
132666
|
-
].filter(Boolean);
|
|
132667
|
-
for (const base of bases)try {
|
|
132668
|
-
const req = (0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(base, 'package.json'));
|
|
132669
|
-
const mod = req('@rspack/plugin-preact-refresh');
|
|
132670
|
-
const plugin = mod && mod.default || mod;
|
|
132671
|
-
if (plugin) return plugin;
|
|
132672
|
-
} catch {}
|
|
132673
|
-
}
|
|
132674
132566
|
function isUsingPreact(projectPath) {
|
|
132675
132567
|
if ((0, _frameworks_lib_integrations__rspack_import_4.ws)(projectPath, 'preact')) {
|
|
132676
132568
|
if (!userMessageDelivered) {
|
|
@@ -132683,22 +132575,27 @@ var __webpack_modules__ = {
|
|
|
132683
132575
|
}
|
|
132684
132576
|
async function maybeUsePreact(projectPath) {
|
|
132685
132577
|
if (!isUsingPreact(projectPath)) return;
|
|
132686
|
-
|
|
132687
|
-
|
|
132688
|
-
|
|
132689
|
-
|
|
132690
|
-
|
|
132691
|
-
|
|
132692
|
-
|
|
132693
|
-
|
|
132694
|
-
|
|
132695
|
-
|
|
132696
|
-
|
|
132697
|
-
|
|
132698
|
-
|
|
132699
|
-
|
|
132700
|
-
|
|
132701
|
-
|
|
132578
|
+
const preactDependencies = [
|
|
132579
|
+
'@prefresh/core',
|
|
132580
|
+
'@prefresh/utils',
|
|
132581
|
+
'@rspack/plugin-preact-refresh',
|
|
132582
|
+
'preact'
|
|
132583
|
+
];
|
|
132584
|
+
await (0, _webpack_lib_optional_deps_resolver__rspack_import_5.f)({
|
|
132585
|
+
integration: 'Preact',
|
|
132586
|
+
projectPath,
|
|
132587
|
+
dependencyId: '@rspack/plugin-preact-refresh',
|
|
132588
|
+
installDependencies: preactDependencies,
|
|
132589
|
+
verifyPackageIds: preactDependencies
|
|
132590
|
+
});
|
|
132591
|
+
const PreactRefreshPlugin = await (0, _webpack_lib_optional_deps_resolver__rspack_import_5.C)({
|
|
132592
|
+
integration: 'Preact',
|
|
132593
|
+
projectPath,
|
|
132594
|
+
dependencyId: '@rspack/plugin-preact-refresh',
|
|
132595
|
+
installDependencies: preactDependencies,
|
|
132596
|
+
verifyPackageIds: preactDependencies,
|
|
132597
|
+
moduleAdapter: (mod)=>mod && mod.default || mod
|
|
132598
|
+
});
|
|
132702
132599
|
const preactPlugins = [
|
|
132703
132600
|
new PreactRefreshPlugin({})
|
|
132704
132601
|
];
|
|
@@ -132741,40 +132638,8 @@ var __webpack_modules__ = {
|
|
|
132741
132638
|
var pintor__rspack_import_2_default = /*#__PURE__*/ __webpack_require__.n(pintor__rspack_import_2);
|
|
132742
132639
|
var _js_frameworks_lib_messages__rspack_import_3 = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/messages.ts");
|
|
132743
132640
|
var _frameworks_lib_integrations__rspack_import_4 = __webpack_require__("./webpack/plugin-js-frameworks/frameworks-lib/integrations.ts");
|
|
132641
|
+
var _webpack_lib_optional_deps_resolver__rspack_import_5 = __webpack_require__("./webpack/webpack-lib/optional-deps-resolver.ts");
|
|
132744
132642
|
let userMessageDelivered = false;
|
|
132745
|
-
function resolveWithRuntimePaths(id, projectPath) {
|
|
132746
|
-
const extensionRoot = (0, _frameworks_lib_integrations__rspack_import_4.He)();
|
|
132747
|
-
const bases = [
|
|
132748
|
-
projectPath,
|
|
132749
|
-
extensionRoot || void 0,
|
|
132750
|
-
process.cwd()
|
|
132751
|
-
].filter(Boolean);
|
|
132752
|
-
for (const base of bases)try {
|
|
132753
|
-
const req = (0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(base, 'package.json'));
|
|
132754
|
-
return req.resolve(id);
|
|
132755
|
-
} catch {}
|
|
132756
|
-
try {
|
|
132757
|
-
return require.resolve(id, {
|
|
132758
|
-
paths: bases
|
|
132759
|
-
});
|
|
132760
|
-
} catch {
|
|
132761
|
-
return;
|
|
132762
|
-
}
|
|
132763
|
-
}
|
|
132764
|
-
function getReactRefreshPlugin(projectPath) {
|
|
132765
|
-
const extensionRoot = (0, _frameworks_lib_integrations__rspack_import_4.He)();
|
|
132766
|
-
const bases = [
|
|
132767
|
-
projectPath,
|
|
132768
|
-
extensionRoot || void 0,
|
|
132769
|
-
process.cwd()
|
|
132770
|
-
].filter(Boolean);
|
|
132771
|
-
for (const base of bases)try {
|
|
132772
|
-
const req = (0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(base, 'package.json'));
|
|
132773
|
-
const mod = req('@rspack/plugin-react-refresh');
|
|
132774
|
-
const plugin = mod && mod.default || mod;
|
|
132775
|
-
if (plugin) return plugin;
|
|
132776
|
-
} catch {}
|
|
132777
|
-
}
|
|
132778
132643
|
function isUsingReact(projectPath) {
|
|
132779
132644
|
if ((0, _frameworks_lib_integrations__rspack_import_4.ws)(projectPath, 'react')) {
|
|
132780
132645
|
if (!userMessageDelivered) {
|
|
@@ -132787,20 +132652,25 @@ var __webpack_modules__ = {
|
|
|
132787
132652
|
}
|
|
132788
132653
|
async function maybeUseReact(projectPath) {
|
|
132789
132654
|
if (!isUsingReact(projectPath)) return;
|
|
132790
|
-
|
|
132791
|
-
|
|
132792
|
-
|
|
132793
|
-
|
|
132794
|
-
|
|
132795
|
-
|
|
132796
|
-
|
|
132797
|
-
|
|
132798
|
-
|
|
132799
|
-
|
|
132800
|
-
|
|
132801
|
-
|
|
132802
|
-
|
|
132803
|
-
|
|
132655
|
+
const reactDependencies = [
|
|
132656
|
+
'react-refresh',
|
|
132657
|
+
'@rspack/plugin-react-refresh'
|
|
132658
|
+
];
|
|
132659
|
+
await (0, _webpack_lib_optional_deps_resolver__rspack_import_5.f)({
|
|
132660
|
+
integration: 'React',
|
|
132661
|
+
projectPath,
|
|
132662
|
+
dependencyId: 'react-refresh',
|
|
132663
|
+
installDependencies: reactDependencies,
|
|
132664
|
+
verifyPackageIds: reactDependencies
|
|
132665
|
+
});
|
|
132666
|
+
const ReactRefreshPlugin = await (0, _webpack_lib_optional_deps_resolver__rspack_import_5.C)({
|
|
132667
|
+
integration: 'React',
|
|
132668
|
+
projectPath,
|
|
132669
|
+
dependencyId: '@rspack/plugin-react-refresh',
|
|
132670
|
+
installDependencies: reactDependencies,
|
|
132671
|
+
verifyPackageIds: reactDependencies,
|
|
132672
|
+
moduleAdapter: (mod)=>mod && mod.default || mod
|
|
132673
|
+
});
|
|
132804
132674
|
const reactPlugins = [
|
|
132805
132675
|
new ReactRefreshPlugin({
|
|
132806
132676
|
overlay: false
|
|
@@ -132852,26 +132722,8 @@ var __webpack_modules__ = {
|
|
|
132852
132722
|
var _js_frameworks_lib_messages__rspack_import_3 = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/messages.ts");
|
|
132853
132723
|
var _frameworks_lib_integrations__rspack_import_4 = __webpack_require__("./webpack/plugin-js-frameworks/frameworks-lib/integrations.ts");
|
|
132854
132724
|
var _js_frameworks_lib_load_loader_options__rspack_import_5 = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/load-loader-options.ts");
|
|
132725
|
+
var _webpack_lib_optional_deps_resolver__rspack_import_6 = __webpack_require__("./webpack/webpack-lib/optional-deps-resolver.ts");
|
|
132855
132726
|
let userMessageDelivered = false;
|
|
132856
|
-
function resolveWithRuntimePaths(id, projectPath) {
|
|
132857
|
-
const extensionRoot = (0, _frameworks_lib_integrations__rspack_import_4.He)();
|
|
132858
|
-
const bases = [
|
|
132859
|
-
projectPath,
|
|
132860
|
-
extensionRoot || void 0,
|
|
132861
|
-
process.cwd()
|
|
132862
|
-
].filter(Boolean);
|
|
132863
|
-
for (const base of bases)try {
|
|
132864
|
-
const req = (0, module__rspack_import_2.createRequire)(path__rspack_import_0.join(base, 'package.json'));
|
|
132865
|
-
return req.resolve(id);
|
|
132866
|
-
} catch {}
|
|
132867
|
-
try {
|
|
132868
|
-
return require.resolve(id, {
|
|
132869
|
-
paths: bases
|
|
132870
|
-
});
|
|
132871
|
-
} catch {
|
|
132872
|
-
return;
|
|
132873
|
-
}
|
|
132874
|
-
}
|
|
132875
132727
|
function resolveFromProject(id, projectPath) {
|
|
132876
132728
|
for (const base of [
|
|
132877
132729
|
projectPath,
|
|
@@ -132901,33 +132753,30 @@ var __webpack_modules__ = {
|
|
|
132901
132753
|
}
|
|
132902
132754
|
async function maybeUseSvelte(projectPath, mode) {
|
|
132903
132755
|
if (!isUsingSvelte(projectPath)) return;
|
|
132904
|
-
|
|
132905
|
-
|
|
132906
|
-
|
|
132907
|
-
|
|
132908
|
-
|
|
132909
|
-
|
|
132910
|
-
if (!didInstallTs) throw new Error('[TypeScript] Optional dependencies failed to install.');
|
|
132911
|
-
const svelteDependencies = [
|
|
132756
|
+
const svelteLoaderPath = await (0, _webpack_lib_optional_deps_resolver__rspack_import_6.f)({
|
|
132757
|
+
integration: 'Svelte',
|
|
132758
|
+
projectPath,
|
|
132759
|
+
dependencyId: 'svelte-loader',
|
|
132760
|
+
installDependencies: [
|
|
132761
|
+
"typescript",
|
|
132912
132762
|
'svelte-loader'
|
|
132913
|
-
]
|
|
132914
|
-
|
|
132915
|
-
|
|
132916
|
-
|
|
132917
|
-
|
|
132918
|
-
|
|
132919
|
-
|
|
132920
|
-
|
|
132921
|
-
|
|
132922
|
-
|
|
132763
|
+
],
|
|
132764
|
+
verifyPackageIds: [
|
|
132765
|
+
"typescript",
|
|
132766
|
+
'svelte-loader'
|
|
132767
|
+
]
|
|
132768
|
+
});
|
|
132769
|
+
await (0, _webpack_lib_optional_deps_resolver__rspack_import_6.f)({
|
|
132770
|
+
integration: 'TypeScript',
|
|
132771
|
+
projectPath,
|
|
132772
|
+
dependencyId: "typescript",
|
|
132773
|
+
installDependencies: [
|
|
132923
132774
|
"typescript"
|
|
132924
|
-
]
|
|
132925
|
-
|
|
132926
|
-
|
|
132927
|
-
|
|
132928
|
-
|
|
132929
|
-
if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(_js_frameworks_lib_messages__rspack_import_3.Jv('TypeScript'));
|
|
132930
|
-
}
|
|
132775
|
+
],
|
|
132776
|
+
verifyPackageIds: [
|
|
132777
|
+
"typescript"
|
|
132778
|
+
]
|
|
132779
|
+
});
|
|
132931
132780
|
const customOptions = await (0, _js_frameworks_lib_load_loader_options__rspack_import_5.g)(projectPath, 'svelte');
|
|
132932
132781
|
const defaultLoaders = [
|
|
132933
132782
|
{
|
|
@@ -133018,11 +132867,11 @@ var __webpack_modules__ = {
|
|
|
133018
132867
|
});
|
|
133019
132868
|
var path__rspack_import_0 = __webpack_require__("path");
|
|
133020
132869
|
var fs__rspack_import_1 = __webpack_require__("fs");
|
|
133021
|
-
__webpack_require__("
|
|
133022
|
-
var
|
|
133023
|
-
var
|
|
133024
|
-
var
|
|
133025
|
-
|
|
132870
|
+
var pintor__rspack_import_2 = __webpack_require__("pintor");
|
|
132871
|
+
var pintor__rspack_import_2_default = /*#__PURE__*/ __webpack_require__.n(pintor__rspack_import_2);
|
|
132872
|
+
var _js_frameworks_lib_messages__rspack_import_3 = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/messages.ts");
|
|
132873
|
+
var _frameworks_lib_integrations__rspack_import_4 = __webpack_require__("./webpack/plugin-js-frameworks/frameworks-lib/integrations.ts");
|
|
132874
|
+
__webpack_require__("./webpack/webpack-lib/optional-deps-resolver.ts");
|
|
133026
132875
|
let hasShownUserMessage = false;
|
|
133027
132876
|
function findNearestPackageJsonDirectory(startPath) {
|
|
133028
132877
|
let currentDirectory = startPath;
|
|
@@ -133077,12 +132926,12 @@ var __webpack_modules__ = {
|
|
|
133077
132926
|
const hasTsFiles = hasTypeScriptSourceFiles(projectPath);
|
|
133078
132927
|
if (!hasShownUserMessage) {
|
|
133079
132928
|
if (TypeScriptAsDevDep || TypeScriptAsDep || hasTsFiles) if (tsConfigFilePath) {
|
|
133080
|
-
if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(`${
|
|
132929
|
+
if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(`${pintor__rspack_import_2_default().brightMagenta('►►► Author says')} ${_js_frameworks_lib_messages__rspack_import_3.zA('TypeScript')}`);
|
|
133081
132930
|
} else if (hasTsFiles) {
|
|
133082
132931
|
const errorMessage = '[Extension.js] Missing tsconfig.json next to package.json. Create one to use TypeScript.';
|
|
133083
132932
|
throw new Error(errorMessage);
|
|
133084
132933
|
} else {
|
|
133085
|
-
console.log(
|
|
132934
|
+
console.log(_js_frameworks_lib_messages__rspack_import_3.LR());
|
|
133086
132935
|
writeTsConfig(projectPath);
|
|
133087
132936
|
}
|
|
133088
132937
|
hasShownUserMessage = true;
|
|
@@ -133096,7 +132945,7 @@ var __webpack_modules__ = {
|
|
|
133096
132945
|
allowSyntheticDefaultImports: true,
|
|
133097
132946
|
esModuleInterop: true,
|
|
133098
132947
|
forceConsistentCasingInFileNames: true,
|
|
133099
|
-
jsx: (0,
|
|
132948
|
+
jsx: (0, _frameworks_lib_integrations__rspack_import_4.qQ)(projectPath) ? 'react-jsx' : 'preserve',
|
|
133100
132949
|
lib: [
|
|
133101
132950
|
'dom',
|
|
133102
132951
|
'dom.iterable',
|
|
@@ -133143,40 +132992,8 @@ var __webpack_modules__ = {
|
|
|
133143
132992
|
var _js_frameworks_lib_messages__rspack_import_4 = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/messages.ts");
|
|
133144
132993
|
var _frameworks_lib_integrations__rspack_import_5 = __webpack_require__("./webpack/plugin-js-frameworks/frameworks-lib/integrations.ts");
|
|
133145
132994
|
var _js_frameworks_lib_load_loader_options__rspack_import_6 = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/load-loader-options.ts");
|
|
132995
|
+
var _webpack_lib_optional_deps_resolver__rspack_import_7 = __webpack_require__("./webpack/webpack-lib/optional-deps-resolver.ts");
|
|
133146
132996
|
let userMessageDelivered = false;
|
|
133147
|
-
function resolveWithRuntimePaths(id, projectPath) {
|
|
133148
|
-
const extensionRoot = (0, _frameworks_lib_integrations__rspack_import_5.He)();
|
|
133149
|
-
const bases = [
|
|
133150
|
-
projectPath,
|
|
133151
|
-
extensionRoot || void 0,
|
|
133152
|
-
process.cwd()
|
|
133153
|
-
].filter(Boolean);
|
|
133154
|
-
for (const base of bases)try {
|
|
133155
|
-
const req = (0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(base, 'package.json'));
|
|
133156
|
-
return req.resolve(id);
|
|
133157
|
-
} catch {}
|
|
133158
|
-
try {
|
|
133159
|
-
return require.resolve(id, {
|
|
133160
|
-
paths: bases
|
|
133161
|
-
});
|
|
133162
|
-
} catch {
|
|
133163
|
-
return;
|
|
133164
|
-
}
|
|
133165
|
-
}
|
|
133166
|
-
function getVueLoaderPlugin(projectPath) {
|
|
133167
|
-
const extensionRoot = (0, _frameworks_lib_integrations__rspack_import_5.He)();
|
|
133168
|
-
const bases = [
|
|
133169
|
-
projectPath,
|
|
133170
|
-
extensionRoot || void 0,
|
|
133171
|
-
process.cwd()
|
|
133172
|
-
].filter(Boolean);
|
|
133173
|
-
for (const base of bases)try {
|
|
133174
|
-
const req = (0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(base, 'package.json'));
|
|
133175
|
-
const mod = req('vue-loader');
|
|
133176
|
-
const plugin = mod && mod.VueLoaderPlugin || mod && mod.default && mod.default.VueLoaderPlugin;
|
|
133177
|
-
if (plugin) return plugin;
|
|
133178
|
-
} catch {}
|
|
133179
|
-
}
|
|
133180
132997
|
function isUsingVue(projectPath) {
|
|
133181
132998
|
const using = (0, _frameworks_lib_integrations__rspack_import_5.ws)(projectPath, 'vue');
|
|
133182
132999
|
if (using && !userMessageDelivered) {
|
|
@@ -133187,20 +133004,25 @@ var __webpack_modules__ = {
|
|
|
133187
133004
|
}
|
|
133188
133005
|
async function maybeUseVue(projectPath, mode = 'development') {
|
|
133189
133006
|
if (!isUsingVue(projectPath)) return;
|
|
133190
|
-
|
|
133191
|
-
|
|
133192
|
-
|
|
133193
|
-
|
|
133194
|
-
|
|
133195
|
-
|
|
133196
|
-
|
|
133197
|
-
|
|
133198
|
-
|
|
133199
|
-
|
|
133200
|
-
|
|
133201
|
-
|
|
133202
|
-
|
|
133203
|
-
|
|
133007
|
+
const vueDependencies = [
|
|
133008
|
+
'vue-loader',
|
|
133009
|
+
'@vue/compiler-sfc'
|
|
133010
|
+
];
|
|
133011
|
+
const vueLoaderPath = await (0, _webpack_lib_optional_deps_resolver__rspack_import_7.f)({
|
|
133012
|
+
integration: 'Vue',
|
|
133013
|
+
projectPath,
|
|
133014
|
+
dependencyId: 'vue-loader',
|
|
133015
|
+
installDependencies: vueDependencies,
|
|
133016
|
+
verifyPackageIds: vueDependencies
|
|
133017
|
+
});
|
|
133018
|
+
const VueLoaderPlugin = await (0, _webpack_lib_optional_deps_resolver__rspack_import_7.C)({
|
|
133019
|
+
integration: 'Vue',
|
|
133020
|
+
projectPath,
|
|
133021
|
+
dependencyId: 'vue-loader',
|
|
133022
|
+
installDependencies: vueDependencies,
|
|
133023
|
+
verifyPackageIds: vueDependencies,
|
|
133024
|
+
moduleAdapter: (mod)=>mod && mod.VueLoaderPlugin || mod && mod.default && mod.default.VueLoaderPlugin
|
|
133025
|
+
});
|
|
133204
133026
|
const customOptions = await (0, _js_frameworks_lib_load_loader_options__rspack_import_6.g)(projectPath, 'vue');
|
|
133205
133027
|
const defaultLoaders = [
|
|
133206
133028
|
{
|
|
@@ -134038,6 +133860,266 @@ var __webpack_modules__ = {
|
|
|
134038
133860
|
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.`;
|
|
134039
133861
|
}
|
|
134040
133862
|
},
|
|
133863
|
+
"./webpack/webpack-lib/optional-deps-resolver.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
133864
|
+
"use strict";
|
|
133865
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
133866
|
+
C: ()=>ensureOptionalModuleLoaded,
|
|
133867
|
+
f: ()=>ensureOptionalPackageResolved
|
|
133868
|
+
});
|
|
133869
|
+
var fs__rspack_import_0 = __webpack_require__("fs");
|
|
133870
|
+
var path__rspack_import_1 = __webpack_require__("path");
|
|
133871
|
+
var module__rspack_import_2 = __webpack_require__("module");
|
|
133872
|
+
var _plugin_css_css_lib_integrations__rspack_import_3 = __webpack_require__("./webpack/plugin-css/css-lib/integrations.ts");
|
|
133873
|
+
const installSingleFlight = new Map();
|
|
133874
|
+
function getResolutionBases(projectPath) {
|
|
133875
|
+
const extensionRoot = (0, _plugin_css_css_lib_integrations__rspack_import_3.He)();
|
|
133876
|
+
const bases = [
|
|
133877
|
+
projectPath,
|
|
133878
|
+
extensionRoot || void 0,
|
|
133879
|
+
process.cwd()
|
|
133880
|
+
].filter(Boolean);
|
|
133881
|
+
return Array.from(new Set(bases));
|
|
133882
|
+
}
|
|
133883
|
+
function packageJsonPath(basePath) {
|
|
133884
|
+
return path__rspack_import_1.join(basePath, 'package.json');
|
|
133885
|
+
}
|
|
133886
|
+
function tryResolveWithBase(dependencyId, basePath) {
|
|
133887
|
+
try {
|
|
133888
|
+
const req = (0, module__rspack_import_2.createRequire)(packageJsonPath(basePath));
|
|
133889
|
+
return req.resolve(dependencyId);
|
|
133890
|
+
} catch {
|
|
133891
|
+
return;
|
|
133892
|
+
}
|
|
133893
|
+
}
|
|
133894
|
+
function resolveDependency(dependencyId, projectPath) {
|
|
133895
|
+
const bases = getResolutionBases(projectPath);
|
|
133896
|
+
for (const basePath of bases){
|
|
133897
|
+
const resolvedPath = tryResolveWithBase(dependencyId, basePath);
|
|
133898
|
+
if (resolvedPath) return {
|
|
133899
|
+
resolvedPath,
|
|
133900
|
+
basePath
|
|
133901
|
+
};
|
|
133902
|
+
}
|
|
133903
|
+
try {
|
|
133904
|
+
const resolvedPath = require.resolve(dependencyId, {
|
|
133905
|
+
paths: bases
|
|
133906
|
+
});
|
|
133907
|
+
return {
|
|
133908
|
+
resolvedPath,
|
|
133909
|
+
basePath: projectPath
|
|
133910
|
+
};
|
|
133911
|
+
} catch {
|
|
133912
|
+
return;
|
|
133913
|
+
}
|
|
133914
|
+
}
|
|
133915
|
+
function resolveFromKnownLocations(dependencyId, projectPath, installRoot) {
|
|
133916
|
+
const resolved = resolveDependency(dependencyId, projectPath);
|
|
133917
|
+
if (resolved) return resolved.resolvedPath;
|
|
133918
|
+
if (!installRoot) return;
|
|
133919
|
+
return resolveFromInstallRootPackageDir(dependencyId, installRoot);
|
|
133920
|
+
}
|
|
133921
|
+
function getPackageDirFromInstallRoot(dependencyId, installRoot) {
|
|
133922
|
+
return path__rspack_import_1.join(installRoot, 'node_modules', ...dependencyId.split('/'));
|
|
133923
|
+
}
|
|
133924
|
+
function readPackageJsonFromDir(packageDir) {
|
|
133925
|
+
const manifestPath = path__rspack_import_1.join(packageDir, 'package.json');
|
|
133926
|
+
if (!fs__rspack_import_0.existsSync(manifestPath)) return;
|
|
133927
|
+
try {
|
|
133928
|
+
const raw = fs__rspack_import_0.readFileSync(manifestPath, 'utf8');
|
|
133929
|
+
return JSON.parse(raw || '{}');
|
|
133930
|
+
} catch {
|
|
133931
|
+
return;
|
|
133932
|
+
}
|
|
133933
|
+
}
|
|
133934
|
+
function getPackageEntryCandidates(pkg) {
|
|
133935
|
+
const candidateEntries = [];
|
|
133936
|
+
if ('string' == typeof pkg?.main) candidateEntries.push(pkg.main);
|
|
133937
|
+
if ('string' == typeof pkg?.module) candidateEntries.push(pkg.module);
|
|
133938
|
+
if ('string' == typeof pkg?.exports) candidateEntries.push(pkg.exports);
|
|
133939
|
+
const dotExport = pkg?.exports?.['.'];
|
|
133940
|
+
if ('string' == typeof dotExport) candidateEntries.push(dotExport);
|
|
133941
|
+
if (dotExport && 'object' == typeof dotExport) {
|
|
133942
|
+
if ('string' == typeof dotExport.require) candidateEntries.push(dotExport.require);
|
|
133943
|
+
if ('string' == typeof dotExport.default) candidateEntries.push(dotExport.default);
|
|
133944
|
+
if ('string' == typeof dotExport.import) candidateEntries.push(dotExport.import);
|
|
133945
|
+
}
|
|
133946
|
+
candidateEntries.push('index.js', 'index.cjs', 'index.mjs');
|
|
133947
|
+
return candidateEntries;
|
|
133948
|
+
}
|
|
133949
|
+
function resolveFirstExistingEntry(packageDir, candidateEntries) {
|
|
133950
|
+
for (const relativeEntry of candidateEntries){
|
|
133951
|
+
const absoluteEntry = path__rspack_import_1.resolve(packageDir, relativeEntry);
|
|
133952
|
+
if (fs__rspack_import_0.existsSync(absoluteEntry)) return absoluteEntry;
|
|
133953
|
+
}
|
|
133954
|
+
}
|
|
133955
|
+
function resolveFromInstallRootPackageDir(dependencyId, installRoot) {
|
|
133956
|
+
const packageDir = getPackageDirFromInstallRoot(dependencyId, installRoot);
|
|
133957
|
+
if (!fs__rspack_import_0.existsSync(packageDir)) return;
|
|
133958
|
+
try {
|
|
133959
|
+
return require.resolve(packageDir);
|
|
133960
|
+
} catch {}
|
|
133961
|
+
const pkg = readPackageJsonFromDir(packageDir);
|
|
133962
|
+
if (!pkg) return;
|
|
133963
|
+
const candidateEntries = getPackageEntryCandidates(pkg);
|
|
133964
|
+
return resolveFirstExistingEntry(packageDir, candidateEntries);
|
|
133965
|
+
}
|
|
133966
|
+
function verifyPackageInInstallRoot(packageId, installRoot) {
|
|
133967
|
+
const packageJson = path__rspack_import_1.join(getPackageDirFromInstallRoot(packageId, installRoot), 'package.json');
|
|
133968
|
+
return fs__rspack_import_0.existsSync(packageJson);
|
|
133969
|
+
}
|
|
133970
|
+
function buildDiagnostics(input) {
|
|
133971
|
+
const bases = getResolutionBases(input.projectPath);
|
|
133972
|
+
const verifyState = input.verifyPackageIds.map((id)=>({
|
|
133973
|
+
dependency: id,
|
|
133974
|
+
existsAtInstallRoot: input.installRoot ? verifyPackageInInstallRoot(id, input.installRoot) : false
|
|
133975
|
+
}));
|
|
133976
|
+
return {
|
|
133977
|
+
integration: input.integration,
|
|
133978
|
+
dependencyId: input.dependencyId,
|
|
133979
|
+
projectPath: input.projectPath,
|
|
133980
|
+
installRoot: input.installRoot || null,
|
|
133981
|
+
installDependencies: input.installDependencies,
|
|
133982
|
+
verifyPackageIds: input.verifyPackageIds,
|
|
133983
|
+
resolutionBases: bases,
|
|
133984
|
+
verifyState
|
|
133985
|
+
};
|
|
133986
|
+
}
|
|
133987
|
+
async function runInstallAndVerify(input) {
|
|
133988
|
+
const didInstall = await (0, _plugin_css_css_lib_integrations__rspack_import_3.tm)(input.integration, input.installDependencies);
|
|
133989
|
+
if (!didInstall) {
|
|
133990
|
+
const diagnostics = buildDiagnostics({
|
|
133991
|
+
integration: input.integration,
|
|
133992
|
+
dependencyId: input.dependencyId,
|
|
133993
|
+
projectPath: input.projectPath,
|
|
133994
|
+
installRoot: input.installRoot,
|
|
133995
|
+
installDependencies: input.installDependencies,
|
|
133996
|
+
verifyPackageIds: input.verifyPackageIds
|
|
133997
|
+
});
|
|
133998
|
+
throw new Error(`[${input.integration}] Optional dependencies failed to install.\n` + JSON.stringify(diagnostics, null, 2));
|
|
133999
|
+
}
|
|
134000
|
+
if (!input.installRoot) {
|
|
134001
|
+
const diagnostics = buildDiagnostics({
|
|
134002
|
+
integration: input.integration,
|
|
134003
|
+
dependencyId: input.dependencyId,
|
|
134004
|
+
projectPath: input.projectPath,
|
|
134005
|
+
installRoot: input.installRoot,
|
|
134006
|
+
installDependencies: input.installDependencies,
|
|
134007
|
+
verifyPackageIds: input.verifyPackageIds
|
|
134008
|
+
});
|
|
134009
|
+
throw new Error(`[${input.integration}] Optional dependency install root is unavailable.\n` + JSON.stringify(diagnostics, null, 2));
|
|
134010
|
+
}
|
|
134011
|
+
const missingAfterInstall = input.verifyPackageIds.filter((id)=>!verifyPackageInInstallRoot(id, input.installRoot));
|
|
134012
|
+
if (missingAfterInstall.length > 0) {
|
|
134013
|
+
const diagnostics = buildDiagnostics({
|
|
134014
|
+
integration: input.integration,
|
|
134015
|
+
dependencyId: input.dependencyId,
|
|
134016
|
+
projectPath: input.projectPath,
|
|
134017
|
+
installRoot: input.installRoot,
|
|
134018
|
+
installDependencies: input.installDependencies,
|
|
134019
|
+
verifyPackageIds: input.verifyPackageIds
|
|
134020
|
+
});
|
|
134021
|
+
throw new Error(`[${input.integration}] Optional dependency install reported success but packages are missing: ${missingAfterInstall.join(', ')}.\n` + JSON.stringify(diagnostics, null, 2));
|
|
134022
|
+
}
|
|
134023
|
+
}
|
|
134024
|
+
async function ensureInstalledAndVerified(input) {
|
|
134025
|
+
const installRoot = (0, _plugin_css_css_lib_integrations__rspack_import_3.He)();
|
|
134026
|
+
const key = [
|
|
134027
|
+
installRoot || 'missing-install-root',
|
|
134028
|
+
...input.installDependencies.slice().sort()
|
|
134029
|
+
].join('::');
|
|
134030
|
+
const existing = installSingleFlight.get(key);
|
|
134031
|
+
if (existing) return void await existing;
|
|
134032
|
+
const installPromise = runInstallAndVerify({
|
|
134033
|
+
integration: input.integration,
|
|
134034
|
+
installDependencies: input.installDependencies,
|
|
134035
|
+
verifyPackageIds: input.verifyPackageIds,
|
|
134036
|
+
projectPath: input.projectPath,
|
|
134037
|
+
dependencyId: input.dependencyId,
|
|
134038
|
+
installRoot
|
|
134039
|
+
});
|
|
134040
|
+
installSingleFlight.set(key, installPromise);
|
|
134041
|
+
try {
|
|
134042
|
+
await installPromise;
|
|
134043
|
+
} finally{
|
|
134044
|
+
installSingleFlight.delete(key);
|
|
134045
|
+
}
|
|
134046
|
+
}
|
|
134047
|
+
async function ensureOptionalPackageResolved(input) {
|
|
134048
|
+
const installRoot = (0, _plugin_css_css_lib_integrations__rspack_import_3.He)();
|
|
134049
|
+
const resolvedBeforeInstall = resolveFromKnownLocations(input.dependencyId, input.projectPath, installRoot);
|
|
134050
|
+
if (resolvedBeforeInstall) return resolvedBeforeInstall;
|
|
134051
|
+
const installDependencies = input.installDependencies || [
|
|
134052
|
+
input.dependencyId
|
|
134053
|
+
];
|
|
134054
|
+
const verifyPackageIds = input.verifyPackageIds || installDependencies;
|
|
134055
|
+
await ensureInstalledAndVerified({
|
|
134056
|
+
integration: input.integration,
|
|
134057
|
+
installDependencies,
|
|
134058
|
+
verifyPackageIds,
|
|
134059
|
+
projectPath: input.projectPath,
|
|
134060
|
+
dependencyId: input.dependencyId
|
|
134061
|
+
});
|
|
134062
|
+
const resolvedAfterInstall = resolveFromKnownLocations(input.dependencyId, input.projectPath, installRoot);
|
|
134063
|
+
if (resolvedAfterInstall) return resolvedAfterInstall;
|
|
134064
|
+
const diagnostics = buildDiagnostics({
|
|
134065
|
+
integration: input.integration,
|
|
134066
|
+
dependencyId: input.dependencyId,
|
|
134067
|
+
projectPath: input.projectPath,
|
|
134068
|
+
installRoot,
|
|
134069
|
+
installDependencies,
|
|
134070
|
+
verifyPackageIds
|
|
134071
|
+
});
|
|
134072
|
+
throw new Error(`[${input.integration}] ${input.dependencyId} could not be resolved after optional dependency installation.\n` + JSON.stringify(diagnostics, null, 2));
|
|
134073
|
+
}
|
|
134074
|
+
async function ensureOptionalModuleLoaded(input) {
|
|
134075
|
+
const resolvedPath = await ensureOptionalPackageResolved(input);
|
|
134076
|
+
const candidateBases = getResolutionBases(input.projectPath);
|
|
134077
|
+
let loaded;
|
|
134078
|
+
let didLoad = false;
|
|
134079
|
+
let lastLoadError;
|
|
134080
|
+
for (const basePath of candidateBases){
|
|
134081
|
+
const req = (0, module__rspack_import_2.createRequire)(packageJsonPath(basePath));
|
|
134082
|
+
const candidateModuleIds = [
|
|
134083
|
+
input.dependencyId,
|
|
134084
|
+
resolvedPath
|
|
134085
|
+
];
|
|
134086
|
+
for (const candidateModuleId of candidateModuleIds)try {
|
|
134087
|
+
loaded = req(candidateModuleId);
|
|
134088
|
+
didLoad = true;
|
|
134089
|
+
break;
|
|
134090
|
+
} catch (error) {
|
|
134091
|
+
lastLoadError = error;
|
|
134092
|
+
}
|
|
134093
|
+
if (didLoad) break;
|
|
134094
|
+
}
|
|
134095
|
+
if (!didLoad) try {
|
|
134096
|
+
loaded = require(resolvedPath);
|
|
134097
|
+
didLoad = true;
|
|
134098
|
+
} catch (directRequireError) {
|
|
134099
|
+
lastLoadError = directRequireError;
|
|
134100
|
+
}
|
|
134101
|
+
if (!didLoad) {
|
|
134102
|
+
const diagnostics = {
|
|
134103
|
+
...buildDiagnostics({
|
|
134104
|
+
integration: input.integration,
|
|
134105
|
+
dependencyId: input.dependencyId,
|
|
134106
|
+
projectPath: input.projectPath,
|
|
134107
|
+
installRoot: (0, _plugin_css_css_lib_integrations__rspack_import_3.He)(),
|
|
134108
|
+
installDependencies: input.installDependencies || [
|
|
134109
|
+
input.dependencyId
|
|
134110
|
+
],
|
|
134111
|
+
verifyPackageIds: input.verifyPackageIds || input.installDependencies || [
|
|
134112
|
+
input.dependencyId
|
|
134113
|
+
]
|
|
134114
|
+
}),
|
|
134115
|
+
resolvedPath,
|
|
134116
|
+
loadError: lastLoadError instanceof Error ? lastLoadError.message : String(lastLoadError)
|
|
134117
|
+
};
|
|
134118
|
+
throw new Error(`[${input.integration}] ${input.dependencyId} could not be loaded after it resolved.\n` + JSON.stringify(diagnostics, null, 2));
|
|
134119
|
+
}
|
|
134120
|
+
return input.moduleAdapter ? input.moduleAdapter(loaded) : loaded;
|
|
134121
|
+
}
|
|
134122
|
+
},
|
|
134041
134123
|
"./webpack/webpack-lib/package-json.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
134042
134124
|
"use strict";
|
|
134043
134125
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -134706,7 +134788,7 @@ var __webpack_modules__ = {
|
|
|
134706
134788
|
},
|
|
134707
134789
|
"./package.json" (module) {
|
|
134708
134790
|
"use strict";
|
|
134709
|
-
module.exports = JSON.parse('{"rE":"3.8.
|
|
134791
|
+
module.exports = JSON.parse('{"rE":"3.8.3","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"}}');
|
|
134710
134792
|
}
|
|
134711
134793
|
};
|
|
134712
134794
|
var __webpack_module_cache__ = {};
|
package/package.json
CHANGED