extension-develop 4.1.35 → 4.1.36
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/363~0.mjs +17 -0
- package/dist/469~0.mjs +20 -5
- package/dist/832~0.mjs +2770 -2761
- package/dist/840~0.mjs +2488 -2144
- package/dist/852~0.mjs +1 -0
- package/dist/contract/codes.json +6 -2
- package/dist/extension-js-devtools/build-stamp.json +2 -2
- package/dist/extension-js-devtools/chrome/background/service_worker.js +2 -2
- package/dist/extension-js-devtools/chrome/pages/welcome.js +2 -2
- package/dist/extension-js-devtools/chromium/background/service_worker.js +2 -2
- package/dist/extension-js-devtools/chromium/pages/welcome.js +2 -2
- package/dist/extension-js-devtools/edge/background/service_worker.js +2 -2
- package/dist/extension-js-devtools/edge/pages/welcome.js +2 -2
- package/dist/extension-js-devtools/firefox/background/scripts.js +2 -2
- package/dist/extension-js-devtools/firefox/pages/welcome.js +2 -2
- package/dist/extension-js-theme/build-stamp.json +2 -2
- package/dist/lib/addon-lint.d.ts +7 -3
- package/dist/lib/addon-reviewer-note.d.ts +32 -0
- package/dist/lib/build-summary.d.ts +6 -1
- package/dist/lib/build-toolchain.d.ts +8 -0
- package/dist/lib/chunk-dependency-provenance.d.ts +8 -0
- package/dist/lib/development-artifacts.d.ts +2 -0
- package/dist/lib/loopback-origins.d.ts +6 -0
- package/dist/lib/messages.d.ts +12 -1
- package/dist/lib/messaging.d.ts +1 -0
- package/dist/lib/stable-loader-paths.d.ts +14 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/edge-options-notice.d.ts +4 -0
- package/dist/plugin-web-extension/feature-manifest/messages.d.ts +1 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-base-uri-runtime-module.d.ts +5 -0
- package/dist/plugin-web-extension/feature-scripts/steps/stamp-webkit-utf8-bom.d.ts +9 -0
- package/dist/rspack-config~0.mjs +211 -20
- package/package.json +1 -1
package/dist/363~0.mjs
CHANGED
|
@@ -1189,6 +1189,9 @@ function contentScriptEntryDroppedForBrowser(index, browser, prefixedKeys) {
|
|
|
1189
1189
|
if (prefixedKeys.length > 0) lines.push(`${prefixedKeys.map((key)=>pintor.yellow(key)).join(', ')} ${1 === prefixedKeys.length ? 'applies' : 'apply'} to another browser. Add ${pintor.yellow(`${browser}:js`)} or a plain ${pintor.yellow('js')} to keep the entry here.`);
|
|
1190
1190
|
return lines.join('\n');
|
|
1191
1191
|
}
|
|
1192
|
+
function edgeEmbeddedOptionsDialog() {
|
|
1193
|
+
return `${messaging_prefix('warn')} Edge shows an embedded settings page in a dialog at most 400px wide (368px for the page), so a wider settings page is clipped on Edge.\nAdd ${pintor.yellow('edge:options_ui')} with ${pintor.yellow('"open_in_tab": true')} to open settings in a tab on Edge only.`;
|
|
1194
|
+
}
|
|
1192
1195
|
function webkitUnsupportedKeysDropped(browser, dropped) {
|
|
1193
1196
|
const count = dropped.length;
|
|
1194
1197
|
const lines = [];
|
|
@@ -1197,6 +1200,19 @@ function webkitUnsupportedKeysDropped(browser, dropped) {
|
|
|
1197
1200
|
lines.push(`Every key above is inert on Safari, so the built app lost nothing it could have run. Declare a Safari-only replacement with the ${pintor.yellow('safari:')} prefix if you have one.`);
|
|
1198
1201
|
return lines.join('\n');
|
|
1199
1202
|
}
|
|
1203
|
+
function edgeEmbedsOptionsPage(manifest, browser) {
|
|
1204
|
+
if ('edge' !== String(browser)) return false;
|
|
1205
|
+
const optionsUi = manifest.options_ui;
|
|
1206
|
+
if (!optionsUi || 'object' != typeof optionsUi || Array.isArray(optionsUi)) return false;
|
|
1207
|
+
const { page, open_in_tab: openInTab } = optionsUi;
|
|
1208
|
+
return 'string' == typeof page && page.length > 0 && true !== openInTab;
|
|
1209
|
+
}
|
|
1210
|
+
let reported = false;
|
|
1211
|
+
function reportEdgeEmbeddedOptions(manifest, browser) {
|
|
1212
|
+
if (reported || !edgeEmbedsOptionsPage(manifest, browser)) return;
|
|
1213
|
+
reported = true;
|
|
1214
|
+
humanLine(edgeEmbeddedOptionsDialog());
|
|
1215
|
+
}
|
|
1200
1216
|
const UNSUPPORTED_TOP_LEVEL_KEYS = {
|
|
1201
1217
|
side_panel: 'Safari has no side panel surface',
|
|
1202
1218
|
sidebar_action: 'Safari has no sidebar surface',
|
|
@@ -1426,6 +1442,7 @@ function buildCanonicalManifestWithOverrides(manifestPath, manifest, browser, pr
|
|
|
1426
1442
|
const translated = foldActionIntoBrowserAction(foldSidebarKeyForBrowser(canonical, browser));
|
|
1427
1443
|
const webkit = dropWebkitUnsupportedKeys(translated, browser);
|
|
1428
1444
|
reportWebkitDroppedKeys(webkit.dropped, browser);
|
|
1445
|
+
reportEdgeEmbeddedOptions(webkit.manifest, browser);
|
|
1429
1446
|
return {
|
|
1430
1447
|
manifest: webkit.manifest,
|
|
1431
1448
|
overrides
|
package/dist/469~0.mjs
CHANGED
|
@@ -320,11 +320,16 @@ function anotherDevSessionActive(browser, pid, runId) {
|
|
|
320
320
|
function buildOutDirInvalid(value) {
|
|
321
321
|
return `${getLoggingPrefix('error')} ${fmt.code('--out-dir')} needs a folder path other than the project root, got ${fmt.code(value || '(empty)')}.\nPass a folder such as ${fmt.code('--out-dir build')}, and the build writes ${fmt.code('build/<browser>')}.`;
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
|
|
323
|
+
function productionLoopbackOrigins(origins) {
|
|
324
|
+
const list = origins.map((origin)=>` ${fmt.code(origin.pattern)} in ${origin.where}`).join('\n');
|
|
325
|
+
return `${getLoggingPrefix('warn')} The production manifest reaches the local machine:\n${list}\nStore reviewers read a loopback origin as host access with no purpose in a published extension. Keep it to development with an ${fmt.code('$EXTENSION_PUBLIC_*')} placeholder in the manifest and its value in ${fmt.code('.env.development')}.`;
|
|
326
|
+
}
|
|
327
|
+
function productionLoopbackOriginsText(origins) {
|
|
328
|
+
const list = origins.map((origin)=>`${origin.pattern} in ${origin.where}`).join(', ');
|
|
329
|
+
return `the production manifest reaches the local machine (${list}). Keep loopback origins to development with an $EXTENSION_PUBLIC_* placeholder and a .env.development value.`;
|
|
325
330
|
}
|
|
326
|
-
function
|
|
327
|
-
return
|
|
331
|
+
function buildSharesDevDist(browser, distDisplay, pid) {
|
|
332
|
+
return `${getLoggingPrefix('error')} A dev session (PID ${pid}) owns ${distDisplay}, so this build was not written.\nStop that session, or pass ${fmt.code('--out-dir <path>')} to write the ${browser} build next to it and keep the dev session as it is.`;
|
|
328
333
|
}
|
|
329
334
|
function anotherDevSessionRefused(browser, pid, port) {
|
|
330
335
|
const where = port ? ` on port ${port}` : '';
|
|
@@ -349,6 +354,10 @@ function buildComplete(browser, distDisplayPath, totalBytes, mode) {
|
|
|
349
354
|
const size = 'number' == typeof totalBytes && totalBytes > 0 ? ` (${getHumanSize(totalBytes)})` : '';
|
|
350
355
|
return `${getLoggingPrefix('success')} ${noun} ${builtFor} ${pintor.underline(distDisplayPath)}${size}.`;
|
|
351
356
|
}
|
|
357
|
+
function buildToolchain(toolchain) {
|
|
358
|
+
const packageManager = toolchain.package_manager ? ` and ${toolchain.package_manager.name} ${toolchain.package_manager.version}` : '';
|
|
359
|
+
return `${getLoggingPrefix('info')} Built with Node ${toolchain.node}${packageManager}. A reviewer note that names them lets a rebuild match this one.`;
|
|
360
|
+
}
|
|
352
361
|
function operaBuildUnminified() {
|
|
353
362
|
return `${getLoggingPrefix('info')} Opera Add-ons reviews readable source, so this build does not minify first-party code. Pass ${pintor.blue('--minify')} to minify it anyway.`;
|
|
354
363
|
}
|
|
@@ -376,6 +385,12 @@ function addonLintDependencyAttribution(packages, onlyDependencies) {
|
|
|
376
385
|
const rest = packages.length > 3 ? `, +${packages.length - 3} more` : '';
|
|
377
386
|
return onlyDependencies ? `- this file is bundled dependency code (${named}${rest}), not yours` : `- this file also bundles ${named}${rest}, so the finding may be theirs`;
|
|
378
387
|
}
|
|
388
|
+
function addonLintUnsupportedApiFix(browser) {
|
|
389
|
+
return `- this names a browser API, so it is your code, not a library's: guard it with a build-time check of process.env.EXTENSION_PUBLIC_BROWSER (return early when it reads "${browser}") and the production build drops the branch from the ${browser} bundle`;
|
|
390
|
+
}
|
|
391
|
+
function addonLintReviewerNote(noteDisplay) {
|
|
392
|
+
return `${getLoggingPrefix('info')} Notes to reviewer for addons.mozilla.org are at ${pintor.underline(noteDisplay)} (paste its bundled libraries section into the submission, the author findings are yours to fix)`;
|
|
393
|
+
}
|
|
379
394
|
function addonLintMore(hiddenCount, distDisplay) {
|
|
380
395
|
return `${getLoggingPrefix('info')} ${pluralize(hiddenCount, 'more finding')} not shown. Run ${pintor.blue(`npx addons-linter ${distDisplay}`)} for the full report.`;
|
|
381
396
|
}
|
|
@@ -1278,4 +1293,4 @@ function resolveProjectStructureSync(projectPath, options = {}) {
|
|
|
1278
1293
|
} : {}
|
|
1279
1294
|
};
|
|
1280
1295
|
}
|
|
1281
|
-
export { addonLintDependencyAttribution, addonLintFailed, addonLintFailedDebug, addonLintFinding, addonLintMore, addonLintNotInstalled, addonLintSummary, anotherDevSessionActive, anotherDevSessionRefused, asAbsolute, authorInstallNotice, browserLaunchFailed, buildAssetsTree, buildCommandFailed, buildComplete, buildFailed, buildOutDirInvalid, buildShareHint, buildSharesDevDist,
|
|
1296
|
+
export { addonLintDependencyAttribution, addonLintFailed, addonLintFailedDebug, addonLintFinding, addonLintMore, addonLintNotInstalled, addonLintReviewerNote, addonLintSummary, addonLintUnsupportedApiFix, anotherDevSessionActive, anotherDevSessionRefused, asAbsolute, authorInstallNotice, browserLaunchFailed, buildAssetsTree, buildCommandFailed, buildComplete, buildFailed, buildOutDirInvalid, buildShareHint, buildSharesDevDist, buildToolchain, buildWarningsDetails, codedError, collapseHomeDir, computePreviewOutputPath, configBrowserOrThrow, configLoadingError, configResolvedChangeIgnored, configUnknownKeys, configWrongShape, debugBrowser, debugContextPath, debugDirs, debugExtensionsToLoad, debugOutputPath, debugPreviewOutput, debugSplitChunksNarrowed, devCommandFailed, devtoolsEngineFor, displayPath, downloadingText, extensionLoadRecovered, extensionLoadStillRefused, failedToDownloadOrWriteZIPFileError, failedToWriteZIPFileError, getBuildDistPath, getDirs, getDistPath, getProjectStructure, invalidRemoteZip, isUsingExperimentalConfig, listOutputFiles, localZipNotFound, localZipUnreadable, managedDependencyCopyWarning, manifestInvalidJson, needsInstall, noCompanionExtensionsResolved, normalizeBrowser, notAZipArchive, operaBuildUnminified, packagingDistributionFiles, packagingSourceFiles, previewHasNothingToRun, previewing, previewingCustomOutput, previewingSourceFallback, productionControlOpen, productionLoopbackOrigins, productionLoopbackOriginsText, projectInstallFallbackToNpm, projectInstallInWorkspaceRoot, projectInstallScriptsDisabled, relativeToDir, remoteArchiveCacheRoot, remoteSourceDestinationTaken, remoteZipAccessRefused, remoteZipDamaged, resolveProjectStructureSync, reusingDownloadedProject, runtimeChunkKeptInline, safariBuildOutputNotFound, safariInvalidBundleId, sessionStateIgnoreAdded, starting, toPosixPath, tokenExpiry, treeWithDistFilesBrowser, treeWithSourceAndDistFiles, treeWithSourceFiles, unpackagedSuccessfully, unpackagingExtension, updatingTypeDefinitions, writingTypeDefinitions, writingTypeDefinitionsError, zipArtifactNotCreated, zipArtifactReady, zipEntryOutsideFolder, zipSkippedSymlinks };
|