extension-develop 4.1.20 → 4.1.22

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.
Files changed (47) hide show
  1. package/dist/672~0.mjs +24 -1
  2. package/dist/747~0.mjs +4 -2
  3. package/dist/832~0.mjs +8 -19
  4. package/dist/840~0.mjs +434 -36
  5. package/dist/852~0.mjs +5 -1
  6. package/dist/950~0.mjs +45 -28
  7. package/dist/command-preview.d.ts +8 -0
  8. package/dist/dev-server/control-bridge/consumer-client.d.ts +10 -0
  9. package/dist/dev-server/control-bridge/contracts.d.ts +42 -0
  10. package/dist/dev-server/control-bridge/logs-query.d.ts +16 -0
  11. package/dist/dev-server~0.mjs +2 -0
  12. package/dist/lib/addon-lint.d.ts +4 -1
  13. package/dist/lib/build-summary.d.ts +11 -0
  14. package/dist/lib/chunk-dependency-provenance.d.ts +14 -0
  15. package/dist/lib/constants.d.ts +1 -1
  16. package/dist/lib/manifest-utils.d.ts +2 -0
  17. package/dist/lib/messages.d.ts +3 -3
  18. package/dist/lib/messaging.d.ts +1 -0
  19. package/dist/lib/package-manager.d.ts +2 -0
  20. package/dist/lib/paths.d.ts +3 -0
  21. package/dist/plugin-browsers/index.d.ts +28 -0
  22. package/dist/plugin-compilation/env.d.ts +2 -0
  23. package/dist/plugin-js-frameworks/js-frameworks-lib/messages.d.ts +1 -0
  24. package/dist/plugin-js-frameworks/js-tools/solid.d.ts +3 -0
  25. package/dist/plugin-js-frameworks/js-tools/typescript.d.ts +16 -0
  26. package/dist/plugin-perf-budgets/categorize.d.ts +2 -1
  27. package/dist/plugin-perf-budgets/index.d.ts +1 -1
  28. package/dist/plugin-playwright/index.d.ts +1 -0
  29. package/dist/plugin-reload/classify-reload.d.ts +4 -0
  30. package/dist/plugin-reload/index.d.ts +18 -0
  31. package/dist/plugin-special-folders/folder-extensions/types.d.ts +13 -0
  32. package/dist/plugin-special-folders/messages.d.ts +2 -2
  33. package/dist/plugin-web-extension/feature-manifest/messages.d.ts +1 -0
  34. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/emitted-evidence.d.ts +22 -0
  35. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-background.d.ts +9 -0
  36. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-web-resources.d.ts +7 -16
  37. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults.d.ts +6 -2
  38. package/dist/plugin-web-extension/feature-manifest/steps/warn-gecko-unsupported-apis.d.ts +2 -13
  39. package/dist/plugin-web-extension/feature-scripts/messages.d.ts +5 -0
  40. package/dist/plugin-web-extension/feature-scripts/steps/warn-page-context-worker.d.ts +5 -0
  41. package/dist/plugin-web-extension/feature-web-resources/collect-entry-imports.d.ts +1 -0
  42. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/messages.d.ts +1 -0
  43. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/unreachable-resources.d.ts +9 -0
  44. package/dist/rspack-config.d.ts +1 -1
  45. package/dist/rspack-config~0.mjs +432 -465
  46. package/dist/types.d.ts +190 -0
  47. package/package.json +1 -1
package/dist/672~0.mjs CHANGED
@@ -104,6 +104,16 @@ function findDroppedVendorKeys(manifest, browser) {
104
104
  walk(manifest, '');
105
105
  return found;
106
106
  }
