extension-develop 3.3.0 → 3.3.2
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.js +54 -4
- package/package.json +1 -1
package/dist/module.js
CHANGED
|
@@ -130608,6 +130608,25 @@ var __webpack_modules__ = {
|
|
|
130608
130608
|
const s = text && 0xfeff === text.charCodeAt(0) ? text.slice(1) : text;
|
|
130609
130609
|
return JSON.parse(s || '{}');
|
|
130610
130610
|
}
|
|
130611
|
+
function resolveDevelopRootFromDir(dir) {
|
|
130612
|
+
try {
|
|
130613
|
+
const packageJsonPath = path__rspack_import_0.join(dir, 'package.json');
|
|
130614
|
+
if (!fs__rspack_import_1.existsSync(packageJsonPath)) return;
|
|
130615
|
+
const pkg = parseJsonSafe(fs__rspack_import_1.readFileSync(packageJsonPath, 'utf8'));
|
|
130616
|
+
if (pkg?.name === 'extension-develop') return dir;
|
|
130617
|
+
} catch {}
|
|
130618
|
+
}
|
|
130619
|
+
function findDevelopRootFrom(startDir) {
|
|
130620
|
+
let currentDir = startDir;
|
|
130621
|
+
const maxDepth = 6;
|
|
130622
|
+
for(let i = 0; i < maxDepth; i++){
|
|
130623
|
+
const root = resolveDevelopRootFromDir(currentDir);
|
|
130624
|
+
if (root) return root;
|
|
130625
|
+
const parent = path__rspack_import_0.dirname(currentDir);
|
|
130626
|
+
if (parent === currentDir) break;
|
|
130627
|
+
currentDir = parent;
|
|
130628
|
+
}
|
|
130629
|
+
}
|
|
130611
130630
|
function isFromPnpx() {
|
|
130612
130631
|
if (process.env.npm_config_user_agent?.includes('pnpm')) return 'pnpm';
|
|
130613
130632
|
return false;
|
|
@@ -130637,6 +130656,24 @@ var __webpack_modules__ = {
|
|
|
130637
130656
|
if (envPm) return envPm;
|
|
130638
130657
|
return 'npm';
|
|
130639
130658
|
}
|
|
130659
|
+
function resolveDevelopInstallRoot() {
|
|
130660
|
+
const directRoot = (0, _webpack_lib_check_build_dependencies__rspack_import_4.w1)();
|
|
130661
|
+
if (directRoot) return directRoot;
|
|
130662
|
+
try {
|
|
130663
|
+
const candidateRoot = findDevelopRootFrom(__dirname);
|
|
130664
|
+
if (candidateRoot) return candidateRoot;
|
|
130665
|
+
} catch {}
|
|
130666
|
+
try {
|
|
130667
|
+
const pkgPath = require.resolve('extension-develop/package.json', {
|
|
130668
|
+
paths: [
|
|
130669
|
+
__dirname
|
|
130670
|
+
]
|
|
130671
|
+
});
|
|
130672
|
+
return resolveDevelopRootFromDir(path__rspack_import_0.dirname(pkgPath));
|
|
130673
|
+
} catch {
|
|
130674
|
+
return;
|
|
130675
|
+
}
|
|
130676
|
+
}
|
|
130640
130677
|
function getOptionalInstallCommand(pm, dependencies, installBaseDir) {
|
|
130641
130678
|
const pmName = pm;
|
|
130642
130679
|
if ('yarn' === pmName) return {
|
|
@@ -130720,7 +130757,8 @@ var __webpack_modules__ = {
|
|
|
130720
130757
|
if (!dependencies.length) return;
|
|
130721
130758
|
try {
|
|
130722
130759
|
const pm = await resolvePackageManager();
|
|
130723
|
-
const installBaseDir = (
|
|
130760
|
+
const installBaseDir = resolveDevelopInstallRoot();
|
|
130761
|
+
if (!installBaseDir) throw new Error(_messages__rspack_import_3.eG(integration));
|
|
130724
130762
|
const installCommand = getOptionalInstallCommand(pm, dependencies, installBaseDir);
|
|
130725
130763
|
const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
|
|
130726
130764
|
console.log(_messages__rspack_import_3._j([
|
|
@@ -130749,7 +130787,8 @@ var __webpack_modules__ = {
|
|
|
130749
130787
|
if (!dependencies.length) return;
|
|
130750
130788
|
try {
|
|
130751
130789
|
const pm = await resolvePackageManager();
|
|
130752
|
-
const installBaseDir = (
|
|
130790
|
+
const installBaseDir = resolveDevelopInstallRoot();
|
|
130791
|
+
if (!installBaseDir) throw new Error(_messages__rspack_import_3.eG(integration));
|
|
130753
130792
|
const installCommand = getOptionalInstallCommand(pm, dependencies, installBaseDir);
|
|
130754
130793
|
const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
|
|
130755
130794
|
console.log(_messages__rspack_import_3._j(integrations, integration, isAuthor));
|
|
@@ -130824,6 +130863,7 @@ var __webpack_modules__ = {
|
|
|
130824
130863
|
Se: ()=>missingSassDependency,
|
|
130825
130864
|
_j: ()=>optionalToolingSetup,
|
|
130826
130865
|
cr: ()=>optionalToolingRootInstall,
|
|
130866
|
+
eG: ()=>optionalInstallRootMissing,
|
|
130827
130867
|
fD: ()=>cssConfigsDetected,
|
|
130828
130868
|
uo: ()=>cssIntegrationsEnabled,
|
|
130829
130869
|
ys: ()=>optionalToolingReady,
|
|
@@ -130860,6 +130900,14 @@ var __webpack_modules__ = {
|
|
|
130860
130900
|
const prefix = isAuthor ? pintor__rspack_import_0_default().brightMagenta('ERROR Author says') : pintor__rspack_import_0_default().red('ERROR');
|
|
130861
130901
|
return `${prefix} [${integration}] Failed to install dependencies.\n${pintor__rspack_import_0_default().red(String(error?.message || error))}`;
|
|
130862
130902
|
}
|
|
130903
|
+
function optionalInstallRootMissing(integration) {
|
|
130904
|
+
const prefix = pintor__rspack_import_0_default().red('ERROR');
|
|
130905
|
+
return [
|
|
130906
|
+
`${prefix} [${integration}] Failed to locate the extension-develop runtime.`,
|
|
130907
|
+
'Optional tooling must install into the extension-develop package, not the user project.',
|
|
130908
|
+
'Reinstall Extension.js or run the command from a valid Extension.js installation.'
|
|
130909
|
+
].join('\n');
|
|
130910
|
+
}
|
|
130863
130911
|
function missingSassDependency() {
|
|
130864
130912
|
const prefix = pintor__rspack_import_0_default().red('►►►');
|
|
130865
130913
|
return [
|
|
@@ -132753,7 +132801,7 @@ var __webpack_modules__ = {
|
|
|
132753
132801
|
},
|
|
132754
132802
|
"./package.json" (module) {
|
|
132755
132803
|
"use strict";
|
|
132756
|
-
module.exports = JSON.parse('{"rE":"3.3.
|
|
132804
|
+
module.exports = JSON.parse('{"rE":"3.3.2","El":{"@rspack/core":"^1.7.2","@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","firefox-location2":"3.0.0","go-git-it":"^5.0.3","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"}}');
|
|
132757
132805
|
}
|
|
132758
132806
|
};
|
|
132759
132807
|
var __webpack_module_cache__ = {};
|
|
@@ -133416,7 +133464,9 @@ var __webpack_exports__ = {};
|
|
|
133416
133464
|
usedIntegrations.push('Less');
|
|
133417
133465
|
}
|
|
133418
133466
|
}
|
|
133419
|
-
if (usesPostCss
|
|
133467
|
+
if (!usesPostCss || canResolve('postcss-loader', projectPath) || usesSass || usesLess) {
|
|
133468
|
+
if (usesPostCss) usedIntegrations.push('PostCSS');
|
|
133469
|
+
} else {
|
|
133420
133470
|
if (!canResolve('postcss', projectPath)) missingOptionalDeps.add('postcss');
|
|
133421
133471
|
missingOptionalDeps.add('postcss-loader');
|
|
133422
133472
|
usedIntegrations.push('PostCSS');
|