extension-develop 3.10.2 → 3.10.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/270.cjs +13 -0
- package/dist/module.cjs +109 -101
- package/package.json +1 -1
package/dist/270.cjs
CHANGED
|
@@ -2665,6 +2665,11 @@ exports.modules = {
|
|
|
2665
2665
|
function isCanonicalContentScriptCss(resource) {
|
|
2666
2666
|
return /^content_scripts\/content-\d+\.css$/.test(resource);
|
|
2667
2667
|
}
|
|
2668
|
+
function toCanonicalContentScriptCss(jsFile) {
|
|
2669
|
+
const normalized = String(jsFile || '');
|
|
2670
|
+
if (!/^content_scripts\/content-\d+\.js$/.test(normalized)) return;
|
|
2671
|
+
return normalized.replace(/\.js$/, '.css');
|
|
2672
|
+
}
|
|
2668
2673
|
function generateManifestPatches(compilation, manifestPath, entryImports, browser) {
|
|
2669
2674
|
const canonicalManifest = getManifestContent(compilation, manifestPath);
|
|
2670
2675
|
const resolved = resolveUserDeclaredWAR(compilation, manifestPath, canonicalManifest, browser);
|
|
@@ -2820,6 +2825,14 @@ exports.modules = {
|
|
|
2820
2825
|
if (3 === canonicalManifest.manifest_version) {
|
|
2821
2826
|
const assetKeys = Object.keys(compilation.assets || {});
|
|
2822
2827
|
const cssUnderContentScripts = assetKeys.filter((k)=>k.startsWith("content_scripts/")).filter((k)=>k.endsWith('.css')).sort();
|
|
2828
|
+
if (Array.isArray(canonicalManifest.content_scripts)) for (const contentScript of canonicalManifest.content_scripts){
|
|
2829
|
+
const jsFiles = Array.isArray(contentScript.js) ? contentScript.js : [];
|
|
2830
|
+
const canonicalCss = jsFiles.map(toCanonicalContentScriptCss).filter((resource)=>Boolean(resource && cssUnderContentScripts.includes(resource)));
|
|
2831
|
+
if (canonicalCss.length > 0) contentScript.css = Array.from(new Set([
|
|
2832
|
+
...contentScript.css || [],
|
|
2833
|
+
...canonicalCss
|
|
2834
|
+
])).sort();
|
|
2835
|
+
}
|
|
2823
2836
|
if (cssUnderContentScripts.length > 0) {
|
|
2824
2837
|
const allMatches = Array.from(new Set((canonicalManifest.content_scripts || []).flatMap((cs)=>cs.matches || [])));
|
|
2825
2838
|
const normalizedMatches = cleanMatches(allMatches);
|
package/dist/module.cjs
CHANGED
|
@@ -129002,46 +129002,18 @@ var __webpack_modules__ = {
|
|
|
129002
129002
|
if (!effectiveBrowserLine) try {
|
|
129003
129003
|
if ('chromium' === browser || 'chromium-based' === browser) {
|
|
129004
129004
|
const p = chromium_location__rspack_import_6_default()();
|
|
129005
|
-
if (p && 'string' == typeof p && fs__rspack_import_1.existsSync(p))
|
|
129006
|
-
const v = require1('child_process').execFileSync(p, [
|
|
129007
|
-
'--version'
|
|
129008
|
-
], {
|
|
129009
|
-
encoding: 'utf8'
|
|
129010
|
-
}).trim();
|
|
129011
|
-
effectiveBrowserLine = v || 'Chromium';
|
|
129012
|
-
}
|
|
129005
|
+
if (p && 'string' == typeof p && fs__rspack_import_1.existsSync(p)) effectiveBrowserLine = (0, chromium_location__rspack_import_6.getChromiumVersion)(p) || 'Chromium';
|
|
129013
129006
|
} else if ('chrome' === browser) {
|
|
129014
129007
|
const p = (0, chrome_location2__rspack_import_5.locateChromeOrExplain)({
|
|
129015
129008
|
allowFallback: true
|
|
129016
129009
|
});
|
|
129017
|
-
if (p && fs__rspack_import_1.existsSync(p))
|
|
129018
|
-
const v = require1('child_process').execFileSync(p, [
|
|
129019
|
-
'--version'
|
|
129020
|
-
], {
|
|
129021
|
-
encoding: 'utf8'
|
|
129022
|
-
}).trim();
|
|
129023
|
-
effectiveBrowserLine = v || 'Chrome';
|
|
129024
|
-
}
|
|
129010
|
+
if (p && fs__rspack_import_1.existsSync(p)) effectiveBrowserLine = (0, chrome_location2__rspack_import_5.getChromeVersion)(p) || 'Chrome';
|
|
129025
129011
|
} else if ('edge' === browser) {
|
|
129026
129012
|
const p = edge_location__rspack_import_7_default()();
|
|
129027
|
-
if (p && fs__rspack_import_1.existsSync(p))
|
|
129028
|
-
const v = require1('child_process').execFileSync(p, [
|
|
129029
|
-
'--version'
|
|
129030
|
-
], {
|
|
129031
|
-
encoding: 'utf8'
|
|
129032
|
-
}).trim();
|
|
129033
|
-
effectiveBrowserLine = v || 'Microsoft Edge';
|
|
129034
|
-
}
|
|
129013
|
+
if (p && fs__rspack_import_1.existsSync(p)) effectiveBrowserLine = (0, edge_location__rspack_import_7.getEdgeVersion)(p) || 'Microsoft Edge';
|
|
129035
129014
|
} else if ('firefox' === browser) {
|
|
129036
129015
|
const p = firefox_location2__rspack_import_8_default()(true);
|
|
129037
|
-
if (p && 'string' == typeof p && fs__rspack_import_1.existsSync(p))
|
|
129038
|
-
const v = require1('child_process').execFileSync(p, [
|
|
129039
|
-
'--version'
|
|
129040
|
-
], {
|
|
129041
|
-
encoding: 'utf8'
|
|
129042
|
-
}).trim();
|
|
129043
|
-
effectiveBrowserLine = v || 'Firefox';
|
|
129044
|
-
}
|
|
129016
|
+
if (p && 'string' == typeof p && fs__rspack_import_1.existsSync(p)) effectiveBrowserLine = (0, firefox_location2__rspack_import_8.getFirefoxVersion)(p) || 'Firefox';
|
|
129045
129017
|
}
|
|
129046
129018
|
} catch {}
|
|
129047
129019
|
let browserLabel = effectiveBrowserLine && effectiveBrowserLine.trim().length > 0 ? effectiveBrowserLine.trim() : capitalize(String(browser || 'unknown'));
|
|
@@ -129133,6 +129105,7 @@ var __webpack_modules__ = {
|
|
|
129133
129105
|
"./webpack/plugin-browsers/browsers-lib/output-binaries-resolver.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
129134
129106
|
"use strict";
|
|
129135
129107
|
__webpack_require__.d(__webpack_exports__, {
|
|
129108
|
+
$4: ()=>managedBrowserCacheEnv,
|
|
129136
129109
|
LB: ()=>computeBinariesBaseDir,
|
|
129137
129110
|
kI: ()=>resolveFromBinaries
|
|
129138
129111
|
});
|
|
@@ -129184,6 +129157,22 @@ var __webpack_modules__ = {
|
|
|
129184
129157
|
}
|
|
129185
129158
|
return path__rspack_import_1.resolve(process.cwd(), 'dist', 'extension-js', 'binaries');
|
|
129186
129159
|
}
|
|
129160
|
+
function managedBrowserCacheEnv(cacheRoot, browser) {
|
|
129161
|
+
const root = String(cacheRoot || '').trim();
|
|
129162
|
+
if (!root) return {};
|
|
129163
|
+
if ('chrome' === browser) return {
|
|
129164
|
+
PUPPETEER_CACHE_DIR: path__rspack_import_1.join(root, 'chrome', 'chrome')
|
|
129165
|
+
};
|
|
129166
|
+
if ('chromium' === browser || 'chromium-based' === browser) return {
|
|
129167
|
+
PUPPETEER_CACHE_DIR: path__rspack_import_1.join(root, 'chromium', 'chromium')
|
|
129168
|
+
};
|
|
129169
|
+
if ('firefox' === browser || 'gecko-based' === browser || 'firefox-based' === browser) return {
|
|
129170
|
+
PUPPETEER_CACHE_DIR: path__rspack_import_1.join(root, 'firefox', 'firefox')
|
|
129171
|
+
};
|
|
129172
|
+
return {
|
|
129173
|
+
PLAYWRIGHT_BROWSERS_PATH: path__rspack_import_1.join(root, 'edge')
|
|
129174
|
+
};
|
|
129175
|
+
}
|
|
129187
129176
|
function resolveFromBinaries(compilation, browser) {
|
|
129188
129177
|
const base = computeBinariesBaseDir(compilation);
|
|
129189
129178
|
const browserBase = path__rspack_import_1.join(base, browser);
|
|
@@ -129524,7 +129513,6 @@ var __webpack_modules__ = {
|
|
|
129524
129513
|
f: ()=>ChromiumLaunchPlugin
|
|
129525
129514
|
});
|
|
129526
129515
|
var external_fs_ = __webpack_require__("fs");
|
|
129527
|
-
const external_node_child_process_namespaceObject = require("node:child_process");
|
|
129528
129516
|
var external_chrome_location2_ = __webpack_require__("chrome-location2");
|
|
129529
129517
|
var external_chrome_location2_default = /*#__PURE__*/ __webpack_require__.n(external_chrome_location2_);
|
|
129530
129518
|
var external_chromium_location_ = __webpack_require__("chromium-location");
|
|
@@ -129998,27 +129986,22 @@ var __webpack_modules__ = {
|
|
|
129998
129986
|
}
|
|
129999
129987
|
const getBrowserVersionLine = (bin)=>{
|
|
130000
129988
|
try {
|
|
130001
|
-
if ('edge' === browser) return (0, external_edge_location_.getEdgeVersion)(bin
|
|
130002
|
-
|
|
130003
|
-
|
|
130004
|
-
if ('chromium' === browser || 'chromium-based' === browser) return (0, external_chromium_location_.getChromiumVersion)(bin, {
|
|
130005
|
-
allowExec: true
|
|
130006
|
-
}) || '';
|
|
130007
|
-
const versionResult = (0, external_node_child_process_namespaceObject.spawnSync)(bin, [
|
|
130008
|
-
'--version'
|
|
130009
|
-
], {
|
|
130010
|
-
stdio: 'pipe',
|
|
130011
|
-
encoding: 'utf8'
|
|
130012
|
-
});
|
|
130013
|
-
const versionLine = String(versionResult.stdout || '').trim();
|
|
130014
|
-
return versionLine || (0, external_chrome_location2_.getChromeVersion)(bin, {
|
|
130015
|
-
allowExec: true
|
|
130016
|
-
}) || '';
|
|
129989
|
+
if ('edge' === browser) return (0, external_edge_location_.getEdgeVersion)(bin) || '';
|
|
129990
|
+
if ('chromium' === browser || 'chromium-based' === browser) return (0, external_chromium_location_.getChromiumVersion)(bin) || '';
|
|
129991
|
+
return (0, external_chrome_location2_.getChromeVersion)(bin) || '';
|
|
130017
129992
|
} catch {
|
|
130018
129993
|
return '';
|
|
130019
129994
|
}
|
|
130020
129995
|
};
|
|
130021
|
-
const
|
|
129996
|
+
const looksOfficialChromeBinaryPath = (bin)=>{
|
|
129997
|
+
const p = String(bin || '');
|
|
129998
|
+
if (!p) return false;
|
|
129999
|
+
if (/\/Applications\/Google Chrome(?: (?:Beta|Dev|Canary))?\.app\/Contents\/MacOS\/Google Chrome/i.test(p)) return true;
|
|
130000
|
+
if (/\\Google\\Chrome\\Application\\chrome\.exe$/i.test(p)) return true;
|
|
130001
|
+
if (/\/opt\/google\/chrome\//i.test(p)) return true;
|
|
130002
|
+
if (/\/google-chrome(?:-stable)?$/i.test(p)) return true;
|
|
130003
|
+
return false;
|
|
130004
|
+
};
|
|
130022
130005
|
const getInstallGuidanceText = ()=>{
|
|
130023
130006
|
try {
|
|
130024
130007
|
return (0, external_chrome_location2_.getInstallGuidance)();
|
|
@@ -130026,30 +130009,37 @@ var __webpack_modules__ = {
|
|
|
130026
130009
|
return 'npx extension install chrome';
|
|
130027
130010
|
}
|
|
130028
130011
|
};
|
|
130012
|
+
const managedCacheRoot = output_binaries_resolver.LB(compilation);
|
|
130013
|
+
const managedEnvFor = (b)=>({
|
|
130014
|
+
...process.env,
|
|
130015
|
+
...output_binaries_resolver.$4(String(managedCacheRoot), b)
|
|
130016
|
+
});
|
|
130029
130017
|
const isAuthorMode = 'true' === process.env.EXTENSION_AUTHOR_MODE;
|
|
130030
130018
|
switch(browser){
|
|
130031
130019
|
case 'chrome':
|
|
130032
130020
|
if (isAuthorMode) console.log(messages.GqE(browser));
|
|
130033
130021
|
if (!skipDetection) try {
|
|
130034
130022
|
try {
|
|
130035
|
-
const
|
|
130036
|
-
|
|
130037
|
-
|
|
130023
|
+
const env = managedEnvFor('chrome');
|
|
130024
|
+
const located = external_chrome_location2_default()(true, {
|
|
130025
|
+
env
|
|
130026
|
+
}) || null;
|
|
130027
|
+
if (!located) throw new Error(getInstallGuidanceText());
|
|
130038
130028
|
const normalized = normalizePath(located || null);
|
|
130039
|
-
if (normalized && external_fs_.existsSync(normalized)) {
|
|
130040
|
-
|
|
130041
|
-
|
|
130042
|
-
|
|
130043
|
-
|
|
130044
|
-
|
|
130045
|
-
} else browserBinaryLocation = normalized;
|
|
130046
|
-
} else browserBinaryLocation = null;
|
|
130029
|
+
if (normalized && external_fs_.existsSync(normalized)) if (looksOfficialChromeBinaryPath(normalized) && !isWslEnv()) {
|
|
130030
|
+
this.printEnhancedPuppeteerInstallHint(compilation, getInstallGuidanceText(), browser);
|
|
130031
|
+
printedGuidance = true;
|
|
130032
|
+
browserBinaryLocation = null;
|
|
130033
|
+
} else browserBinaryLocation = normalized;
|
|
130034
|
+
else browserBinaryLocation = null;
|
|
130047
130035
|
} catch (err) {
|
|
130048
|
-
|
|
130036
|
+
const env = managedEnvFor('chrome');
|
|
130037
|
+
let candidate = external_chrome_location2_default()(true, {
|
|
130038
|
+
env
|
|
130039
|
+
}) || null;
|
|
130049
130040
|
const normalized = normalizePath(candidate || null);
|
|
130050
130041
|
if (normalized) {
|
|
130051
|
-
|
|
130052
|
-
if (looksOfficialChrome(versionLine) && !isWslEnv()) {
|
|
130042
|
+
if (looksOfficialChromeBinaryPath(normalized) && !isWslEnv()) {
|
|
130053
130043
|
this.printEnhancedPuppeteerInstallHint(compilation, getInstallGuidanceText(), browser);
|
|
130054
130044
|
printedGuidance = true;
|
|
130055
130045
|
candidate = null;
|
|
@@ -130077,7 +130067,10 @@ var __webpack_modules__ = {
|
|
|
130077
130067
|
browserBinaryLocation = normalized;
|
|
130078
130068
|
}
|
|
130079
130069
|
if (!browserBinaryLocation && !skipDetection) try {
|
|
130080
|
-
const
|
|
130070
|
+
const env = managedEnvFor('chromium');
|
|
130071
|
+
const p = external_chromium_location_default()({
|
|
130072
|
+
env
|
|
130073
|
+
});
|
|
130081
130074
|
const normalized = normalizePath(p || null);
|
|
130082
130075
|
if (normalized && 'string' == typeof normalized) {
|
|
130083
130076
|
if (external_fs_.existsSync(normalized)) browserBinaryLocation = normalized;
|
|
@@ -130094,7 +130087,10 @@ var __webpack_modules__ = {
|
|
|
130094
130087
|
if (normalized && external_fs_.existsSync(normalized)) browserBinaryLocation = normalized;
|
|
130095
130088
|
else throw new Error('EDGE_BINARY points to a non-existent path');
|
|
130096
130089
|
} else {
|
|
130097
|
-
const
|
|
130090
|
+
const env = managedEnvFor('edge');
|
|
130091
|
+
const located = external_edge_location_default()({
|
|
130092
|
+
env
|
|
130093
|
+
});
|
|
130098
130094
|
const normalized = normalizePath(located || null);
|
|
130099
130095
|
browserBinaryLocation = normalized;
|
|
130100
130096
|
if (!browserBinaryLocation || !external_fs_.existsSync(String(browserBinaryLocation))) {
|
|
@@ -130150,7 +130146,10 @@ var __webpack_modules__ = {
|
|
|
130150
130146
|
process.exit(1);
|
|
130151
130147
|
}
|
|
130152
130148
|
if (!browserBinaryLocation && !skipDetection) try {
|
|
130153
|
-
const
|
|
130149
|
+
const env = managedEnvFor('chromium');
|
|
130150
|
+
const p = external_chromium_location_default()({
|
|
130151
|
+
env
|
|
130152
|
+
});
|
|
130154
130153
|
const normalized = normalizePath(p || null);
|
|
130155
130154
|
if (normalized && 'string' == typeof normalized) {
|
|
130156
130155
|
if (external_fs_.existsSync(normalized)) browserBinaryLocation = normalized;
|
|
@@ -130161,24 +130160,26 @@ var __webpack_modules__ = {
|
|
|
130161
130160
|
default:
|
|
130162
130161
|
try {
|
|
130163
130162
|
try {
|
|
130164
|
-
const
|
|
130165
|
-
|
|
130166
|
-
|
|
130163
|
+
const env = managedEnvFor('chrome');
|
|
130164
|
+
const located = external_chrome_location2_default()(true, {
|
|
130165
|
+
env
|
|
130166
|
+
}) || null;
|
|
130167
|
+
if (!located) throw new Error(getInstallGuidanceText());
|
|
130167
130168
|
const normalized = normalizePath(located || null);
|
|
130168
|
-
if (normalized && external_fs_.existsSync(normalized)) {
|
|
130169
|
-
|
|
130170
|
-
|
|
130171
|
-
|
|
130172
|
-
|
|
130173
|
-
|
|
130174
|
-
} else browserBinaryLocation = normalized;
|
|
130175
|
-
} else browserBinaryLocation = null;
|
|
130169
|
+
if (normalized && external_fs_.existsSync(normalized)) if (looksOfficialChromeBinaryPath(normalized) && !isWslEnv()) {
|
|
130170
|
+
this.printEnhancedPuppeteerInstallHint(compilation, getInstallGuidanceText(), browser);
|
|
130171
|
+
printedGuidance = true;
|
|
130172
|
+
browserBinaryLocation = null;
|
|
130173
|
+
} else browserBinaryLocation = normalized;
|
|
130174
|
+
else browserBinaryLocation = null;
|
|
130176
130175
|
} catch (err) {
|
|
130177
|
-
|
|
130176
|
+
const env = managedEnvFor('chrome');
|
|
130177
|
+
let candidate = external_chrome_location2_default()(true, {
|
|
130178
|
+
env
|
|
130179
|
+
}) || null;
|
|
130178
130180
|
const normalized = normalizePath(candidate || null);
|
|
130179
130181
|
if (normalized) {
|
|
130180
|
-
|
|
130181
|
-
if (looksOfficialChrome(versionLine) && !isWslEnv()) {
|
|
130182
|
+
if (looksOfficialChromeBinaryPath(normalized) && !isWslEnv()) {
|
|
130182
130183
|
this.printEnhancedPuppeteerInstallHint(compilation, getInstallGuidanceText(), browser);
|
|
130183
130184
|
printedGuidance = true;
|
|
130184
130185
|
candidate = null;
|
|
@@ -131352,7 +131353,14 @@ var __webpack_modules__ = {
|
|
|
131352
131353
|
console.error(messages.jk4());
|
|
131353
131354
|
process.exit(1);
|
|
131354
131355
|
} else {
|
|
131355
|
-
const
|
|
131356
|
+
const cacheRoot = (0, output_binaries_resolver.LB)(compilation);
|
|
131357
|
+
const env = {
|
|
131358
|
+
...process.env,
|
|
131359
|
+
...(0, output_binaries_resolver.$4)(String(cacheRoot), 'firefox')
|
|
131360
|
+
};
|
|
131361
|
+
const located = external_firefox_location2_default()(true, {
|
|
131362
|
+
env
|
|
131363
|
+
});
|
|
131356
131364
|
const normalized = located ? normalizeBinaryPathForWsl(located) : null;
|
|
131357
131365
|
if (normalized && external_fs_.existsSync(normalized)) browserBinaryLocation = normalized;
|
|
131358
131366
|
}
|
|
@@ -136095,7 +136103,7 @@ var __webpack_modules__ = {
|
|
|
136095
136103
|
},
|
|
136096
136104
|
"./package.json" (module) {
|
|
136097
136105
|
"use strict";
|
|
136098
|
-
module.exports = JSON.parse('{"rE":"3.10.
|
|
136106
|
+
module.exports = JSON.parse('{"rE":"3.10.3","El":{"@rspack/core":"^1.7.5","@rspack/dev-server":"^1.2.1","@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"}}');
|
|
136099
136107
|
}
|
|
136100
136108
|
};
|
|
136101
136109
|
var __webpack_module_cache__ = {};
|
|
@@ -136394,7 +136402,7 @@ var __webpack_exports__ = {};
|
|
|
136394
136402
|
if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.warn(error);
|
|
136395
136403
|
}
|
|
136396
136404
|
}
|
|
136397
|
-
var
|
|
136405
|
+
var paths = __webpack_require__("./webpack/webpack-lib/paths.ts");
|
|
136398
136406
|
var check_build_dependencies = __webpack_require__("./webpack/webpack-lib/check-build-dependencies.ts");
|
|
136399
136407
|
var package_manager = __webpack_require__("./webpack/webpack-lib/package-manager.ts");
|
|
136400
136408
|
function clearLine() {
|
|
@@ -136633,7 +136641,7 @@ var __webpack_exports__ = {};
|
|
|
136633
136641
|
async function ensureDependencies(projectPath, opts) {
|
|
136634
136642
|
const packageRoot = (0, check_build_dependencies.w1)();
|
|
136635
136643
|
const missingBuild = packageRoot && !(0, check_build_dependencies.S)(packageRoot) ? (0, check_build_dependencies.Cf)(packageRoot) : [];
|
|
136636
|
-
const shouldInstallUserDeps = !!projectPath && !opts?.skipProjectInstall && (0,
|
|
136644
|
+
const shouldInstallUserDeps = !!projectPath && !opts?.skipProjectInstall && (0, paths.Bi)((0, paths.G6)(projectPath));
|
|
136637
136645
|
const needsBuildInstall = missingBuild.length > 0;
|
|
136638
136646
|
const needsUserInstall = shouldInstallUserDeps;
|
|
136639
136647
|
if (!needsBuildInstall && !needsUserInstall) return {
|
|
@@ -136652,10 +136660,10 @@ var __webpack_exports__ = {};
|
|
|
136652
136660
|
installedUser: needsUserInstall
|
|
136653
136661
|
};
|
|
136654
136662
|
}
|
|
136655
|
-
var optional_deps_lib = __webpack_require__("./webpack/optional-deps-lib/index.ts");
|
|
136656
136663
|
var external_pintor_ = __webpack_require__("pintor");
|
|
136657
136664
|
var external_pintor_default = /*#__PURE__*/ __webpack_require__.n(external_pintor_);
|
|
136658
136665
|
var external_crypto_ = __webpack_require__("crypto");
|
|
136666
|
+
var optional_deps_lib = __webpack_require__("./webpack/optional-deps-lib/index.ts");
|
|
136659
136667
|
var optional_dependencies = __webpack_require__("./webpack/webpack-lib/optional-dependencies.ts");
|
|
136660
136668
|
function getPreflightCacheDir(packageRoot) {
|
|
136661
136669
|
return external_path_.join(packageRoot, '.cache', 'extensionjs', 'preflight');
|
|
@@ -136803,7 +136811,7 @@ var __webpack_exports__ = {};
|
|
|
136803
136811
|
throw new Error(`[Optional] Optional dependency install reported success but contract verification failed at install root: ${failures.join(', ')}`);
|
|
136804
136812
|
}
|
|
136805
136813
|
async function preflightOptionalDependencies(projectStructure, mode, opts) {
|
|
136806
|
-
const { packageJsonDir } = (0,
|
|
136814
|
+
const { packageJsonDir } = (0, paths.fu)(projectStructure);
|
|
136807
136815
|
const projectPath = packageJsonDir;
|
|
136808
136816
|
if (hasPreflightMarker(projectPath)) {
|
|
136809
136817
|
if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(`${external_pintor_default().brightMagenta('►►► Author says')} Optional deps preflight skipped (cache hit).`);
|
|
@@ -136868,13 +136876,13 @@ var __webpack_exports__ = {};
|
|
|
136868
136876
|
writePreflightMarker(projectPath);
|
|
136869
136877
|
}
|
|
136870
136878
|
function shouldRunOptionalPreflight(projectStructure) {
|
|
136871
|
-
const { packageJsonDir } = (0,
|
|
136879
|
+
const { packageJsonDir } = (0, paths.fu)(projectStructure);
|
|
136872
136880
|
const projectPath = packageJsonDir;
|
|
136873
136881
|
if (hasPreflightMarker(projectPath)) return false;
|
|
136874
136882
|
return true;
|
|
136875
136883
|
}
|
|
136876
136884
|
async function ensureProjectReady(projectStructure, mode, opts) {
|
|
136877
|
-
const { packageJsonDir } = (0,
|
|
136885
|
+
const { packageJsonDir } = (0, paths.fu)(projectStructure);
|
|
136878
136886
|
const result = await ensureDependencies(packageJsonDir, opts);
|
|
136879
136887
|
await ensureDevelopArtifacts();
|
|
136880
136888
|
if (shouldRunOptionalPreflight(projectStructure)) await preflightOptionalDependencies(projectStructure, mode, {
|
|
@@ -136913,8 +136921,8 @@ var __webpack_exports__ = {};
|
|
|
136913
136921
|
const projectStructure = await getProjectStructure(pathOrRemoteUrl);
|
|
136914
136922
|
const isVitest = 'true' === process.env.VITEST;
|
|
136915
136923
|
const shouldExitOnError = (buildOptions?.exitOnError ?? true) && !isVitest;
|
|
136916
|
-
const browser = (0,
|
|
136917
|
-
const { manifestDir, packageJsonDir } = (0,
|
|
136924
|
+
const browser = (0, paths.YN)(buildOptions?.browser || 'chrome', buildOptions?.chromiumBinary, buildOptions?.geckoBinary || buildOptions?.firefoxBinary);
|
|
136925
|
+
const { manifestDir, packageJsonDir } = (0, paths.fu)(projectStructure);
|
|
136918
136926
|
const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
|
|
136919
136927
|
try {
|
|
136920
136928
|
const shouldInstallProjectDeps = !isAuthor || buildOptions?.install !== false;
|
|
@@ -136943,7 +136951,7 @@ var __webpack_exports__ = {};
|
|
|
136943
136951
|
if (projectStructure.packageJsonPath) assertNoManagedDependencyConflicts(projectStructure.packageJsonPath, manifestDir);
|
|
136944
136952
|
const commandConfig = await (0, config_loader.eY)(packageJsonDir, 'build');
|
|
136945
136953
|
const specialFoldersData = (0, get_data.H)(packageJsonDir);
|
|
136946
|
-
const distPath = (0,
|
|
136954
|
+
const distPath = (0, paths.q4)(packageJsonDir, browser);
|
|
136947
136955
|
if (debug) {
|
|
136948
136956
|
console.log(messages.SG(manifestDir, packageJsonDir));
|
|
136949
136957
|
console.log(messages._A(browser, buildOptions?.chromiumBinary, buildOptions?.geckoBinary || buildOptions?.firefoxBinary));
|
|
@@ -137056,7 +137064,7 @@ var __webpack_exports__ = {};
|
|
|
137056
137064
|
try {
|
|
137057
137065
|
const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
|
|
137058
137066
|
const debug = isAuthor;
|
|
137059
|
-
const { manifestDir, packageJsonDir } = (0,
|
|
137067
|
+
const { manifestDir, packageJsonDir } = (0, paths.fu)(projectStructure);
|
|
137060
137068
|
const shouldInstallProjectDeps = !isAuthor || false !== devOptions.install;
|
|
137061
137069
|
const previousOneTimeHint = process.env.EXTENSION_ONE_TIME_INSTALL_HINT;
|
|
137062
137070
|
process.env.EXTENSION_ONE_TIME_INSTALL_HINT = 'true';
|
|
@@ -137072,7 +137080,7 @@ var __webpack_exports__ = {};
|
|
|
137072
137080
|
}
|
|
137073
137081
|
if ((0, typescript.eE)(manifestDir)) await generateExtensionTypes(manifestDir, packageJsonDir);
|
|
137074
137082
|
if (projectStructure.packageJsonPath) assertNoManagedDependencyConflicts(projectStructure.packageJsonPath, manifestDir);
|
|
137075
|
-
const browser = (0,
|
|
137083
|
+
const browser = (0, paths.YN)(devOptions.browser || 'chrome', devOptions.chromiumBinary, devOptions.geckoBinary || devOptions.firefoxBinary);
|
|
137076
137084
|
const geckoBinary = devOptions.geckoBinary || devOptions.firefoxBinary;
|
|
137077
137085
|
if (debug) {
|
|
137078
137086
|
console.log(messages.SG(manifestDir, packageJsonDir));
|
|
@@ -137245,11 +137253,11 @@ var __webpack_exports__ = {};
|
|
|
137245
137253
|
async function extensionPreview(pathOrRemoteUrl, previewOptions) {
|
|
137246
137254
|
const projectStructure = await getProjectStructure(pathOrRemoteUrl);
|
|
137247
137255
|
const debug = 'true' === process.env.EXTENSION_AUTHOR_MODE;
|
|
137248
|
-
const { manifestDir, packageJsonDir } = (0,
|
|
137256
|
+
const { manifestDir, packageJsonDir } = (0, paths.fu)(projectStructure);
|
|
137249
137257
|
if (projectStructure.packageJsonPath) assertNoManagedDependencyConflicts(projectStructure.packageJsonPath, packageJsonDir);
|
|
137250
|
-
const browser = (0,
|
|
137251
|
-
const outputPath = (0,
|
|
137252
|
-
const distPath = (0,
|
|
137258
|
+
const browser = (0, paths.YN)(previewOptions.browser || 'chrome', previewOptions.chromiumBinary, previewOptions.geckoBinary || previewOptions.firefoxBinary);
|
|
137259
|
+
const outputPath = (0, paths.u2)(projectStructure, browser, previewOptions.outputPath);
|
|
137260
|
+
const distPath = (0, paths.q4)(packageJsonDir, browser);
|
|
137253
137261
|
const metadataCommand = 'start' === previewOptions.metadataCommand ? 'start' : 'preview';
|
|
137254
137262
|
const metadata = (0, plugin_playwright.Ih)({
|
|
137255
137263
|
packageJsonDir,
|
|
@@ -137355,11 +137363,11 @@ var __webpack_exports__ = {};
|
|
|
137355
137363
|
if (void 0 === previousOneTimeHint) delete process.env.EXTENSION_ONE_TIME_INSTALL_HINT;
|
|
137356
137364
|
else process.env.EXTENSION_ONE_TIME_INSTALL_HINT = previousOneTimeHint;
|
|
137357
137365
|
}
|
|
137358
|
-
const browser = (0,
|
|
137359
|
-
const { manifestDir, packageJsonDir } = (0,
|
|
137366
|
+
const browser = (0, paths.YN)(startOptions.browser || 'chrome', startOptions.chromiumBinary, startOptions.geckoBinary || startOptions.firefoxBinary);
|
|
137367
|
+
const { manifestDir, packageJsonDir } = (0, paths.fu)(projectStructure);
|
|
137360
137368
|
const commandConfig = await (0, config_loader.eY)(packageJsonDir, 'start');
|
|
137361
137369
|
const browserConfig = await (0, config_loader.xY)(packageJsonDir, browser);
|
|
137362
|
-
const distPath = (0,
|
|
137370
|
+
const distPath = (0, paths.q4)(packageJsonDir, browser);
|
|
137363
137371
|
if (debug) {
|
|
137364
137372
|
console.log(messages.SG(manifestDir, packageJsonDir));
|
|
137365
137373
|
console.log(messages._A(browser, startOptions.chromiumBinary, startOptions.geckoBinary || startOptions.firefoxBinary));
|
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"webpack/webpack-lib/optional-dependencies.json"
|
|
26
26
|
],
|
|
27
27
|
"name": "extension-develop",
|
|
28
|
-
"version": "3.10.
|
|
28
|
+
"version": "3.10.3",
|
|
29
29
|
"description": "Develop, build, preview, and package Extension.js projects.",
|
|
30
30
|
"author": {
|
|
31
31
|
"name": "Cezar Augusto",
|