extension-develop 3.9.3 → 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 +83 -35
- 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() {
|
|
@@ -128867,6 +128907,7 @@ var __webpack_modules__ = {
|
|
|
128867
128907
|
f: ()=>ChromiumLaunchPlugin
|
|
128868
128908
|
});
|
|
128869
128909
|
var external_fs_ = __webpack_require__("fs");
|
|
128910
|
+
const external_node_child_process_namespaceObject = require("node:child_process");
|
|
128870
128911
|
var external_chrome_location2_ = __webpack_require__("chrome-location2");
|
|
128871
128912
|
var external_chrome_location2_default = /*#__PURE__*/ __webpack_require__.n(external_chrome_location2_);
|
|
128872
128913
|
var external_chromium_location_ = __webpack_require__("chromium-location");
|
|
@@ -129346,7 +129387,14 @@ var __webpack_modules__ = {
|
|
|
129346
129387
|
if ('chromium' === browser || 'chromium-based' === browser) return (0, external_chromium_location_.getChromiumVersion)(bin, {
|
|
129347
129388
|
allowExec: true
|
|
129348
129389
|
}) || '';
|
|
129349
|
-
|
|
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, {
|
|
129350
129398
|
allowExec: true
|
|
129351
129399
|
}) || '';
|
|
129352
129400
|
} catch {
|
|
@@ -135599,7 +135647,7 @@ var __webpack_modules__ = {
|
|
|
135599
135647
|
},
|
|
135600
135648
|
"./package.json" (module) {
|
|
135601
135649
|
"use strict";
|
|
135602
|
-
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"}}');
|
|
135603
135651
|
}
|
|
135604
135652
|
};
|
|
135605
135653
|
var __webpack_module_cache__ = {};
|
package/package.json
CHANGED