extension-develop 3.7.0-canary.176.bcbd3c2 → 3.7.0-canary.178.ff75286
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 +182 -91
- package/package.json +1 -1
package/dist/module.cjs
CHANGED
|
@@ -131446,12 +131446,14 @@ var __webpack_modules__ = {
|
|
|
131446
131446
|
});
|
|
131447
131447
|
var path__rspack_import_0 = __webpack_require__("path");
|
|
131448
131448
|
var fs__rspack_import_1 = __webpack_require__("fs");
|
|
131449
|
-
var
|
|
131450
|
-
var
|
|
131451
|
-
var
|
|
131452
|
-
var
|
|
131453
|
-
var
|
|
131454
|
-
var
|
|
131449
|
+
var module__rspack_import_2 = __webpack_require__("module");
|
|
131450
|
+
var _messages__rspack_import_3 = __webpack_require__("./webpack/plugin-css/css-lib/messages.ts");
|
|
131451
|
+
var pintor__rspack_import_4 = __webpack_require__("pintor");
|
|
131452
|
+
var pintor__rspack_import_4_default = /*#__PURE__*/ __webpack_require__.n(pintor__rspack_import_4);
|
|
131453
|
+
var _webpack_lib_check_build_dependencies__rspack_import_5 = __webpack_require__("./webpack/webpack-lib/check-build-dependencies.ts");
|
|
131454
|
+
var _webpack_lib_package_manager__rspack_import_6 = __webpack_require__("./webpack/webpack-lib/package-manager.ts");
|
|
131455
|
+
var _webpack_lib_progress__rspack_import_7 = __webpack_require__("./webpack/webpack-lib/progress.ts");
|
|
131456
|
+
const runtimeRequire = (0, module__rspack_import_2.createRequire)(__rslib_import_meta_url__);
|
|
131455
131457
|
function parseJsonSafe(text) {
|
|
131456
131458
|
const s = text && 0xfeff === text.charCodeAt(0) ? text.slice(1) : text;
|
|
131457
131459
|
return JSON.parse(s || '{}');
|
|
@@ -131555,21 +131557,41 @@ var __webpack_modules__ = {
|
|
|
131555
131557
|
}
|
|
131556
131558
|
async function execInstallWithFallback(command, options) {
|
|
131557
131559
|
try {
|
|
131558
|
-
await (0,
|
|
131560
|
+
await (0, _webpack_lib_package_manager__rspack_import_6.Qt)(command.command, command.args, {
|
|
131559
131561
|
cwd: options.cwd,
|
|
131560
131562
|
stdio: 'inherit'
|
|
131561
131563
|
});
|
|
131562
131564
|
return;
|
|
131563
131565
|
} catch (error) {
|
|
131564
|
-
if (options.fallbackNpmCommand && isMissingManagerError(error)) return void await (0,
|
|
131566
|
+
if (options.fallbackNpmCommand && isMissingManagerError(error)) return void await (0, _webpack_lib_package_manager__rspack_import_6.Qt)(options.fallbackNpmCommand.command, options.fallbackNpmCommand.args, {
|
|
131565
131567
|
cwd: options.cwd,
|
|
131566
131568
|
stdio: 'inherit'
|
|
131567
131569
|
});
|
|
131568
131570
|
throw error;
|
|
131569
131571
|
}
|
|
131570
131572
|
}
|
|
131573
|
+
function canResolveFromInstallRoot(dependency, installBaseDir) {
|
|
131574
|
+
try {
|
|
131575
|
+
const req = (0, module__rspack_import_2.createRequire)(path__rspack_import_0.join(installBaseDir, 'package.json'));
|
|
131576
|
+
req.resolve(dependency);
|
|
131577
|
+
return true;
|
|
131578
|
+
} catch {}
|
|
131579
|
+
try {
|
|
131580
|
+
runtimeRequire.resolve(dependency, {
|
|
131581
|
+
paths: [
|
|
131582
|
+
installBaseDir
|
|
131583
|
+
]
|
|
131584
|
+
});
|
|
131585
|
+
return true;
|
|
131586
|
+
} catch {
|
|
131587
|
+
return false;
|
|
131588
|
+
}
|
|
131589
|
+
}
|
|
131590
|
+
function getUnresolvedDependencies(dependencies, installBaseDir) {
|
|
131591
|
+
return dependencies.filter((dependency)=>!canResolveFromInstallRoot(dependency, installBaseDir));
|
|
131592
|
+
}
|
|
131571
131593
|
function resolveDevelopInstallRoot() {
|
|
131572
|
-
const directRoot = (0,
|
|
131594
|
+
const directRoot = (0, _webpack_lib_check_build_dependencies__rspack_import_5.w1)();
|
|
131573
131595
|
if (directRoot) return directRoot;
|
|
131574
131596
|
try {
|
|
131575
131597
|
const candidateRoot = findDevelopRootFrom(__dirname);
|
|
@@ -131588,7 +131610,7 @@ var __webpack_modules__ = {
|
|
|
131588
131610
|
}
|
|
131589
131611
|
function getOptionalInstallCommand(pm, dependencies, installBaseDir) {
|
|
131590
131612
|
const pmName = pm.name;
|
|
131591
|
-
if ('yarn' === pmName) return (0,
|
|
131613
|
+
if ('yarn' === pmName) return (0, _webpack_lib_package_manager__rspack_import_6.tj)(pm, [
|
|
131592
131614
|
'--silent',
|
|
131593
131615
|
'add',
|
|
131594
131616
|
...dependencies,
|
|
@@ -131596,7 +131618,7 @@ var __webpack_modules__ = {
|
|
|
131596
131618
|
installBaseDir,
|
|
131597
131619
|
'--optional'
|
|
131598
131620
|
]);
|
|
131599
|
-
if ('npm' === pmName) return (0,
|
|
131621
|
+
if ('npm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_6.tj)(pm, [
|
|
131600
131622
|
'--silent',
|
|
131601
131623
|
'install',
|
|
131602
131624
|
...dependencies,
|
|
@@ -131604,7 +131626,7 @@ var __webpack_modules__ = {
|
|
|
131604
131626
|
installBaseDir,
|
|
131605
131627
|
'--save-optional'
|
|
131606
131628
|
]);
|
|
131607
|
-
if ('pnpm' === pmName) return (0,
|
|
131629
|
+
if ('pnpm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_6.tj)(pm, [
|
|
131608
131630
|
'add',
|
|
131609
131631
|
...dependencies,
|
|
131610
131632
|
'--dir',
|
|
@@ -131612,14 +131634,14 @@ var __webpack_modules__ = {
|
|
|
131612
131634
|
'--save-optional',
|
|
131613
131635
|
'--silent'
|
|
131614
131636
|
]);
|
|
131615
|
-
if ('bun' === pmName) return (0,
|
|
131637
|
+
if ('bun' === pmName) return (0, _webpack_lib_package_manager__rspack_import_6.tj)(pm, [
|
|
131616
131638
|
'add',
|
|
131617
131639
|
...dependencies,
|
|
131618
131640
|
'--cwd',
|
|
131619
131641
|
installBaseDir,
|
|
131620
131642
|
'--optional'
|
|
131621
131643
|
]);
|
|
131622
|
-
return (0,
|
|
131644
|
+
return (0, _webpack_lib_package_manager__rspack_import_6.tj)(pm, [
|
|
131623
131645
|
'--silent',
|
|
131624
131646
|
'install',
|
|
131625
131647
|
...dependencies,
|
|
@@ -131643,26 +131665,26 @@ var __webpack_modules__ = {
|
|
|
131643
131665
|
'--prefix',
|
|
131644
131666
|
installBaseDir
|
|
131645
131667
|
] : [];
|
|
131646
|
-
if ('yarn' === pmName) return (0,
|
|
131668
|
+
if ('yarn' === pmName) return (0, _webpack_lib_package_manager__rspack_import_6.tj)(pm, [
|
|
131647
131669
|
'install',
|
|
131648
131670
|
'--silent',
|
|
131649
131671
|
...dirArgs
|
|
131650
131672
|
]);
|
|
131651
|
-
if ('npm' === pmName) return (0,
|
|
131673
|
+
if ('npm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_6.tj)(pm, [
|
|
131652
131674
|
'install',
|
|
131653
131675
|
'--silent',
|
|
131654
131676
|
...dirArgs
|
|
131655
131677
|
]);
|
|
131656
|
-
if ('pnpm' === pmName) return (0,
|
|
131678
|
+
if ('pnpm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_6.tj)(pm, [
|
|
131657
131679
|
'install',
|
|
131658
131680
|
'--silent',
|
|
131659
131681
|
...dirArgs
|
|
131660
131682
|
]);
|
|
131661
|
-
if ('bun' === pmName) return (0,
|
|
131683
|
+
if ('bun' === pmName) return (0, _webpack_lib_package_manager__rspack_import_6.tj)(pm, [
|
|
131662
131684
|
'install',
|
|
131663
131685
|
...dirArgs
|
|
131664
131686
|
]);
|
|
131665
|
-
return (0,
|
|
131687
|
+
return (0, _webpack_lib_package_manager__rspack_import_6.tj)(pm, [
|
|
131666
131688
|
'install',
|
|
131667
131689
|
'--silent',
|
|
131668
131690
|
...dirArgs
|
|
@@ -131675,21 +131697,21 @@ var __webpack_modules__ = {
|
|
|
131675
131697
|
let installBaseDir;
|
|
131676
131698
|
try {
|
|
131677
131699
|
installBaseDir = resolveDevelopInstallRoot();
|
|
131678
|
-
if (!installBaseDir) throw new Error(
|
|
131679
|
-
pm = (0,
|
|
131700
|
+
if (!installBaseDir) throw new Error(_messages__rspack_import_3.eG(integration));
|
|
131701
|
+
pm = (0, _webpack_lib_package_manager__rspack_import_6._c)({
|
|
131680
131702
|
cwd: installBaseDir
|
|
131681
131703
|
});
|
|
131682
131704
|
wslContext = resolveWslContext(installBaseDir);
|
|
131683
131705
|
if (!wslContext.useWsl) pm = await preferCorepackFallback(pm);
|
|
131684
131706
|
const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
|
|
131685
|
-
const setupMessages =
|
|
131707
|
+
const setupMessages = _messages__rspack_import_3._j([
|
|
131686
131708
|
integration
|
|
131687
131709
|
], integration, isAuthor);
|
|
131688
131710
|
const setupMessage = setupMessages[0];
|
|
131689
131711
|
const hasIndex = Boolean(options?.index && options?.total);
|
|
131690
131712
|
const setupMessageWithIndex = hasIndex ? setupMessage.replace('►►► ', `►►► [${options?.index}/${options?.total}] `) : setupMessage;
|
|
131691
|
-
const progressEnabled = !isAuthor && (0,
|
|
131692
|
-
const progress = (0,
|
|
131713
|
+
const progressEnabled = !isAuthor && (0, _webpack_lib_progress__rspack_import_7.u)();
|
|
131714
|
+
const progress = (0, _webpack_lib_progress__rspack_import_7.J)(setupMessageWithIndex, {
|
|
131693
131715
|
enabled: progressEnabled,
|
|
131694
131716
|
persistLabel: true
|
|
131695
131717
|
});
|
|
@@ -131701,7 +131723,7 @@ var __webpack_modules__ = {
|
|
|
131701
131723
|
dependency
|
|
131702
131724
|
], wslContext.installDir || installBaseDir);
|
|
131703
131725
|
const execCommand = wrapCommandForWsl(installCommand, wslContext);
|
|
131704
|
-
const fallbackNpmCommand = wslContext.useWsl ? void 0 : (0,
|
|
131726
|
+
const fallbackNpmCommand = wslContext.useWsl ? void 0 : (0, _webpack_lib_package_manager__rspack_import_6.sX)([
|
|
131705
131727
|
'--silent',
|
|
131706
131728
|
'install',
|
|
131707
131729
|
dependency,
|
|
@@ -131718,11 +131740,12 @@ var __webpack_modules__ = {
|
|
|
131718
131740
|
progress.stop();
|
|
131719
131741
|
}
|
|
131720
131742
|
await new Promise((resolve)=>setTimeout(resolve, 500));
|
|
131721
|
-
|
|
131722
|
-
|
|
131743
|
+
let unresolved = getUnresolvedDependencies(dependencies, installBaseDir);
|
|
131744
|
+
if (unresolved.length > 0 || isAuthor) {
|
|
131745
|
+
if (isAuthor) console.log(_messages__rspack_import_3.cr(integration));
|
|
131723
131746
|
const rootInstall = getRootInstallCommand(pm, wslContext.useWsl ? wslContext.installDir : void 0);
|
|
131724
131747
|
const rootCommand = wrapCommandForWsl(rootInstall, wslContext);
|
|
131725
|
-
const rootFallbackCommand = wslContext.useWsl ? void 0 : (0,
|
|
131748
|
+
const rootFallbackCommand = wslContext.useWsl ? void 0 : (0, _webpack_lib_package_manager__rspack_import_6.sX)([
|
|
131726
131749
|
'--silent',
|
|
131727
131750
|
'install',
|
|
131728
131751
|
'--prefix',
|
|
@@ -131732,8 +131755,10 @@ var __webpack_modules__ = {
|
|
|
131732
131755
|
cwd: wslContext.useWsl ? void 0 : installBaseDir,
|
|
131733
131756
|
fallbackNpmCommand: rootFallbackCommand
|
|
131734
131757
|
});
|
|
131735
|
-
|
|
131758
|
+
unresolved = getUnresolvedDependencies(dependencies, installBaseDir);
|
|
131736
131759
|
}
|
|
131760
|
+
if (unresolved.length > 0) throw new Error(_messages__rspack_import_3.Nf(integration, unresolved, installBaseDir));
|
|
131761
|
+
if (isAuthor) console.log(_messages__rspack_import_3.ys(integration));
|
|
131737
131762
|
return true;
|
|
131738
131763
|
} catch (error) {
|
|
131739
131764
|
console.error('[extension.js][optional-deps] debug', {
|
|
@@ -131753,14 +131778,14 @@ var __webpack_modules__ = {
|
|
|
131753
131778
|
pm
|
|
131754
131779
|
});
|
|
131755
131780
|
const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
|
|
131756
|
-
if (isMissingManagerError(error)) console.error(
|
|
131757
|
-
else console.error(
|
|
131781
|
+
if (isMissingManagerError(error)) console.error(_messages__rspack_import_3.Vo(integration));
|
|
131782
|
+
else console.error(_messages__rspack_import_3.DX(integration, error, isAuthor));
|
|
131758
131783
|
return false;
|
|
131759
131784
|
}
|
|
131760
131785
|
}
|
|
131761
131786
|
async function installOptionalDependenciesBatch(plans) {
|
|
131762
131787
|
if (!plans.length) return;
|
|
131763
|
-
console.log(`${
|
|
131788
|
+
console.log(`${pintor__rspack_import_4_default().gray('►►►')} Found ${pintor__rspack_import_4_default().yellow(String(plans.length))} specialized integration${1 === plans.length ? '' : 's'} needing installation...`);
|
|
131764
131789
|
for (const [index, plan] of plans.entries()){
|
|
131765
131790
|
const didInstall = await installOptionalDependencies(plan.integration, plan.dependencies, {
|
|
131766
131791
|
index: index + 1,
|
|
@@ -131824,6 +131849,7 @@ var __webpack_modules__ = {
|
|
|
131824
131849
|
__webpack_require__.d(__webpack_exports__, {
|
|
131825
131850
|
DX: ()=>optionalInstallFailed,
|
|
131826
131851
|
Jv: ()=>youAreAllSet,
|
|
131852
|
+
Nf: ()=>optionalInstallResolutionFailed,
|
|
131827
131853
|
Se: ()=>missingSassDependency,
|
|
131828
131854
|
Vo: ()=>optionalInstallManagerMissing,
|
|
131829
131855
|
_j: ()=>optionalToolingSetup,
|
|
@@ -131888,6 +131914,16 @@ var __webpack_modules__ = {
|
|
|
131888
131914
|
'If you are on WSL, run the CLI inside a WSL shell so PATH is consistent.'
|
|
131889
131915
|
].join('\n');
|
|
131890
131916
|
}
|
|
131917
|
+
function optionalInstallResolutionFailed(integration, unresolvedDependencies, installBaseDir) {
|
|
131918
|
+
const prefix = pintor__rspack_import_0_default().red('ERROR');
|
|
131919
|
+
const deps = unresolvedDependencies.map((dep)=>pintor__rspack_import_0_default().brightBlue(dep)).join(', ');
|
|
131920
|
+
return [
|
|
131921
|
+
`${prefix} [${integration}] Dependencies were installed but remain unresolved at runtime.`,
|
|
131922
|
+
`Unresolved: ${deps}`,
|
|
131923
|
+
`Install root: ${pintor__rspack_import_0_default().underline(installBaseDir)}`,
|
|
131924
|
+
'This usually indicates a package manager link state issue in the extension-develop runtime.'
|
|
131925
|
+
].join('\n');
|
|
131926
|
+
}
|
|
131891
131927
|
function missingSassDependency() {
|
|
131892
131928
|
const prefix = pintor__rspack_import_0_default().red('►►►');
|
|
131893
131929
|
return [
|
|
@@ -132504,6 +132540,7 @@ var __webpack_modules__ = {
|
|
|
132504
132540
|
"use strict";
|
|
132505
132541
|
__webpack_require__.d(__webpack_exports__, {
|
|
132506
132542
|
Dy: ()=>_plugin_css_css_lib_integrations__rspack_import_0.Dy,
|
|
132543
|
+
He: ()=>_plugin_css_css_lib_integrations__rspack_import_0.He,
|
|
132507
132544
|
qQ: ()=>isUsingJSFramework,
|
|
132508
132545
|
tm: ()=>_plugin_css_css_lib_integrations__rspack_import_0.tm,
|
|
132509
132546
|
ws: ()=>_plugin_css_css_lib_integrations__rspack_import_0.ws
|
|
@@ -132622,14 +132659,44 @@ var __webpack_modules__ = {
|
|
|
132622
132659
|
var _frameworks_lib_integrations__rspack_import_4 = __webpack_require__("./webpack/plugin-js-frameworks/frameworks-lib/integrations.ts");
|
|
132623
132660
|
let userMessageDelivered = false;
|
|
132624
132661
|
let cachedPreactRefreshPlugin;
|
|
132625
|
-
function
|
|
132626
|
-
|
|
132662
|
+
function getResolutionRequires(projectPath) {
|
|
132663
|
+
const requires = [];
|
|
132664
|
+
try {
|
|
132665
|
+
requires.push((0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(projectPath, 'package.json')));
|
|
132666
|
+
} catch {}
|
|
132667
|
+
try {
|
|
132668
|
+
const developRoot = (0, _frameworks_lib_integrations__rspack_import_4.He)();
|
|
132669
|
+
if (developRoot) requires.push((0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(developRoot, 'package.json')));
|
|
132670
|
+
} catch {}
|
|
132671
|
+
return requires;
|
|
132672
|
+
}
|
|
132673
|
+
function canResolveInAnyContext(projectPath, id) {
|
|
132627
132674
|
try {
|
|
132628
|
-
|
|
132629
|
-
|
|
132675
|
+
require.resolve(id);
|
|
132676
|
+
return true;
|
|
132677
|
+
} catch {}
|
|
132678
|
+
for (const req of getResolutionRequires(projectPath))try {
|
|
132679
|
+
req.resolve(id);
|
|
132680
|
+
return true;
|
|
132681
|
+
} catch {}
|
|
132682
|
+
return false;
|
|
132683
|
+
}
|
|
132684
|
+
function loadModuleInAnyContext(projectPath, id) {
|
|
132685
|
+
try {
|
|
132686
|
+
return require(id);
|
|
132687
|
+
} catch {}
|
|
132688
|
+
for (const req of getResolutionRequires(projectPath))try {
|
|
132689
|
+
return req(id);
|
|
132690
|
+
} catch {}
|
|
132691
|
+
}
|
|
132692
|
+
function getPreactRefreshPlugin(projectPath) {
|
|
132693
|
+
if (cachedPreactRefreshPlugin) return cachedPreactRefreshPlugin;
|
|
132694
|
+
const mod = loadModuleInAnyContext(projectPath, '@rspack/plugin-preact-refresh');
|
|
132695
|
+
const plugin = mod && mod.default || mod;
|
|
132696
|
+
if (plugin) {
|
|
132630
132697
|
cachedPreactRefreshPlugin = plugin;
|
|
132631
132698
|
return cachedPreactRefreshPlugin;
|
|
132632
|
-
}
|
|
132699
|
+
}
|
|
132633
132700
|
}
|
|
132634
132701
|
function isUsingPreact(projectPath) {
|
|
132635
132702
|
if ((0, _frameworks_lib_integrations__rspack_import_4.ws)(projectPath, 'preact')) {
|
|
@@ -132643,14 +132710,7 @@ var __webpack_modules__ = {
|
|
|
132643
132710
|
}
|
|
132644
132711
|
async function maybeUsePreact(projectPath) {
|
|
132645
132712
|
if (!isUsingPreact(projectPath)) return;
|
|
132646
|
-
const canResolvePreactRefresh = ()=>
|
|
132647
|
-
try {
|
|
132648
|
-
require.resolve('@rspack/plugin-preact-refresh');
|
|
132649
|
-
return true;
|
|
132650
|
-
} catch {
|
|
132651
|
-
return false;
|
|
132652
|
-
}
|
|
132653
|
-
};
|
|
132713
|
+
const canResolvePreactRefresh = ()=>canResolveInAnyContext(projectPath, '@rspack/plugin-preact-refresh');
|
|
132654
132714
|
if (!canResolvePreactRefresh()) {
|
|
132655
132715
|
const preactDependencies = [
|
|
132656
132716
|
'@prefresh/core',
|
|
@@ -132663,7 +132723,7 @@ var __webpack_modules__ = {
|
|
|
132663
132723
|
if (!canResolvePreactRefresh()) throw new Error('[Preact] Dependencies were installed, but @rspack/plugin-preact-refresh is still unavailable in this runtime.');
|
|
132664
132724
|
if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(_js_frameworks_lib_messages__rspack_import_3.Jv('Preact'));
|
|
132665
132725
|
}
|
|
132666
|
-
const PreactRefreshPlugin = getPreactRefreshPlugin();
|
|
132726
|
+
const PreactRefreshPlugin = getPreactRefreshPlugin(projectPath);
|
|
132667
132727
|
if (!PreactRefreshPlugin) throw new Error('[Preact] @rspack/plugin-preact-refresh is installed but its plugin could not be resolved.');
|
|
132668
132728
|
const preactPlugins = [
|
|
132669
132729
|
new PreactRefreshPlugin({})
|
|
@@ -132709,14 +132769,44 @@ var __webpack_modules__ = {
|
|
|
132709
132769
|
var _frameworks_lib_integrations__rspack_import_4 = __webpack_require__("./webpack/plugin-js-frameworks/frameworks-lib/integrations.ts");
|
|
132710
132770
|
let userMessageDelivered = false;
|
|
132711
132771
|
let cachedReactRefreshPlugin;
|
|
132712
|
-
function
|
|
132713
|
-
|
|
132772
|
+
function getResolutionRequires(projectPath) {
|
|
132773
|
+
const requires = [];
|
|
132774
|
+
try {
|
|
132775
|
+
requires.push((0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(projectPath, 'package.json')));
|
|
132776
|
+
} catch {}
|
|
132777
|
+
try {
|
|
132778
|
+
const developRoot = (0, _frameworks_lib_integrations__rspack_import_4.He)();
|
|
132779
|
+
if (developRoot) requires.push((0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(developRoot, 'package.json')));
|
|
132780
|
+
} catch {}
|
|
132781
|
+
return requires;
|
|
132782
|
+
}
|
|
132783
|
+
function canResolveInAnyContext(projectPath, id) {
|
|
132714
132784
|
try {
|
|
132715
|
-
|
|
132716
|
-
|
|
132785
|
+
require.resolve(id);
|
|
132786
|
+
return true;
|
|
132787
|
+
} catch {}
|
|
132788
|
+
for (const req of getResolutionRequires(projectPath))try {
|
|
132789
|
+
req.resolve(id);
|
|
132790
|
+
return true;
|
|
132791
|
+
} catch {}
|
|
132792
|
+
return false;
|
|
132793
|
+
}
|
|
132794
|
+
function loadModuleInAnyContext(projectPath, id) {
|
|
132795
|
+
try {
|
|
132796
|
+
return require(id);
|
|
132797
|
+
} catch {}
|
|
132798
|
+
for (const req of getResolutionRequires(projectPath))try {
|
|
132799
|
+
return req(id);
|
|
132800
|
+
} catch {}
|
|
132801
|
+
}
|
|
132802
|
+
function getReactRefreshPlugin(projectPath) {
|
|
132803
|
+
if (cachedReactRefreshPlugin) return cachedReactRefreshPlugin;
|
|
132804
|
+
const mod = loadModuleInAnyContext(projectPath, '@rspack/plugin-react-refresh');
|
|
132805
|
+
const plugin = mod && mod.default || mod;
|
|
132806
|
+
if (plugin) {
|
|
132717
132807
|
cachedReactRefreshPlugin = plugin;
|
|
132718
132808
|
return cachedReactRefreshPlugin;
|
|
132719
|
-
}
|
|
132809
|
+
}
|
|
132720
132810
|
}
|
|
132721
132811
|
function isUsingReact(projectPath) {
|
|
132722
132812
|
if ((0, _frameworks_lib_integrations__rspack_import_4.ws)(projectPath, 'react')) {
|
|
@@ -132730,14 +132820,7 @@ var __webpack_modules__ = {
|
|
|
132730
132820
|
}
|
|
132731
132821
|
async function maybeUseReact(projectPath) {
|
|
132732
132822
|
if (!isUsingReact(projectPath)) return;
|
|
132733
|
-
const canResolveReactRefresh = ()=>
|
|
132734
|
-
try {
|
|
132735
|
-
require.resolve('react-refresh');
|
|
132736
|
-
return true;
|
|
132737
|
-
} catch {
|
|
132738
|
-
return false;
|
|
132739
|
-
}
|
|
132740
|
-
};
|
|
132823
|
+
const canResolveReactRefresh = ()=>canResolveInAnyContext(projectPath, 'react-refresh');
|
|
132741
132824
|
if (!canResolveReactRefresh()) {
|
|
132742
132825
|
const reactDependencies = [
|
|
132743
132826
|
'react-refresh',
|
|
@@ -132748,7 +132831,7 @@ var __webpack_modules__ = {
|
|
|
132748
132831
|
if (!canResolveReactRefresh()) throw new Error('[React] Dependencies were installed, but react-refresh is still unavailable in this runtime.');
|
|
132749
132832
|
if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(_js_frameworks_lib_messages__rspack_import_3.Jv('React'));
|
|
132750
132833
|
}
|
|
132751
|
-
const ReactRefreshPlugin = getReactRefreshPlugin();
|
|
132834
|
+
const ReactRefreshPlugin = getReactRefreshPlugin(projectPath);
|
|
132752
132835
|
if (!ReactRefreshPlugin) throw new Error('[React] @rspack/plugin-react-refresh is installed but its plugin could not be resolved.');
|
|
132753
132836
|
const reactPlugins = [
|
|
132754
132837
|
new ReactRefreshPlugin({
|
|
@@ -133083,16 +133166,41 @@ var __webpack_modules__ = {
|
|
|
133083
133166
|
var _js_frameworks_lib_load_loader_options__rspack_import_6 = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/load-loader-options.ts");
|
|
133084
133167
|
let userMessageDelivered = false;
|
|
133085
133168
|
let cachedVueLoaderPlugin;
|
|
133086
|
-
function
|
|
133087
|
-
|
|
133169
|
+
function getResolutionRequires(projectPath) {
|
|
133170
|
+
const requires = [];
|
|
133088
133171
|
try {
|
|
133089
|
-
|
|
133090
|
-
const plugin = mod && mod.VueLoaderPlugin || mod && mod.default && mod.default.VueLoaderPlugin;
|
|
133091
|
-
if (plugin) {
|
|
133092
|
-
cachedVueLoaderPlugin = plugin;
|
|
133093
|
-
return cachedVueLoaderPlugin;
|
|
133094
|
-
}
|
|
133172
|
+
requires.push((0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(projectPath, 'package.json')));
|
|
133095
133173
|
} catch {}
|
|
133174
|
+
try {
|
|
133175
|
+
const developRoot = (0, _frameworks_lib_integrations__rspack_import_5.He)();
|
|
133176
|
+
if (developRoot) requires.push((0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(developRoot, 'package.json')));
|
|
133177
|
+
} catch {}
|
|
133178
|
+
return requires;
|
|
133179
|
+
}
|
|
133180
|
+
function resolveInAnyContext(projectPath, id) {
|
|
133181
|
+
try {
|
|
133182
|
+
return require.resolve(id);
|
|
133183
|
+
} catch {}
|
|
133184
|
+
for (const req of getResolutionRequires(projectPath))try {
|
|
133185
|
+
return req.resolve(id);
|
|
133186
|
+
} catch {}
|
|
133187
|
+
}
|
|
133188
|
+
function loadModuleInAnyContext(projectPath, id) {
|
|
133189
|
+
try {
|
|
133190
|
+
return require(id);
|
|
133191
|
+
} catch {}
|
|
133192
|
+
for (const req of getResolutionRequires(projectPath))try {
|
|
133193
|
+
return req(id);
|
|
133194
|
+
} catch {}
|
|
133195
|
+
}
|
|
133196
|
+
function getVueLoaderPlugin(projectPath) {
|
|
133197
|
+
if (cachedVueLoaderPlugin) return cachedVueLoaderPlugin;
|
|
133198
|
+
const mod = loadModuleInAnyContext(projectPath, 'vue-loader');
|
|
133199
|
+
const plugin = mod && mod.VueLoaderPlugin || mod && mod.default && mod.default.VueLoaderPlugin;
|
|
133200
|
+
if (plugin) {
|
|
133201
|
+
cachedVueLoaderPlugin = plugin;
|
|
133202
|
+
return cachedVueLoaderPlugin;
|
|
133203
|
+
}
|
|
133096
133204
|
}
|
|
133097
133205
|
function isUsingVue(projectPath) {
|
|
133098
133206
|
const using = (0, _frameworks_lib_integrations__rspack_import_5.ws)(projectPath, 'vue');
|
|
@@ -133104,14 +133212,7 @@ var __webpack_modules__ = {
|
|
|
133104
133212
|
}
|
|
133105
133213
|
async function maybeUseVue(projectPath, mode = 'development') {
|
|
133106
133214
|
if (!isUsingVue(projectPath)) return;
|
|
133107
|
-
const canResolveVueLoader = ()=>
|
|
133108
|
-
try {
|
|
133109
|
-
require.resolve('vue-loader');
|
|
133110
|
-
return true;
|
|
133111
|
-
} catch {
|
|
133112
|
-
return false;
|
|
133113
|
-
}
|
|
133114
|
-
};
|
|
133215
|
+
const canResolveVueLoader = ()=>Boolean(resolveInAnyContext(projectPath, 'vue-loader'));
|
|
133115
133216
|
if (!canResolveVueLoader()) {
|
|
133116
133217
|
const vueDependencies = [
|
|
133117
133218
|
'vue-loader',
|
|
@@ -133122,13 +133223,15 @@ var __webpack_modules__ = {
|
|
|
133122
133223
|
if (!canResolveVueLoader()) throw new Error('[Vue] Dependencies were installed, but vue-loader is still unavailable in this runtime.');
|
|
133123
133224
|
if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(_js_frameworks_lib_messages__rspack_import_4.Jv('Vue'));
|
|
133124
133225
|
}
|
|
133125
|
-
const VueLoaderPlugin = getVueLoaderPlugin();
|
|
133226
|
+
const VueLoaderPlugin = getVueLoaderPlugin(projectPath);
|
|
133126
133227
|
if (!VueLoaderPlugin) throw new Error('[Vue] vue-loader is installed but VueLoaderPlugin could not be resolved.');
|
|
133127
133228
|
const customOptions = await (0, _js_frameworks_lib_load_loader_options__rspack_import_6.g)(projectPath, 'vue');
|
|
133229
|
+
const vueLoaderPath = resolveInAnyContext(projectPath, 'vue-loader');
|
|
133230
|
+
if (!vueLoaderPath) throw new Error('[Vue] vue-loader is installed but its loader path could not be resolved.');
|
|
133128
133231
|
const defaultLoaders = [
|
|
133129
133232
|
{
|
|
133130
133233
|
test: /\.vue$/,
|
|
133131
|
-
loader:
|
|
133234
|
+
loader: vueLoaderPath,
|
|
133132
133235
|
options: {
|
|
133133
133236
|
experimentalInlineMatchResource: true,
|
|
133134
133237
|
...customOptions || {}
|
|
@@ -134515,14 +134618,6 @@ var __webpack_modules__ = {
|
|
|
134515
134618
|
"use strict";
|
|
134516
134619
|
module.exports = require("@rspack/dev-server");
|
|
134517
134620
|
},
|
|
134518
|
-
"@rspack/plugin-preact-refresh" (module) {
|
|
134519
|
-
"use strict";
|
|
134520
|
-
module.exports = require("@rspack/plugin-preact-refresh");
|
|
134521
|
-
},
|
|
134522
|
-
"@rspack/plugin-react-refresh" (module) {
|
|
134523
|
-
"use strict";
|
|
134524
|
-
module.exports = require("@rspack/plugin-react-refresh");
|
|
134525
|
-
},
|
|
134526
134621
|
"adm-zip" (module) {
|
|
134527
134622
|
"use strict";
|
|
134528
134623
|
module.exports = require("adm-zip");
|
|
@@ -134627,10 +134722,6 @@ var __webpack_modules__ = {
|
|
|
134627
134722
|
"use strict";
|
|
134628
134723
|
module.exports = require("util");
|
|
134629
134724
|
},
|
|
134630
|
-
"vue-loader" (module) {
|
|
134631
|
-
"use strict";
|
|
134632
|
-
module.exports = require("vue-loader");
|
|
134633
|
-
},
|
|
134634
134725
|
"webpack-merge" (module) {
|
|
134635
134726
|
"use strict";
|
|
134636
134727
|
module.exports = require("webpack-merge");
|
|
@@ -134641,7 +134732,7 @@ var __webpack_modules__ = {
|
|
|
134641
134732
|
},
|
|
134642
134733
|
"./package.json" (module) {
|
|
134643
134734
|
"use strict";
|
|
134644
|
-
module.exports = JSON.parse('{"rE":"3.7.0-canary.
|
|
134735
|
+
module.exports = JSON.parse('{"rE":"3.7.0-canary.178.ff75286","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"}}');
|
|
134645
134736
|
}
|
|
134646
134737
|
};
|
|
134647
134738
|
var __webpack_module_cache__ = {};
|
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"webpack/webpack-lib/build-dependencies.json"
|
|
25
25
|
],
|
|
26
26
|
"name": "extension-develop",
|
|
27
|
-
"version": "3.7.0-canary.
|
|
27
|
+
"version": "3.7.0-canary.178.ff75286",
|
|
28
28
|
"description": "Develop, build, preview, and package Extension.js projects.",
|
|
29
29
|
"author": {
|
|
30
30
|
"name": "Cezar Augusto",
|