extension-develop 3.9.0-next.5 → 3.9.1
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 +81 -37
- package/package.json +1 -1
package/dist/module.cjs
CHANGED
|
@@ -131966,30 +131966,25 @@ var __webpack_modules__ = {
|
|
|
131966
131966
|
const setupMessageWithIndex = hasIndex ? setupMessage.replace('►►► ', `►►► [${options?.index}/${options?.total}] `) : setupMessage;
|
|
131967
131967
|
if (isAuthor) console.warn(setupMessageWithIndex);
|
|
131968
131968
|
else console.log(setupMessageWithIndex);
|
|
131969
|
-
|
|
131970
|
-
|
|
131971
|
-
|
|
131972
|
-
|
|
131973
|
-
|
|
131974
|
-
|
|
131975
|
-
|
|
131976
|
-
|
|
131977
|
-
|
|
131978
|
-
|
|
131979
|
-
|
|
131980
|
-
|
|
131981
|
-
|
|
131982
|
-
|
|
131983
|
-
|
|
131984
|
-
await execInstallWithFallback(execCommand, {
|
|
131985
|
-
cwd: wslContext.useWsl ? void 0 : installBaseDir,
|
|
131986
|
-
fallbackNpmCommand,
|
|
131987
|
-
allowFallbackOnFailure: !wslContext.useWsl && 'npm' !== pm.name && void 0 !== fallbackNpmCommand
|
|
131988
|
-
});
|
|
131989
|
-
}
|
|
131969
|
+
const installCommand = getOptionalInstallCommand(pm, dependencies, wslContext.installDir || installBaseDir);
|
|
131970
|
+
const execCommand = wrapCommandForWsl(installCommand, wslContext);
|
|
131971
|
+
const fallbackNpmCommand = wslContext.useWsl ? void 0 : (0, _webpack_lib_package_manager__rspack_import_8.sX)([
|
|
131972
|
+
'--silent',
|
|
131973
|
+
'install',
|
|
131974
|
+
...(0, _webpack_lib_optional_dependencies__rspack_import_7.ad)(dependencies),
|
|
131975
|
+
'--prefix',
|
|
131976
|
+
installBaseDir,
|
|
131977
|
+
'--save-optional'
|
|
131978
|
+
]);
|
|
131979
|
+
await execInstallWithFallback(execCommand, {
|
|
131980
|
+
cwd: wslContext.useWsl ? void 0 : installBaseDir,
|
|
131981
|
+
fallbackNpmCommand,
|
|
131982
|
+
allowFallbackOnFailure: !wslContext.useWsl && 'npm' !== pm.name && void 0 !== fallbackNpmCommand
|
|
131983
|
+
});
|
|
131990
131984
|
await new Promise((resolve)=>setTimeout(resolve, 500));
|
|
131991
|
-
|
|
131992
|
-
|
|
131985
|
+
const needsRootRelink = isAuthor || dependencies.length > 1;
|
|
131986
|
+
if (needsRootRelink) {
|
|
131987
|
+
if (isAuthor) console.log(_messages__rspack_import_3.cr(integration));
|
|
131993
131988
|
const rootInstall = getRootInstallCommand(pm, wslContext.useWsl ? wslContext.installDir : void 0);
|
|
131994
131989
|
const rootCommand = wrapCommandForWsl(rootInstall, wslContext);
|
|
131995
131990
|
const rootFallbackCommand = wslContext.useWsl ? void 0 : (0, _webpack_lib_package_manager__rspack_import_8.sX)([
|
|
@@ -132003,7 +131998,7 @@ var __webpack_modules__ = {
|
|
|
132003
131998
|
fallbackNpmCommand: rootFallbackCommand,
|
|
132004
131999
|
allowFallbackOnFailure: !wslContext.useWsl && 'npm' !== pm.name && void 0 !== rootFallbackCommand
|
|
132005
132000
|
});
|
|
132006
|
-
console.log(_messages__rspack_import_3.ys(integration));
|
|
132001
|
+
if (isAuthor) console.log(_messages__rspack_import_3.ys(integration));
|
|
132007
132002
|
}
|
|
132008
132003
|
return true;
|
|
132009
132004
|
} catch (error) {
|
|
@@ -134191,13 +134186,17 @@ var __webpack_modules__ = {
|
|
|
134191
134186
|
return `${getLoggingPrefix('success')} Dependencies installed. Run the command again to proceed.`;
|
|
134192
134187
|
}
|
|
134193
134188
|
function buildWebpack(projectDir, stats, browser) {
|
|
134194
|
-
const statsJson = stats?.toJson(
|
|
134189
|
+
const statsJson = stats?.toJson({
|
|
134190
|
+
all: false,
|
|
134191
|
+
assets: true,
|
|
134192
|
+
time: true
|
|
134193
|
+
});
|
|
134195
134194
|
const outputPath = 'string' == typeof stats?.compilation?.outputOptions?.path ? stats.compilation.outputOptions.path : '';
|
|
134196
134195
|
const manifestPath = outputPath ? path__rspack_import_1.join(outputPath, 'manifest.json') : path__rspack_import_1.join(projectDir, 'manifest.json');
|
|
134197
134196
|
const manifest = JSON.parse(fs__rspack_import_0.readFileSync(manifestPath, 'utf8'));
|
|
134198
134197
|
const assets = statsJson?.assets;
|
|
134199
134198
|
const heading = `${getLoggingPrefix('info')} Building ${pintor__rspack_import_2_default().blue(manifest.name)} extension using ${capitalizedBrowserName(browser)} defaults...\n`;
|
|
134200
|
-
const buildTime = `\nBuild completed in ${((statsJson?.time || 0) / 1000).toFixed(2)} seconds
|
|
134199
|
+
const buildTime = `\nBuild completed in ${((statsJson?.time || 0) / 1000).toFixed(2)} seconds.\n`;
|
|
134201
134200
|
const buildTarget = `Build Target: ${pintor__rspack_import_2_default().gray(capitalizedBrowserName(browser))}\n`;
|
|
134202
134201
|
const buildStatus = `Build Status: ${stats?.hasErrors() ? pintor__rspack_import_2_default().red('Failed') : pintor__rspack_import_2_default().green('Success')}\n`;
|
|
134203
134202
|
const version1 = `\nVersion: ${pintor__rspack_import_2_default().gray(manifest.version)}\n`;
|
|
@@ -134258,13 +134257,13 @@ var __webpack_modules__ = {
|
|
|
134258
134257
|
if (haystack.includes('runtime') || haystack.includes('will fail') || haystack.includes('cannot resolve') || haystack.includes('service_worker')) return 'Runtime-risk';
|
|
134259
134258
|
return 'Warning';
|
|
134260
134259
|
}
|
|
134261
|
-
function
|
|
134262
|
-
if ('Performance' === category) return '
|
|
134263
|
-
if ('Deprecation' === category) return 'Move to the supported API
|
|
134260
|
+
function suggestedHintForWarning(category) {
|
|
134261
|
+
if ('Performance' === category) return 'Inspect the largest startup bundles and split optional code paths.';
|
|
134262
|
+
if ('Deprecation' === category) return 'Move to the supported API or plugin path before the next update.';
|
|
134264
134263
|
if ('Configuration' === category) return 'Review extension and bundler config keys, then remove or rename invalid options.';
|
|
134265
134264
|
if ('Compatibility' === category) return 'Verify browser target and manifest compatibility for this build.';
|
|
134266
|
-
if ('Runtime-risk' === category) return 'Address this
|
|
134267
|
-
return 'Re-run with
|
|
134265
|
+
if ('Runtime-risk' === category) return 'Address this before release; it may fail or degrade at runtime.';
|
|
134266
|
+
return 'Re-run with EXTENSION_VERBOSE=1 to inspect full warning details.';
|
|
134268
134267
|
}
|
|
134269
134268
|
function buildSuccessWithWarnings(warningCount) {
|
|
134270
134269
|
return `${getLoggingPrefix('warn')} Build succeeded with ${warningCount} warning(s). Your extension is ${pintor__rspack_import_2_default().green('ready for deployment')}.`;
|
|
@@ -134272,19 +134271,20 @@ var __webpack_modules__ = {
|
|
|
134272
134271
|
function buildWarningsDetails(warnings) {
|
|
134273
134272
|
if (!Array.isArray(warnings) || 0 === warnings.length) return '';
|
|
134274
134273
|
const blocks = [];
|
|
134275
|
-
const sectionHeader = `${getLoggingPrefix('warn')} Warning details\n`;
|
|
134276
134274
|
warnings.forEach((warning, index)=>{
|
|
134277
134275
|
const message = getWarningMessage(warning);
|
|
134278
134276
|
const source = getWarningSource(warning);
|
|
134279
134277
|
const artifact = getWarningArtifact(warning);
|
|
134280
134278
|
const category = classifyWarning(message, source);
|
|
134281
|
-
const
|
|
134282
|
-
if (!message) return void blocks.push(
|
|
134279
|
+
const hint = suggestedHintForWarning(category);
|
|
134280
|
+
if (!message) return void blocks.push(`${getLoggingPrefix('warn')} Warning ${index + 1}: details were suppressed by tool output.\n${formatWarningLabelLine('Source', pintor__rspack_import_2_default().gray(source))}\n${formatWarningLabelLine('Hint', 'Re-run with EXTENSION_VERBOSE=1 to inspect full warning messages.')}`);
|
|
134281
|
+
const performanceWarning = parsePerformanceWarning(warning, source, artifact);
|
|
134282
|
+
if (performanceWarning) return void blocks.push(performanceWarning);
|
|
134283
134283
|
const oneLine = message.replace(/\s+/g, ' ').trim();
|
|
134284
134284
|
const artifactSuffix = artifact ? ` ${pintor__rspack_import_2_default().gray(`(${artifact})`)}` : '';
|
|
134285
|
-
blocks.push(
|
|
134285
|
+
blocks.push(`${getLoggingPrefix('warn')} ${category}: ${oneLine}${artifactSuffix}\n${formatWarningLabelLine('Source', pintor__rspack_import_2_default().gray(source))}\n${formatWarningLabelLine('Hint', hint)}`);
|
|
134286
134286
|
});
|
|
134287
|
-
return
|
|
134287
|
+
return blocks.join('\n\n');
|
|
134288
134288
|
}
|
|
134289
134289
|
function fetchingProjectPath(owner, project) {
|
|
134290
134290
|
return fmt.block('Fetching project', [
|
|
@@ -134386,6 +134386,49 @@ var __webpack_modules__ = {
|
|
|
134386
134386
|
});
|
|
134387
134387
|
return `.\n${printTree(assetTree)}`;
|
|
134388
134388
|
}
|
|
134389
|
+
function formatWarningLabelLine(label, value) {
|
|
134390
|
+
return `${pintor__rspack_import_2_default().gray('│')} ${pintor__rspack_import_2_default().gray(`${label}:`)} ${value}`;
|
|
134391
|
+
}
|
|
134392
|
+
function parsePerformanceWarning(warning, source, _artifact) {
|
|
134393
|
+
const normalized = getWarningBody(warning).replace(/\r/g, '');
|
|
134394
|
+
const lower = normalized.toLowerCase();
|
|
134395
|
+
const threshold = normalized.match(/\(([\d.]+\s(?:KiB|MiB|GiB|KB|MB|GB))\)/)?.[1] || '';
|
|
134396
|
+
if (lower.includes('asset size limit')) return formatPerformanceWarningBlock({
|
|
134397
|
+
title: 'asset size limit exceeded',
|
|
134398
|
+
threshold,
|
|
134399
|
+
impact: 'Large emitted files can increase package size and slow extension startup.',
|
|
134400
|
+
source,
|
|
134401
|
+
hint: 'Inspect the largest startup bundles and split optional code paths.'
|
|
134402
|
+
});
|
|
134403
|
+
if (lower.includes('entrypoint size limit')) return formatPerformanceWarningBlock({
|
|
134404
|
+
title: 'entrypoint size limit exceeded',
|
|
134405
|
+
threshold,
|
|
134406
|
+
impact: 'Startup entrypoints are heavier than recommended.',
|
|
134407
|
+
source,
|
|
134408
|
+
hint: 'Keep startup entrypoints thin and defer non-critical code.'
|
|
134409
|
+
});
|
|
134410
|
+
}
|
|
134411
|
+
function formatPerformanceWarningBlock(options) {
|
|
134412
|
+
const lines = [
|
|
134413
|
+
`${getLoggingPrefix('warn')} Performance: ${options.title}`
|
|
134414
|
+
];
|
|
134415
|
+
if (options.threshold) lines.push(formatWarningLabelLine('Threshold', options.threshold));
|
|
134416
|
+
lines.push(formatWarningLabelLine('Impact', options.impact));
|
|
134417
|
+
lines.push(pintor__rspack_import_2_default().gray('│'));
|
|
134418
|
+
lines.push(formatWarningLabelLine('Source', pintor__rspack_import_2_default().gray(options.source)));
|
|
134419
|
+
lines.push(formatWarningLabelLine('Hint', options.hint));
|
|
134420
|
+
return lines.join('\n');
|
|
134421
|
+
}
|
|
134422
|
+
function getWarningBody(warning) {
|
|
134423
|
+
if (!warning) return '';
|
|
134424
|
+
if ('string' == typeof warning) return warning;
|
|
134425
|
+
return [
|
|
134426
|
+
warning.message,
|
|
134427
|
+
warning.details,
|
|
134428
|
+
warning.reason,
|
|
134429
|
+
warning.description
|
|
134430
|
+
].filter((value)=>'string' == typeof value && value.trim().length > 0).join('\n');
|
|
134431
|
+
}
|
|
134389
134432
|
function isUsingExperimentalConfig(integration) {
|
|
134390
134433
|
return `${getLoggingPrefix('info')} Using ${pintor__rspack_import_2_default().yellow(integration)}.`;
|
|
134391
134434
|
}
|
|
@@ -135416,7 +135459,7 @@ var __webpack_modules__ = {
|
|
|
135416
135459
|
},
|
|
135417
135460
|
"./package.json" (module) {
|
|
135418
135461
|
"use strict";
|
|
135419
|
-
module.exports = JSON.parse('{"rE":"3.9.
|
|
135462
|
+
module.exports = JSON.parse('{"rE":"3.9.1","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"}}');
|
|
135420
135463
|
}
|
|
135421
135464
|
};
|
|
135422
135465
|
var __webpack_module_cache__ = {};
|
|
@@ -136333,6 +136376,7 @@ var __webpack_exports__ = {};
|
|
|
136333
136376
|
plugins: allPluginsButBrowserRunners
|
|
136334
136377
|
});
|
|
136335
136378
|
const compilerConfig = merge(userConfig);
|
|
136379
|
+
compilerConfig.stats = false;
|
|
136336
136380
|
const compiler = rspack(compilerConfig);
|
|
136337
136381
|
let summary = {
|
|
136338
136382
|
browser,
|
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.9.
|
|
28
|
+
"version": "3.9.1",
|
|
29
29
|
"description": "Develop, build, preview, and package Extension.js projects.",
|
|
30
30
|
"author": {
|
|
31
31
|
"name": "Cezar Augusto",
|