107
+ function isValidManifestVersion(value) {
108
+ return 2 === value || 3 === value;
109
+ }
110
+ function findPrefixedManifestVersionKeys(manifest) {
111
+ if (!manifest || 'object' != typeof manifest) return [];
112
+ return Object.keys(manifest).filter((key)=>{
113
+ const colon = key.indexOf(':');
114
+ return colon > 0 && 'manifest_version' === key.substring(colon + 1);
115
+ });
116
+ }
107
117
  const THEME_DISQUALIFYING_KEYS = [
108
118
  'background',
109
119
  "content_scripts",
@@ -198,6 +208,19 @@ function entrySplitAcrossInitialFiles(entryName, surface, ownFile, extraFiles) {
198
208
  lines.push(`Only a user-set optimization.splitChunks cache group does this. Use chunks: 'async' and import() the shared module: ${pintor.blue(SPLIT_ENTRY_RECIPE_URL)}`);
199
209
  return lines.join('\n');
200
210
  }
211
+ const PAGE_CONTEXT_SURFACES = {
212
+ content_script: "a content script",
213
+ script: "an injected script"
214
+ };
215
+ function workerStartedFromPageContext(assetName, surface) {
216
+ const lines = [];
217
+ lines.push(`${assetName} starts a worker from an extension URL, which the browser refuses in ${PAGE_CONTEXT_SURFACES[surface]}.`);
218
+ lines.push(`${pintor.gray('SCRIPT')} ${pintor.underline(assetName)}`);
219
+ lines.push("The worker file ships, but a worker script must be same-origin with the document that starts it, and this document is the page, so the worker never runs. Chromium throws a SecurityError and Firefox fires an error event on the worker.");
220
+ lines.push(`- Fetch the worker file first and start the worker from a blob: ${pintor.blue("new Worker(URL.createObjectURL(new Blob([await (await fetch(chrome.runtime.getURL('worker.js'))).text()])))")}`);
221
+ lines.push("- Or start the worker from an extension page, where the document is the extension and this spelling works as written.");
222
+ return lines.join('\n');
223
+ }
201
224
  function fetchedFileDependencyMissing(assetName, literal, expectedPath) {
202
225
  const lines = [];
203
226
  lines.push(`${assetName} loads '${literal}' at runtime (fetch/XMLHttpRequest/new URL), but the file isn't in the output.`);
@@ -243,4 +266,4 @@ function compiledSourceSpelling(assetName, api, literal, emittedPath) {
243
266
  lines.push(`Reference the emitted path: ${pintor.blue(emittedPath)}.`);
244
267
  return lines.join('\n');
245
268
  }
246
- export { compiledSourceSpelling, entrySplitAcrossInitialFiles, fetchedFileDependencyMissing, filterKeysForThisBrowser, findDroppedVendorKeys, getURLDependencyMissing, importScriptsDependencyMissing, injectedCompiledSourceLiteral, injectedFileDependencyMissing, isStaticTheme, isStaticThemeSource, reservedScriptsFolder, runtimeSetSurfaceDependencyMissing, staticImportDependencyMissing };
269
+ export { compiledSourceSpelling, entrySplitAcrossInitialFiles, fetchedFileDependencyMissing, filterKeysForThisBrowser, findDroppedVendorKeys, findPrefixedManifestVersionKeys, getURLDependencyMissing, importScriptsDependencyMissing, injectedCompiledSourceLiteral, injectedFileDependencyMissing, isStaticTheme, isStaticThemeSource, isValidManifestVersion, reservedScriptsFolder, runtimeSetSurfaceDependencyMissing, staticImportDependencyMissing, workerStartedFromPageContext };
package/dist/747~0.mjs CHANGED
@@ -69,10 +69,12 @@ function toRuntimeStylesheetModule(css) {
69
69
  `var __extjsCssText = ${JSON.stringify(css)};`,
70
70
  'function __extjsExtensionRoot() {',
71
71
  ' try {',
72
- ' if (typeof browser === "object" && browser && browser.runtime && typeof browser.runtime.getURL === "function") return String(browser.runtime.getURL("/"));',
72
+ ' var b = globalThis.browser;',
73
+ ' if (typeof b === "object" && b && b.runtime && typeof b.runtime.getURL === "function") return String(b.runtime.getURL("/"));',
73
74
  ' } catch (error) {}',
74
75
  ' try {',
75
- ' if (typeof chrome === "object" && chrome && chrome.runtime && typeof chrome.runtime.getURL === "function") return String(chrome.runtime.getURL("/"));',
76
+ ' var c = globalThis.chrome;',
77
+ ' if (typeof c === "object" && c && c.runtime && typeof c.runtime.getURL === "function") return String(c.runtime.getURL("/"));',
76
78
  ' } catch (error) {}',
77
79
  ' try {',
78
80
  ' var base = (typeof globalThis === "object" && globalThis && globalThis.__EXTJS_EXTENSION_BASE__) ? String(globalThis.__EXTJS_EXTENSION_BASE__) : "";',
package/dist/832~0.mjs CHANGED
@@ -8,7 +8,7 @@ import node_fs from "node:fs";
8
8
  import node_path from "node:path";
9
9
  import { getSpecialFoldersData } from "browser-extension-manifest-fields";
10
10
  import pintor from "pintor";
11
- import { devtoolsEngineFor, managedDependencyConflict, resolveProjectStructureSync, getDirs, computePreviewOutputPath, eventsPath as session_paths_eventsPath, anotherDevSessionActive, previewingSourceFallback, asAbsolute, previewing, starting, debugPreviewOutput, ensureSessionArtifactsIgnoreFile, debugDirs, debugBrowser, readyContractPath, configLoadingError, normalizeBrowser, previewingCustomOutput, browserArtifactsDir, getProjectStructure, isUsingExperimentalConfig as messages_isUsingExperimentalConfig, getDistPath, configBrowserOrThrow } from "./950~0.mjs";
11
+ import { devtoolsEngineFor, managedDependencyConflict, resolveProjectStructureSync, getDirs, computePreviewOutputPath, eventsPath as session_paths_eventsPath, anotherDevSessionActive, previewingSourceFallback, asAbsolute, displayPath, previewing, starting, debugPreviewOutput, ensureSessionArtifactsIgnoreFile, debugDirs, debugBrowser, readyContractPath, configLoadingError, normalizeBrowser, collapseHomeDir, previewingCustomOutput, browserArtifactsDir, getProjectStructure, isUsingExperimentalConfig as messages_isUsingExperimentalConfig, getDistPath, configBrowserOrThrow } from "./950~0.mjs";
12
12
  import { isChromiumBasedBrowser, isWebkitBasedBrowser, isGeckoBasedBrowser } from "./331~0.mjs";
13
13
  import { humanWarn, isDebug, browserRowValue, artifactNoun, prefix as messaging_prefix, card, humanLine } from "./852~0.mjs";
14
14
  import { stripBom, parseJsonSafe, readProjectDependencies } from "./731~0.mjs";
@@ -19,7 +19,7 @@ import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
19
19
  import * as __rspack_external_node_os_4f3c9d58 from "node:os";
20
20
  import * as __rspack_external_node_path_806ed179 from "node:path";
21
21
  import * as __rspack_external_node_vm_ef240610 from "node:vm";
22
- var package_namespaceObject = /*#__PURE__*/ JSON.parse('{"rE":"4.1.20","El":{"@prefresh/core":"1.5.9","@prefresh/utils":"1.2.1","@rspack/core":"^2.2.3","@rspack/dev-server":"2.1.0","@rspack/plugin-preact-refresh":"2.0.1","@rspack/plugin-react-refresh":"2.0.2","@vue/compiler-sfc":"3.5.26","acorn":"^8.16.0","browser-extension-manifest-fields":"^3.0.1","case-sensitive-paths-webpack-plugin":"^2.4.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","es-module-lexer":"^3.0.2","extension-from-store":"^0.2.5","fflate":"^0.8.3","go-git-it":"^5.1.5","ignore":"^7.0.5","less":"4.6.7","less-loader":"13.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","postcss":"8.5.23","postcss-loader":"8.2.1","postcss-preset-env":"11.1.1","postcss-scss":"4.0.9","preact":"10.27.3","prefers-yarn":"2.0.1","react-refresh":"0.18.0","sass-loader":"17.0.0","schema-utils":"^4.3.3","svelte-loader":"3.2.4","tiny-glob":"^0.2.9","vue":"3.5.26","vue-loader":"17.4.2","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.20.1"}}');
22
+ var package_namespaceObject = /*#__PURE__*/ JSON.parse('{"rE":"4.1.22","El":{"@prefresh/core":"1.5.9","@prefresh/utils":"1.2.1","@rspack/core":"^2.2.3","@rspack/dev-server":"2.1.0","@rspack/plugin-preact-refresh":"2.0.1","@rspack/plugin-react-refresh":"2.0.2","@vue/compiler-sfc":"3.5.26","acorn":"^8.16.0","browser-extension-manifest-fields":"^3.0.1","case-sensitive-paths-webpack-plugin":"^2.4.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","es-module-lexer":"^3.0.2","extension-from-store":"^0.2.5","fflate":"^0.8.3","go-git-it":"^5.1.5","ignore":"^7.0.5","less":"4.6.7","less-loader":"13.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","postcss":"8.5.23","postcss-loader":"8.2.1","postcss-preset-env":"11.1.1","postcss-scss":"4.0.9","preact":"10.27.3","prefers-yarn":"2.0.1","react-refresh":"0.18.0","sass-loader":"17.0.0","schema-utils":"^4.3.3","svelte-loader":"3.2.4","tiny-glob":"^0.2.9","vue":"3.5.26","vue-loader":"17.4.2","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.20.1"}}');
23
23
  const preloadedEnvKeys = new Set();
24
24
  function getPreloadedEnvKeys() {
25
25
  return preloadedEnvKeys;
@@ -673,6 +673,7 @@ function createPlaywrightMetadataWriter(options) {
673
673
  if ('number' == typeof prev.rdpPort) payload.rdpPort = prev.rdpPort;
674
674
  if ('string' == typeof prev.profilePath) payload.profilePath = prev.profilePath;
675
675
  if ('number' == typeof prev.browserPid) payload.browserPid = prev.browserPid;
676
+ if ('number' == typeof prev.launcherPid) payload.launcherPid = prev.launcherPid;
676
677
  if ('string' == typeof prev.binary && prev.binary) payload.binary = prev.binary;
677
678
  if ('string' == typeof prev.binaryProvenance && prev.binaryProvenance) payload.binaryProvenance = prev.binaryProvenance;
678
679
  if ('string' == typeof prev.extensionId && prev.extensionId) payload.extensionId = prev.extensionId;
@@ -1112,14 +1113,11 @@ async function resolveCompanionExtensionsConfig(opts) {
1112
1113
  function serverRestartRequiredFromSpecialFolderMessageOnly(addingOrRemoving, folder, typeOfAsset) {
1113
1114
  return `${messaging_prefix('warn')} ${addingOrRemoving} ${pintor.yellow(typeOfAsset)} in ${pintor.underline(`${folder}/`)} changes the extension entrypoints.\nRestart the dev server to apply the change.`;
1114
1115
  }
1115
- function displayPath(absolutePath) {
1116
- return absolutePath.replace(/\\/g, '/');
1116
+ function publicMustBeAtProjectRoot(foundAt, expectedAt, projectRoot) {
1117
+ return `The public folder sits in the legacy next-to-manifest location.\nGOT ${displayPath(foundAt, projectRoot)}\nEXPECTED ${displayPath(expectedAt, projectRoot)}\nStatic files ship from the extension root, so public/ is canonically placed at the project root.\nThe build uses it either way.\nMove the folder to the project root to silence this warning.`;
1117
1118
  }
1118
- function publicMustBeAtProjectRoot(foundAt, expectedAt) {
1119
- return `The public folder sits in the legacy next-to-manifest location.\nGOT ${displayPath(foundAt)}\nEXPECTED ${displayPath(expectedAt)}\nStatic files ship from the extension root, so public/ is canonically placed at the project root.\nThe build uses it either way.\nMove the folder to the project root to silence this warning.`;
1120
- }
1121
- function publicFolderShadowed(usedAt, ignoredAt) {
1122
- return `Two public folders were found and only one is copied into the build.\nUSING ${displayPath(usedAt)}\nIGNORED ${displayPath(ignoredAt)}\npublic/ is canonically placed at the project root, and that copy wins.\nFiles that exist only in the ignored folder do not ship.\nMove or merge the ignored folder to silence this warning.`;
1119
+ function publicFolderShadowed(usedAt, ignoredAt, projectRoot) {
1120
+ return `Two public folders were found and only one is copied into the build.\nUSING ${displayPath(usedAt, projectRoot)}\nIGNORED ${displayPath(ignoredAt, projectRoot)}\npublic/ is canonically placed at the project root, and that copy wins.\nFiles that exist only in the ignored folder do not ship.\nMove or merge the ignored folder to silence this warning.`;
1123
1121
  }
1124
1122
  function specialFoldersSetupSummary(hasPublic, copyEnabled, ignoredCount) {
1125
1123
  return `${messaging_prefix('debug')} folders setup public=${String(hasPublic)} copy=${String(copyEnabled)} ignored=${String(ignoredCount)}`;
@@ -1511,15 +1509,6 @@ function getExtensionVersion() {
1511
1509
  }
1512
1510
  })();
1513
1511
  }
1514
- function collapseHomeDirInCardValue(value) {
1515
- const raw = String(value || '');
1516
- const home = __rspack_external_node_os_4f3c9d58.homedir();
1517
- if (!home || !raw.startsWith(home)) return raw;
1518
- const rest = raw.slice(home.length);
1519
- if ('' === rest) return '~';
1520
- if (rest.startsWith(__rspack_external_node_path_806ed179.sep) || rest.startsWith('/')) return `~${rest}`;
1521
- return raw;
1522
- }
1523
1512
  function browserRunnerDisabled(args) {
1524
1513
  const manifest = readJsonRecord(args.manifestPath);
1525
1514
  const ready = readJsonRecord(args.readyPath);
@@ -1551,7 +1540,7 @@ function browserRunnerDisabled(args) {
1551
1540
  },
1552
1541
  {
1553
1542
  label: 'Output',
1554
- value: collapseHomeDirInCardValue(String(args.distPath || '').trim())
1543
+ value: collapseHomeDir(String(args.distPath || '').trim())
1555
1544
  }
1556
1545
  ]
1557
1546
  });