extension-develop 4.0.11 → 4.0.12

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 (274) hide show
  1. package/dist/0~dev-server.mjs +1 -1
  2. package/dist/0~rspack-config.mjs +107 -3154
  3. package/dist/101.mjs +32 -4
  4. package/dist/266.mjs +1 -4
  5. package/dist/839.mjs +3156 -59
  6. package/dist/bridge-entry.d.ts +5 -0
  7. package/dist/command-build.d.ts +3 -0
  8. package/dist/command-dev.d.ts +5 -0
  9. package/dist/command-preview.d.ts +30 -0
  10. package/dist/dev-server/auto-exit.d.ts +1 -0
  11. package/dist/dev-server/cleanup.d.ts +11 -0
  12. package/dist/dev-server/compiler-hooks.d.ts +9 -0
  13. package/dist/dev-server/connectable-host.d.ts +2 -0
  14. package/dist/dev-server/control-bridge/actions-file.d.ts +38 -0
  15. package/dist/dev-server/control-bridge/broker.d.ts +122 -0
  16. package/dist/dev-server/control-bridge/consumer-client.d.ts +43 -0
  17. package/dist/dev-server/control-bridge/contracts.d.ts +164 -0
  18. package/dist/dev-server/control-bridge/control-port-store.d.ts +25 -0
  19. package/dist/dev-server/control-bridge/controller-client.d.ts +30 -0
  20. package/dist/dev-server/control-bridge/logs-file.d.ts +30 -0
  21. package/dist/dev-server/control-bridge/producer-runtime.d.ts +30 -0
  22. package/dist/dev-server/control-bridge/ring-buffer.d.ts +21 -0
  23. package/dist/dev-server/control-bridge/session-token.d.ts +18 -0
  24. package/dist/dev-server/control-bridge/ws-control-server.d.ts +13 -0
  25. package/dist/dev-server/frameworks.d.ts +2 -0
  26. package/dist/dev-server/index.d.ts +3 -0
  27. package/dist/dev-server/messages.d.ts +17 -0
  28. package/dist/dev-server/port-manager.d.ts +17 -0
  29. package/dist/extension-js-devtools/extension-js/chrome/events.ndjson +2 -6
  30. package/dist/extension-js-devtools/extension-js/chrome/ready.json +9 -6
  31. package/dist/extension-js-devtools/extension-js/chromium/events.ndjson +2 -6
  32. package/dist/extension-js-devtools/extension-js/chromium/ready.json +9 -6
  33. package/dist/extension-js-devtools/extension-js/edge/events.ndjson +2 -6
  34. package/dist/extension-js-devtools/extension-js/edge/ready.json +9 -6
  35. package/dist/extension-js-devtools/extension-js/firefox/events.ndjson +2 -6
  36. package/dist/extension-js-devtools/extension-js/firefox/ready.json +9 -6
  37. package/dist/extension-js-theme/extension-js/chrome/events.ndjson +2 -6
  38. package/dist/extension-js-theme/extension-js/chrome/ready.json +9 -6
  39. package/dist/extension-js-theme/extension-js/chromium/events.ndjson +2 -6
  40. package/dist/extension-js-theme/extension-js/chromium/ready.json +9 -6
  41. package/dist/extension-js-theme/extension-js/edge/events.ndjson +2 -6
  42. package/dist/extension-js-theme/extension-js/edge/ready.json +9 -6
  43. package/dist/extension-js-theme/extension-js/firefox/events.ndjson +2 -8
  44. package/dist/extension-js-theme/extension-js/firefox/ready.json +9 -6
  45. package/dist/lib/branding.d.ts +7 -0
  46. package/dist/lib/build-summary.d.ts +9 -0
  47. package/dist/lib/config-loader.d.ts +38 -0
  48. package/dist/lib/constants.d.ts +11 -0
  49. package/dist/lib/dark-mode.d.ts +9 -0
  50. package/dist/lib/dev-server-client-import.d.ts +4 -0
  51. package/dist/lib/develop-context.d.ts +3 -0
  52. package/dist/lib/ensure-develop-artifacts.d.ts +10 -0
  53. package/dist/lib/extensions-to-load.d.ts +1 -0
  54. package/dist/lib/generate-extension-types.d.ts +1 -0
  55. package/dist/lib/has-dependency.d.ts +6 -0
  56. package/dist/lib/manifest-utils.d.ts +2 -0
  57. package/dist/lib/messages.d.ts +55 -0
  58. package/dist/lib/optional-dependency-types.d.ts +14 -0
  59. package/dist/lib/optional-deps-contracts.d.ts +13 -0
  60. package/dist/lib/optional-deps-resolver.d.ts +41 -0
  61. package/dist/lib/package-json.d.ts +3 -0
  62. package/dist/lib/package-manager.d.ts +61 -0
  63. package/dist/lib/parse-json-safe.d.ts +13 -0
  64. package/dist/lib/paths.d.ts +19 -0
  65. package/dist/lib/project-manifest.d.ts +60 -0
  66. package/dist/lib/project.d.ts +7 -0
  67. package/dist/lib/resource-path.d.ts +4 -0
  68. package/dist/lib/rust-min-stack.d.ts +2 -0
  69. package/dist/lib/sanitize.d.ts +1 -0
  70. package/dist/lib/session-paths.d.ts +39 -0
  71. package/dist/lib/stats-handler.d.ts +1 -0
  72. package/dist/lib/transpile-packages.d.ts +7 -0
  73. package/dist/lib/validate-user-dependencies.d.ts +1 -0
  74. package/dist/lib/zip.d.ts +2 -0
  75. package/dist/module.d.ts +8 -0
  76. package/dist/plugin-browsers/index.d.ts +108 -0
  77. package/dist/plugin-browsers/safari-dev-plugin.d.ts +19 -0
  78. package/dist/plugin-compatibility/compatibility-lib/messages.d.ts +5 -0
  79. package/dist/plugin-compatibility/feature-polyfill.d.ts +11 -0
  80. package/dist/plugin-compatibility/index.d.ts +12 -0
  81. package/dist/plugin-compilation/boring.d.ts +11 -0
  82. package/dist/plugin-compilation/clean-dist.d.ts +8 -0
  83. package/dist/plugin-compilation/compilation-lib/messages.d.ts +11 -0
  84. package/dist/plugin-compilation/compilation-lib/shared-state.d.ts +7 -0
  85. package/dist/plugin-compilation/env.d.ts +17 -0
  86. package/dist/plugin-compilation/index.d.ts +22 -0
  87. package/dist/plugin-compilation/zip.d.ts +18 -0
  88. package/dist/plugin-css/common-style-loaders.d.ts +8 -0
  89. package/dist/plugin-css/css-in-content-script-loader.d.ts +4 -0
  90. package/dist/plugin-css/css-in-html-loader.d.ts +4 -0
  91. package/dist/plugin-css/css-lib/build-css-rules.d.ts +12 -0
  92. package/dist/plugin-css/css-lib/inject-css-link.d.ts +16 -0
  93. package/dist/plugin-css/css-lib/is-content-script.d.ts +1 -0
  94. package/dist/plugin-css/css-lib/messages.d.ts +9 -0
  95. package/dist/plugin-css/css-lib/resolve-css-asset.d.ts +21 -0
  96. package/dist/plugin-css/css-parse-guard-loader.d.ts +8 -0
  97. package/dist/plugin-css/css-tools/less.d.ts +7 -0
  98. package/dist/plugin-css/css-tools/postcss.d.ts +4 -0
  99. package/dist/plugin-css/css-tools/sass.d.ts +10 -0
  100. package/dist/plugin-css/css-tools/tailwind.d.ts +2 -0
  101. package/dist/plugin-css/index.d.ts +26 -0
  102. package/dist/plugin-css/preprocessor-passthrough-loader.d.ts +6 -0
  103. package/dist/plugin-js-frameworks/frameworks-lib/integrations.d.ts +4 -0
  104. package/dist/plugin-js-frameworks/index.d.ts +18 -0
  105. package/dist/plugin-js-frameworks/js-frameworks-lib/load-loader-options.d.ts +2 -0
  106. package/dist/plugin-js-frameworks/js-frameworks-lib/messages.d.ts +10 -0
  107. package/dist/plugin-js-frameworks/js-tools/preact.d.ts +3 -0
  108. package/dist/plugin-js-frameworks/js-tools/react.d.ts +8 -0
  109. package/dist/plugin-js-frameworks/js-tools/svelte.d.ts +4 -0
  110. package/dist/plugin-js-frameworks/js-tools/typescript.d.ts +37 -0
  111. package/dist/plugin-js-frameworks/js-tools/vue.d.ts +3 -0
  112. package/dist/plugin-perf-budgets/categorize.d.ts +3 -0
  113. package/dist/plugin-perf-budgets/index.d.ts +34 -0
  114. package/dist/plugin-perf-budgets/messages.d.ts +8 -0
  115. package/dist/plugin-playwright/index.d.ts +89 -0
  116. package/dist/plugin-reload/classify-reload.d.ts +86 -0
  117. package/dist/plugin-reload/index.d.ts +29 -0
  118. package/dist/plugin-reload/messages.d.ts +1 -0
  119. package/dist/plugin-reload/reload-dispatch.d.ts +46 -0
  120. package/dist/plugin-reload/reload-lib/minimum-files/minimum-background-file-chromium.d.ts +0 -0
  121. package/dist/plugin-reload/reload-lib/minimum-files/minimum-background-file-firefox.d.ts +0 -0
  122. package/dist/plugin-reload/reload-lib/scripts-replay-shim.d.ts +19 -0
  123. package/dist/plugin-reload/steps/inject-bridge-producer.d.ts +14 -0
  124. package/dist/plugin-reload/steps/inject-bridge-relay.d.ts +4 -0
  125. package/dist/plugin-reload/steps/inject-scripts-replay-shim.d.ts +10 -0
  126. package/dist/plugin-reload/steps/prune-stale-hot-updates.d.ts +20 -0
  127. package/dist/plugin-reload/steps/remove-content-script-dev-server-runtime.d.ts +2 -0
  128. package/dist/plugin-reload/steps/setup-reload-strategy/index.d.ts +9 -0
  129. package/dist/plugin-reload/steps/setup-reload-strategy/setup-background-entry.d.ts +13 -0
  130. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/index.d.ts +2 -0
  131. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/ChunkLoader.d.ts +9 -0
  132. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/HMRDevServer.d.ts +3 -0
  133. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/InitialChunkFile.d.ts +5 -0
  134. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/NoDangerNamePlugin.d.ts +3 -0
  135. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/AutoPublicPath.d.ts +2 -0
  136. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/BaseUri.d.ts +2 -0
  137. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/BrowserRuntime.d.ts +8 -0
  138. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/ChunkLoaderFallback.d.ts +1 -0
  139. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/EagerlyLoadChunks.d.ts +1 -0
  140. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/LoadScript.d.ts +4 -0
  141. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/PublicPath.d.ts +2 -0
  142. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/ServiceWorkerPlugin.d.ts +6 -0
  143. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/helper.d.ts +12 -0
  144. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/index.d.ts +5 -0
  145. package/dist/plugin-reload/steps/strip-content-script-dev-server-runtime.d.ts +4 -0
  146. package/dist/plugin-special-folders/check-manifest-in-public.d.ts +2 -0
  147. package/dist/plugin-special-folders/emit-root-absolute-refs.d.ts +2 -0
  148. package/dist/plugin-special-folders/folder-extensions/resolve-config.d.ts +6 -0
  149. package/dist/plugin-special-folders/folder-extensions/resolve-dirs.d.ts +5 -0
  150. package/dist/plugin-special-folders/folder-extensions/types.d.ts +17 -0
  151. package/dist/plugin-special-folders/folder-extensions/utils.d.ts +9 -0
  152. package/dist/plugin-special-folders/get-data.d.ts +12 -0
  153. package/dist/plugin-special-folders/index.d.ts +20 -0
  154. package/dist/plugin-special-folders/messages.d.ts +3 -0
  155. package/dist/plugin-special-folders/warn-upon-folder-changes.d.ts +13 -0
  156. package/dist/plugin-static-assets/index.d.ts +10 -0
  157. package/dist/plugin-static-assets/static-assets-lib/messages.d.ts +8 -0
  158. package/dist/plugin-wasm/index.d.ts +15 -0
  159. package/dist/plugin-web-extension/feature-html/html-lib/assets.d.ts +2 -0
  160. package/dist/plugin-web-extension/feature-html/html-lib/inject.d.ts +4 -0
  161. package/dist/plugin-web-extension/feature-html/html-lib/messages.d.ts +24 -0
  162. package/dist/plugin-web-extension/feature-html/html-lib/parse-html.d.ts +8 -0
  163. package/dist/plugin-web-extension/feature-html/html-lib/patch-html.d.ts +8 -0
  164. package/dist/plugin-web-extension/feature-html/html-lib/utils.d.ts +46 -0
  165. package/dist/plugin-web-extension/feature-html/index.d.ts +36 -0
  166. package/dist/plugin-web-extension/feature-html/steps/add-assets-to-compilation.d.ts +9 -0
  167. package/dist/plugin-web-extension/feature-html/steps/add-scripts-and-styles-to-compilation.d.ts +9 -0
  168. package/dist/plugin-web-extension/feature-html/steps/add-to-file-dependencies.d.ts +9 -0
  169. package/dist/plugin-web-extension/feature-html/steps/emit-html-file.d.ts +9 -0
  170. package/dist/plugin-web-extension/feature-html/steps/ensure-hmr-for-scripts.d.ts +2 -0
  171. package/dist/plugin-web-extension/feature-html/steps/handle-common-errors.d.ts +9 -0
  172. package/dist/plugin-web-extension/feature-html/steps/minimum-script-file.d.ts +1 -0
  173. package/dist/plugin-web-extension/feature-html/steps/preact-refresh-shim.d.ts +1 -0
  174. package/dist/plugin-web-extension/feature-html/steps/throw-if-recompile-is-needed.d.ts +12 -0
  175. package/dist/plugin-web-extension/feature-html/steps/update-html-file.d.ts +9 -0
  176. package/dist/plugin-web-extension/feature-icons/index.d.ts +22 -0
  177. package/dist/plugin-web-extension/feature-icons/messages.d.ts +12 -0
  178. package/dist/plugin-web-extension/feature-icons/normalize-keys.d.ts +3 -0
  179. package/dist/plugin-web-extension/feature-icons/steps/add-to-file-dependencies.d.ts +8 -0
  180. package/dist/plugin-web-extension/feature-icons/steps/emit-file.d.ts +8 -0
  181. package/dist/plugin-web-extension/feature-json/index.d.ts +18 -0
  182. package/dist/plugin-web-extension/feature-json/json-validation.d.ts +3 -0
  183. package/dist/plugin-web-extension/feature-json/messages.d.ts +17 -0
  184. package/dist/plugin-web-extension/feature-json/process-assets.d.ts +2 -0
  185. package/dist/plugin-web-extension/feature-json/track-dependencies.d.ts +2 -0
  186. package/dist/plugin-web-extension/feature-locales/compilation-error.d.ts +2 -0
  187. package/dist/plugin-web-extension/feature-locales/get-locales.d.ts +2 -0
  188. package/dist/plugin-web-extension/feature-locales/index.d.ts +12 -0
  189. package/dist/plugin-web-extension/feature-locales/messages.d.ts +13 -0
  190. package/dist/plugin-web-extension/feature-locales/process-assets.d.ts +2 -0
  191. package/dist/plugin-web-extension/feature-locales/track-dependencies.d.ts +2 -0
  192. package/dist/plugin-web-extension/feature-locales/validation.d.ts +2 -0
  193. package/dist/plugin-web-extension/feature-manifest/index.d.ts +21 -0
  194. package/dist/plugin-web-extension/feature-manifest/manifest-lib/manifest.d.ts +10 -0
  195. package/dist/plugin-web-extension/feature-manifest/manifest-lib/sanitize-fatal-shapes.d.ts +45 -0
  196. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/background.d.ts +6 -0
  197. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/chrome_url_overrides.d.ts +8 -0
  198. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/commands.d.ts +16 -0
  199. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/content_scripts.d.ts +4 -0
  200. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/content_security_policy.d.ts +4 -0
  201. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/devtools_page.d.ts +4 -0
  202. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/icons.d.ts +6 -0
  203. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/index.d.ts +2 -0
  204. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/omnibox.d.ts +9 -0
  205. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/options_page.d.ts +4 -0
  206. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/options_ui.d.ts +8 -0
  207. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/page_action.d.ts +8 -0
  208. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/permissions.d.ts +4 -0
  209. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/sandbox.d.ts +7 -0
  210. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/sidebar_action.d.ts +2 -0
  211. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/storage.d.ts +6 -0
  212. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/theme.d.ts +2 -0
  213. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/user_scripts.d.ts +2 -0
  214. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/web_accessible_resources.d.ts +4 -0
  215. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/index.d.ts +2 -0
  216. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/background.d.ts +6 -0
  217. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/browser_action.d.ts +12 -0
  218. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/chrome_settings_overrides.d.ts +24 -0
  219. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/index.d.ts +2 -0
  220. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/theme_experiment.d.ts +7 -0
  221. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/action.d.ts +8 -0
  222. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/background.d.ts +6 -0
  223. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/declarative_net_request.d.ts +2 -0
  224. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/host_permissions.d.ts +4 -0
  225. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/index.d.ts +2 -0
  226. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/side_panel.d.ts +2 -0
  227. package/dist/plugin-web-extension/feature-manifest/messages.d.ts +9 -0
  228. package/dist/plugin-web-extension/feature-manifest/normalize-manifest-path.d.ts +3 -0
  229. package/dist/plugin-web-extension/feature-manifest/steps/add-dependencies.d.ts +6 -0
  230. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-background.d.ts +10 -0
  231. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-csp.d.ts +5 -0
  232. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-externally-connectable.d.ts +10 -0
  233. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-web-resources.d.ts +19 -0
  234. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults.d.ts +12 -0
  235. package/dist/plugin-web-extension/feature-manifest/steps/emit-manifest.d.ts +7 -0
  236. package/dist/plugin-web-extension/feature-manifest/steps/legacy-warnings.d.ts +5 -0
  237. package/dist/plugin-web-extension/feature-manifest/steps/patch-chromium-background.d.ts +15 -0
  238. package/dist/plugin-web-extension/feature-manifest/steps/patch-dev-content-script-manifest-paths.d.ts +11 -0
  239. package/dist/plugin-web-extension/feature-manifest/steps/patch-gecko-background.d.ts +15 -0
  240. package/dist/plugin-web-extension/feature-manifest/steps/patch-war.d.ts +15 -0
  241. package/dist/plugin-web-extension/feature-manifest/steps/persist-manifest.d.ts +4 -0
  242. package/dist/plugin-web-extension/feature-manifest/steps/update-manifest.d.ts +9 -0
  243. package/dist/plugin-web-extension/feature-scripts/contracts.d.ts +12 -0
  244. package/dist/plugin-web-extension/feature-scripts/index.d.ts +19 -0
  245. package/dist/plugin-web-extension/feature-scripts/messages.d.ts +7 -0
  246. package/dist/plugin-web-extension/feature-scripts/scripts-lib/utils.d.ts +2 -0
  247. package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/classic-concat-loader.d.ts +8 -0
  248. package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/content-script-wrapper.d.ts +13 -0
  249. package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/get-bridge-scripts.d.ts +6 -0
  250. package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/index.d.ts +11 -0
  251. package/dist/plugin-web-extension/feature-scripts/steps/add-public-path-runtime-module.d.ts +4 -0
  252. package/dist/plugin-web-extension/feature-scripts/steps/add-scripts.d.ts +9 -0
  253. package/dist/plugin-web-extension/feature-scripts/steps/keep-geturl-imports-native.d.ts +15 -0
  254. package/dist/plugin-web-extension/feature-scripts/steps/native-geturl-import-loader.d.ts +3 -0
  255. package/dist/plugin-web-extension/feature-scripts/steps/trace-runtime-loaded-files.d.ts +41 -0
  256. package/dist/plugin-web-extension/feature-scripts/steps/validate-content-script-syntax.d.ts +18 -0
  257. package/dist/plugin-web-extension/feature-web-resources/collect-entry-imports.d.ts +3 -0
  258. package/dist/plugin-web-extension/feature-web-resources/index.d.ts +19 -0
  259. package/dist/plugin-web-extension/feature-web-resources/steps/collect-content-entry-imports.d.ts +10 -0
  260. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/clean-matches.d.ts +7 -0
  261. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/generate-manifest.d.ts +11 -0
  262. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/messages.d.ts +10 -0
  263. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/resolve-war.d.ts +9 -0
  264. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/shared.d.ts +4 -0
  265. package/dist/plugin-web-extension/index.d.ts +9 -0
  266. package/dist/plugin-web-extension/shared/classic-concat.d.ts +18 -0
  267. package/dist/plugin-web-extension/shared/compilation-issues.d.ts +6 -0
  268. package/dist/plugin-web-extension/shared/manifest-fields-change-detector.d.ts +12 -0
  269. package/dist/plugin-web-extension/shared/paths.d.ts +26 -0
  270. package/dist/preview-entry.d.ts +3 -0
  271. package/dist/rslib.config.d.ts +3 -0
  272. package/dist/rspack-config.d.ts +4 -0
  273. package/dist/types.d.ts +406 -0
  274. package/package.json +3 -3
@@ -0,0 +1,29 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { PluginInterface, DevOptions } from '../types';
3
+ export { type ReloadType, type ReloadInstruction, type SourceFeatureIndex, formatReloadContextLabel, pageContextFromSources, buildSourceFeatureIndex, classifyReloadFromSources, readContentScriptCount } from './classify-reload';
4
+ export { type ChangedSourcesSnapshot, type ChangedSourcesTracker, createChangedSourcesTracker, dispatchReload, type ReloadBroker, type ReloadExecutor } from './reload-dispatch';
5
+ /**
6
+ * ReloadPlugin owns the dev-only reload/HMR strategy end to end:
7
+ *
8
+ * - build-time injection of the reload runtime (SetupReloadStrategy and the
9
+ * vendored webpack-target-webextension fork), the SW scripts-replay shim,
10
+ * and the control-bridge producer/relay instrumentation
11
+ * - the reload classifier and dispatch seam consumed by plugin-browsers'
12
+ * BrowsersPlugin and the dev server's `--no-browser` broadcast path
13
+ * (re-exported above from classify-reload.ts / reload-dispatch.ts)
14
+ *
15
+ * Registration order matters: this plugin must be applied AFTER
16
+ * plugin-web-extension — SetupReloadStrategy decorates the background and
17
+ * content-script entries that feature-scripts' AddScripts declares.
18
+ *
19
+ * The whole pipeline is dev-only; `EXTENSION_NO_RELOAD=true` opts out. The
20
+ * every-mode content-script wrapper (mount lifecycle) is NOT part of this
21
+ * plugin — it lives in feature-scripts/steps/add-content-script-wrapper.
22
+ */
23
+ export declare class ReloadPlugin {
24
+ static readonly name = "plugin-reload";
25
+ readonly manifestPath: string;
26
+ readonly browser?: DevOptions['browser'];
27
+ constructor(options: PluginInterface);
28
+ apply(compiler: Compiler): void;
29
+ }
@@ -0,0 +1 @@
1
+ export declare function backgroundIsRequiredMessageOnly(backgroundChunkName: string): string;
@@ -0,0 +1,46 @@
1
+ import type { Compiler } from '@rspack/core';
2
+ import type { ReloadInstruction } from './classify-reload';
3
+ export interface ReloadBroker {
4
+ broadcastReload(instruction: {
5
+ type: ReloadInstruction['type'];
6
+ changedContentScriptEntries?: string[];
7
+ label?: string;
8
+ changedFiles?: string[];
9
+ }): number;
10
+ }
11
+ export interface ReloadExecutor {
12
+ broker?: ReloadBroker;
13
+ }
14
+ /**
15
+ * The one stdout announcement per dispatched reload. Prints the SAME label the
16
+ * producer echoes into the page's devtools console and the devtools-extension
17
+ * pill renders — one server-built string, three surfaces, zero drift.
18
+ */
19
+ export declare function formatReloadingLine(label: string): string;
20
+ /**
21
+ * The single place that decides HOW a classified reload is executed: the SW
22
+ * producer re-injects via the control bridge, the SAME mechanism for launched
23
+ * (Chromium + Firefox) and `--no-browser`. A launched browser's CDP/RDP
24
+ * controller is kept for logging / source inspection, not reload.
25
+ *
26
+ * Both modes already share the reload DECISION (classifyReloadFromSources); this
27
+ * is the shared dispatch seam. Honors EXTENSION_NO_RELOAD (emit the new dist,
28
+ * but don't reload).
29
+ */
30
+ export declare function dispatchReload(instruction: ReloadInstruction | undefined, executor: ReloadExecutor): Promise<void>;
31
+ export interface ChangedSourcesSnapshot {
32
+ /** A manifest.json / _locales change — forces a full reload regardless of which other files changed. */
33
+ forcedFull: boolean;
34
+ /** Project-relative, forward-slashed paths of every file changed since the last compile. */
35
+ changedSources: string[];
36
+ }
37
+ export interface ChangedSourcesTracker {
38
+ snapshot(): ChangedSourcesSnapshot;
39
+ }
40
+ /**
41
+ * Taps `watchRun` and records the files changed for the next compile, shared by
42
+ * the launched (BrowsersPlugin) and `--no-browser` (dev server) reload paths so
43
+ * the collection logic isn't duplicated. Read it in the `done` hook via
44
+ * `snapshot()` and feed it to classifyReloadFromSources.
45
+ */
46
+ export declare function createChangedSourcesTracker(compiler: Compiler): ChangedSourcesTracker;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Dev-only banner prepended to the background service worker / script. Wraps
3
+ * `chrome.scripting.executeScript` so the SDK can replay the same programmatic
4
+ * injections after a user edits a file in `/scripts/*`.
5
+ *
6
+ * Without this, editing `/scripts/script-one.js` rebuilds the bundle on disk
7
+ * but the previously-injected DOM stays stale until the user manually
8
+ * re-triggers whatever called `executeScript`. With this shim plus the
9
+ * controller-side trigger, `/scripts/*` edits behave like declarative
10
+ * `content_scripts` edits: the SDK re-executes the same injection on the
11
+ * same tab, and the wrapper around each `/scripts/<name>.js` (which runs
12
+ * via `__EXTENSIONJS_mount`) handles old-mount teardown.
13
+ *
14
+ * Storage: in-memory `Map` keyed by tabId. Lives on the SW's globalThis, so
15
+ * it survives across multiple `executeScript` calls in the same SW lifetime
16
+ * and dies when Chrome cycles the SW. That's fine for dev — the next click
17
+ * after a SW restart re-records the call.
18
+ */
19
+ export declare const SCRIPTS_REPLAY_SHIM_SOURCE = ";(function () {\n try {\n if (typeof globalThis !== \"object\" || !globalThis) return;\n var chromeRef =\n (globalThis.chrome && globalThis.chrome.scripting && typeof globalThis.chrome.scripting.executeScript === \"function\")\n ? globalThis.chrome\n : (globalThis.browser && globalThis.browser.scripting && typeof globalThis.browser.scripting.executeScript === \"function\")\n ? globalThis.browser\n : null;\n if (!chromeRef) return;\n if (globalThis.__extjsScriptsReplayInstalled) return;\n globalThis.__extjsScriptsReplayInstalled = true;\n\n var registry = new Map();\n var originalExecuteScript = chromeRef.scripting.executeScript.bind(chromeRef.scripting);\n\n var serialize = function (entry) {\n try {\n return JSON.stringify({\n files: entry && Array.isArray(entry.files) ? entry.files : [],\n world: entry && entry.world ? String(entry.world) : \"\"\n });\n } catch (error) {\n return \"\";\n }\n };\n\n var track = function (injection) {\n try {\n var tabId = injection && injection.target && injection.target.tabId;\n var files =\n injection && Array.isArray(injection.files) ? injection.files.slice() : null;\n if (typeof tabId !== \"number\") return;\n if (!files || !files.length) return;\n var world = injection.world ? String(injection.world) : undefined;\n var entry = { files: files, world: world, sig: serialize({ files: files, world: world }) };\n var existing = registry.get(tabId) || [];\n // Dedupe by signature \u2014 repeated identical injections (e.g. user\n // clicks the action twice) shouldn't stack in the replay list.\n if (existing.some(function (e) { return e.sig === entry.sig; })) return;\n existing.push(entry);\n // Cap to the most recent 50 distinct injections per tab so a misbehaving\n // user loop can't grow the registry unbounded.\n registry.set(tabId, existing.slice(-50));\n } catch (error) {\n // Tracking is best-effort; never break the user's executeScript call.\n }\n };\n\n chromeRef.scripting.executeScript = function (injection, callback) {\n track(injection);\n return originalExecuteScript(injection, callback);\n };\n\n var normalizeFile = function (value) {\n return String(value || \"\").replace(/^[/\\\\]+/, \"\");\n };\n\n var fileMatches = function (entryFile, changedNormalized) {\n var fn = normalizeFile(entryFile);\n for (var i = 0; i < changedNormalized.length; i++) {\n var c = changedNormalized[i];\n if (!c) continue;\n if (fn === c) return true;\n if (fn.length > c.length && fn.slice(fn.length - c.length - 1) === \"/\" + c) return true;\n if (c.length > fn.length && c.slice(c.length - fn.length - 1) === \"/\" + fn) return true;\n }\n return false;\n };\n\n globalThis.__extjsScriptsReplay = function (changedFiles) {\n var changedNormalized = (Array.isArray(changedFiles) ? changedFiles : []).map(normalizeFile);\n var promises = [];\n registry.forEach(function (entries, tabId) {\n entries.forEach(function (entry) {\n var matches = false;\n for (var i = 0; i < entry.files.length; i++) {\n if (fileMatches(entry.files[i], changedNormalized)) {\n matches = true;\n break;\n }\n }\n if (!matches) return;\n try {\n promises.push(\n originalExecuteScript({\n target: { tabId: tabId },\n files: entry.files,\n world: entry.world\n }).then(\n function () { return { ok: true, tabId: tabId, files: entry.files }; },\n function (error) {\n return {\n ok: false,\n tabId: tabId,\n files: entry.files,\n error: String((error && error.message) || error)\n };\n }\n )\n );\n } catch (error) {\n // Tab may have closed; skip silently.\n }\n });\n });\n return Promise.all(promises);\n };\n } catch (error) {\n // Best-effort shim; do not break the SW bootstrap on any failure.\n }\n})();\n";
@@ -0,0 +1,14 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ /**
3
+ * Prepends the agent-bridge producer to the compiled background SW so the
4
+ * user extension forwards its console output to the dev-server control WS
5
+ * (agent bridge). The control port + instanceId are read from process.env
6
+ * (set by dev-server/index.ts); when the bridge is unavailable the builder
7
+ * returns '' and nothing is injected.
8
+ *
9
+ * Mirrors InjectScriptsReplayShim: a late processAssets post-process that only
10
+ * touches the background entry, independent of banner-emission ordering.
11
+ */
12
+ export declare class InjectBridgeProducer {
13
+ apply(compiler: Compiler): void;
14
+ }
@@ -0,0 +1,4 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ export declare class InjectBridgeRelay {
3
+ apply(compiler: Compiler): void;
4
+ }
@@ -0,0 +1,10 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ /**
3
+ * Prepends the dev-only `globalThis.__extjsScriptsReplay` shim to the
4
+ * compiled background SW / script. Done as a `processAssets` post-process
5
+ * rather than via BannerPlugin so we only touch the background entry asset
6
+ * regardless of the bundler's banner-emission ordering.
7
+ */
8
+ export declare class InjectScriptsReplayShim {
9
+ apply(compiler: Compiler): void;
10
+ }
@@ -0,0 +1,20 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ /**
3
+ * Prune superseded hot-update generations from `dist/<browser>/hot/`.
4
+ *
5
+ * The HMR runtime resolves hot chunks against the extension origin
6
+ * (publicPath = chrome-extension://<id>/), so the files under hot/ are
7
+ * fetched FROM DISK and must ship in the loadable dist — but only the
8
+ * current generation is ever requested (currentHash -> nextHash). Without
9
+ * pruning, every edit leaves its .js/.json/.map generation behind forever:
10
+ * an afternoon of editing puts hundreds of stale files in the "what ships"
11
+ * tree, all churning fs watchers on each edit.
12
+ *
13
+ * The previous generation is kept one round as a grace window for an
14
+ * in-flight fetch racing the compile that superseded it.
15
+ */
16
+ export declare class PruneStaleHotUpdates {
17
+ static readonly name = "plugin-reload:prune-stale-hot-updates";
18
+ private previousGeneration;
19
+ apply(compiler: Compiler): void;
20
+ }
@@ -0,0 +1,2 @@
1
+ export declare function contentScriptRetainsDevServerRuntime(source: string): boolean;
2
+ export declare function stripDevServerStartupFromContentScript(source: string): string;
@@ -0,0 +1,9 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { PluginInterface } from '../../../types';
3
+ export declare class SetupReloadStrategy {
4
+ private readonly manifestPath;
5
+ private readonly browser;
6
+ constructor(options: PluginInterface);
7
+ private getEntryName;
8
+ apply(compiler: Compiler): void;
9
+ }
@@ -0,0 +1,13 @@
1
+ import { Compiler } from '@rspack/core';
2
+ import { type DevOptions } from '../../../types';
3
+ export declare class SetupBackgroundEntry {
4
+ private manifestPath;
5
+ private browser;
6
+ constructor(options: {
7
+ manifestPath: string;
8
+ browser?: DevOptions['browser'];
9
+ });
10
+ private getMissingBackgroundError;
11
+ private addDefaultEntry;
12
+ apply(compiler: Compiler): void;
13
+ }
@@ -0,0 +1,2 @@
1
+ import WebExtensionPlugin from './lib/webpack5/index';
2
+ export default WebExtensionPlugin;
@@ -0,0 +1,9 @@
1
+ export default class WebExtensionChuckLoaderRuntimePlugin {
2
+ private readonly pluginOptions;
3
+ private readonly options;
4
+ private readonly contentScriptsMeta;
5
+ private rspackAutoPublicPath;
6
+ constructor(options: any);
7
+ apply(compiler: any): void;
8
+ tap(compiler: any, compilation: any): void;
9
+ }
@@ -0,0 +1,3 @@
1
+ export default class DevServerConfigPlugin {
2
+ apply(compiler: any): void;
3
+ }
@@ -0,0 +1,5 @@
1
+ export default class WebExtensionContentScriptEntryPlugin {
2
+ private readonly options;
3
+ constructor(options: any);
4
+ apply(compiler: any): void;
5
+ }
@@ -0,0 +1,3 @@
1
+ export default class NoDangerNamePlugin {
2
+ apply(compiler: any): void;
3
+ }
@@ -0,0 +1,2 @@
1
+ import type * as webpack from 'webpack';
2
+ export default function AutoPublicPathRuntimeModule(webpack: typeof import('webpack')): webpack.RuntimeModule;
@@ -0,0 +1,2 @@
1
+ import type * as webpack from 'webpack';
2
+ export default function BaseUriRuntimeModule(webpack: typeof import('webpack')): webpack.RuntimeModule;
@@ -0,0 +1,8 @@
1
+ import type * as webpack from 'webpack';
2
+ export declare const RuntimeGlobal = "__webpack_require__.webExtRt";
3
+ export declare const RuntimeGlobalIsBrowser = "__webpack_require__.webExtRtModern";
4
+ /**
5
+ * @param webpack webpack instance
6
+ * @param acceptWeak if accept weak runtime check
7
+ */
8
+ export default function BrowserRuntimeModule(webpack: typeof import('webpack'), acceptWeak: boolean): webpack.RuntimeModule;
@@ -0,0 +1 @@
1
+ export default function ChunkLoaderFallbackRuntimeModule(webpack: typeof import('webpack')): import('webpack').RuntimeModule;
@@ -0,0 +1 @@
1
+ export default function createEagerlyLoadChunksRuntimeModule(webpack: typeof import('webpack')): any;
@@ -0,0 +1,4 @@
1
+ export default function LoadScriptRuntimeModule(webpack: typeof import('webpack'), supportDynamicImport: boolean | undefined, classicLoaderEnabled: boolean | undefined, contentScriptsMeta?: Record<string, {
2
+ world?: 'main' | 'extension';
3
+ bridgeBundleId?: string;
4
+ }>): import('webpack').RuntimeModule;
@@ -0,0 +1,2 @@
1
+ import type * as webpack from 'webpack';
2
+ export default function PublicPathRuntimeModule(webpack: typeof import('webpack')): webpack.RuntimeModule;
@@ -0,0 +1,6 @@
1
+ export default class WebExtensionServiceWorkerEntryPlugin {
2
+ private readonly options;
3
+ private readonly backgroundOutputEmitted;
4
+ constructor(options: any, backgroundOutputEmitted: boolean);
5
+ apply(compiler: any): void;
6
+ }
@@ -0,0 +1,12 @@
1
+ export type TemplateLike = {
2
+ asString: (chunks: any) => string;
3
+ indent: (lines: any) => string;
4
+ };
5
+ /**
6
+ * @param compilation webpack/rspack compilation
7
+ * @param Template webpack Template
8
+ */
9
+ export declare function TemplateFn(compilation: any, Template: TemplateLike): {
10
+ f: (args: string, body: string | string[]) => any;
11
+ retF: (returnValue: string, args?: string) => any;
12
+ };
@@ -0,0 +1,5 @@
1
+ export default class WebExtensionPlugin {
2
+ private readonly options;
3
+ constructor(options?: any);
4
+ apply(compiler: any): void;
5
+ }
@@ -0,0 +1,4 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ export declare class StripContentScriptDevServerRuntime {
3
+ apply(compiler: Compiler): void;
4
+ }
@@ -0,0 +1,2 @@
1
+ import { Compilation } from '@rspack/core';
2
+ export declare function checkManifestInPublic(compilation: Compilation, publicDir: string): void;
@@ -0,0 +1,2 @@
1
+ import { type Compilation } from '@rspack/core';
2
+ export declare function emitRootAbsoluteRefs(compilation: Compilation, context: string, publicDir: string): void;
@@ -0,0 +1,6 @@
1
+ import type { CompanionExtensionsConfig } from './types';
2
+ export declare function resolveCompanionExtensionsConfig(opts: {
3
+ projectRoot: string;
4
+ browser: string;
5
+ config?: CompanionExtensionsConfig;
6
+ }): Promise<CompanionExtensionsConfig | undefined>;
@@ -0,0 +1,5 @@
1
+ import type { CompanionExtensionsConfig } from './types';
2
+ export declare function resolveCompanionExtensionDirs(opts: {
3
+ projectRoot: string;
4
+ config?: CompanionExtensionsConfig;
5
+ }): string[];
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Companion extensions are "load-only" unpacked extension directories that
3
+ * should be loaded alongside the user extension in dev/preview/start.
4
+ *
5
+ * Each directory MUST be an unpacked extension root containing a manifest.json.
6
+ */
7
+ export type CompanionExtensionsConfig = string[] | {
8
+ /**
9
+ * Folder to scan for subfolders that contain a manifest.json.
10
+ * Example: "./extensions" -> loads "./extensions/*" (one level deep)
11
+ */
12
+ dir?: string;
13
+ /**
14
+ * Explicit extension directories to load (absolute or relative to projectRoot).
15
+ */
16
+ paths?: string[];
17
+ };
@@ -0,0 +1,9 @@
1
+ import type { CompanionExtensionsConfig } from './types';
2
+ export declare function isDir(p: string): boolean;
3
+ export declare function isFile(p: string): boolean;
4
+ export declare function toAbs(projectRoot: string, p: string): string;
5
+ export declare function isValidExtensionRoot(dir: string): boolean;
6
+ export declare function normalizeCompanionConfig(config?: CompanionExtensionsConfig): {
7
+ dir?: string;
8
+ paths: string[];
9
+ };
@@ -0,0 +1,12 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import { getSpecialFoldersData } from 'browser-extension-manifest-fields';
3
+ import { type FilepathList } from '../types';
4
+ import { type CompanionExtensionsConfig } from './folder-extensions/types';
5
+ export declare function getSpecialFoldersDataForCompiler(compiler: Compiler): SpecialFoldersData;
6
+ export declare function getSpecialFoldersDataForProjectRoot(projectRoot: string): SpecialFoldersData;
7
+ type SpecialFoldersData = Omit<ReturnType<typeof getSpecialFoldersData>, 'pages' | 'scripts'> & {
8
+ pages?: FilepathList;
9
+ scripts?: FilepathList;
10
+ extensions?: CompanionExtensionsConfig;
11
+ };
12
+ export {};
@@ -0,0 +1,20 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ interface SpecialFoldersPluginOptions {
3
+ manifestPath: string;
4
+ }
5
+ /**
6
+ * SpecialFoldersPlugin is responsible for handling the
7
+ * special folders in the extension:
8
+ *
9
+ * - /pages - HTML pages not included in the manifest
10
+ * - /scripts - Script files not included in the manifest
11
+ * - /public - Static files not included in the manifest
12
+ * - /extensions - Load-only companion extensions (unpacked)
13
+ */
14
+ export declare class SpecialFoldersPlugin {
15
+ static readonly name: string;
16
+ private readonly options;
17
+ constructor(options: SpecialFoldersPluginOptions);
18
+ apply(compiler: Compiler): void;
19
+ }
20
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare function serverRestartRequiredFromSpecialFolderMessageOnly(addingOrRemoving: string, folder: string, typeOfAsset: string): string;
2
+ export declare function specialFoldersSetupSummary(hasPublic: boolean, copyEnabled: boolean, ignoredCount: number): string;
3
+ export declare function specialFolderChangeDetected(action: 'add' | 'remove', folder: 'pages' | 'scripts', relativePath: string): string;
@@ -0,0 +1,13 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ export declare class WarnUponFolderChanges {
3
+ private pendingChanges;
4
+ private knownFolderFiles;
5
+ private hasSnapshot;
6
+ private snapshotFolderFiles;
7
+ private getContextDependencyPaths;
8
+ private throwCompilationError;
9
+ private trackChange;
10
+ private collectChanges;
11
+ private applyPendingChanges;
12
+ apply(compiler: Compiler): void;
13
+ }
@@ -0,0 +1,10 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { PluginInterface, DevOptions } from '../types';
3
+ export declare class StaticAssetsPlugin {
4
+ static readonly name: string;
5
+ readonly mode: DevOptions['mode'];
6
+ constructor(options: PluginInterface & {
7
+ mode: DevOptions['mode'];
8
+ });
9
+ apply(compiler: Compiler): void;
10
+ }
@@ -0,0 +1,8 @@
1
+ export declare function assetsRulesEnabled(rules: string[]): string;
2
+ export declare function assetsConfigsDetected(filenamePattern: string, svgRuleMode: 'default' | 'custom', svgInlineLimitKB?: number, imageInlineLimitKB?: number, fileInlineLimitKB?: number): string;
3
+ export declare function assetsEmittedSummary(total: number, byCategory: {
4
+ svg: number;
5
+ images: number;
6
+ fonts: number;
7
+ files: number;
8
+ }): string;
@@ -0,0 +1,15 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { PluginInterface, DevOptions } from '../types';
3
+ export declare class WasmPlugin {
4
+ static readonly name: string;
5
+ readonly manifestPath: string;
6
+ readonly mode: DevOptions['mode'];
7
+ constructor(options: PluginInterface & {
8
+ mode: DevOptions['mode'];
9
+ });
10
+ private resolveAssetPath;
11
+ private buildAssetAliases;
12
+ private ensureWasmResolution;
13
+ private ensureWasmExperiments;
14
+ apply(compiler: Compiler): void;
15
+ }
@@ -0,0 +1,2 @@
1
+ import { type FilepathList } from '../../../types';
2
+ export declare function handleStaticAsset(compilation: any, htmlEntry: string, htmlDir: string, absolutePath: string, assetType: 'staticSrc' | 'staticHref', cleanPath: string, search: string | undefined, hash: string | undefined, baseHref: string | undefined, includeList: FilepathList, extname: string, childNode: any): any;
@@ -0,0 +1,4 @@
1
+ export declare function injectJsScript(bodyNode: any, feature: string, firstScriptAttrs?: Array<{
2
+ name: string;
3
+ value: string;
4
+ }>): void;
@@ -0,0 +1,24 @@
1
+ export declare function javaScriptError(errorSourcePath: string, missingFilePath: string, opts?: {
2
+ publicRootHint?: boolean;
3
+ deadRefHint?: boolean;
4
+ }): string;
5
+ export declare function cssError(errorSourcePath: string, missingFilePath: string, opts?: {
6
+ publicRootHint?: boolean;
7
+ deadRefHint?: boolean;
8
+ }): string;
9
+ export declare function staticAssetError(errorSourcePath: string, missingFilePath: string, opts?: {
10
+ publicRootHint?: boolean;
11
+ refLabel?: string;
12
+ deadRefHint?: boolean;
13
+ }): string;
14
+ export declare function fileNotFound(errorSourcePath: string | undefined, missingFilePath: string, opts?: {
15
+ publicRootHint?: boolean;
16
+ refLabel?: string;
17
+ deadRefHint?: boolean;
18
+ }): string;
19
+ export declare function htmlFileNotFoundMessageOnly(context?: 'script' | 'style' | 'static'): string;
20
+ export declare function remoteResourceWarning(errorSourcePath: string, remoteUrl: string, kind: 'script' | 'style'): string;
21
+ export declare function serverRestartRequiredFromHtml(relativeHtmlPath: string, absoluteHtmlPath: string): string;
22
+ export declare function manifestHtmlEntrypointChange(manifestField?: string, pathAfter?: string, pathBefore?: string): string;
23
+ export declare function manifestPageMissing(manifestField: string, missingFilePath: string): string;
24
+ export declare function manifestFieldMessageOnly(manifestField: string): string;
@@ -0,0 +1,8 @@
1
+ import * as parse5utilities from 'parse5-utilities';
2
+ interface OnResourceFoundOptions {
3
+ filePath: string;
4
+ childNode: ReturnType<typeof parse5utilities.createNode>;
5
+ assetType: 'script' | 'css' | 'staticSrc' | 'staticHref';
6
+ }
7
+ export declare function parseHtml(node: ReturnType<typeof parse5utilities.createNode>, onResourceFound: (options: OnResourceFoundOptions) => void): void;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import { type Compilation } from '@rspack/core';
2
+ import { type FilepathList } from '../../../types';
3
+ export declare function patchHtml(compilation: Compilation, feature: string, htmlEntry: string, includeList: FilepathList): string;
4
+ /**
5
+ * Patches a nested HTML: preserve original script/link tags,
6
+ * only rewrite static assets, and warn about missing public-root assets.
7
+ */
8
+ export declare function patchHtmlNested(compilation: Compilation, htmlEntry: string): string;
@@ -0,0 +1,46 @@
1
+ import { type FilepathList } from '../../../types';
2
+ export interface ParsedHtmlAsset {
3
+ css?: string[];
4
+ js?: string[];
5
+ moduleJs?: string[];
6
+ static?: string[];
7
+ }
8
+ export declare function getAssetsFromHtml(htmlFilePath: string | undefined, htmlContent?: string, publicPath?: string): ParsedHtmlAsset;
9
+ export declare function getHtmlPageDeclaredAssetPath(filepathList: FilepathList, filePath: string, extension: string): string;
10
+ export declare function getExtname(filePath: string): string;
11
+ export declare function getFilePath(filePath: string, extension: string, isPublic: boolean): string;
12
+ export declare function isFromIncludeList(filePath: string, includeList?: FilepathList): boolean;
13
+ export declare function isUrl(src: string): boolean;
14
+ export declare function cleanAssetUrl(url: string): {
15
+ cleanPath: string;
16
+ hash: string;
17
+ search: string;
18
+ };
19
+ export declare function isHttpLike(inputUrl: string): boolean;
20
+ export declare function isSpecialScheme(u: string): boolean;
21
+ export declare function cleanLeading(s: string): string;
22
+ /**
23
+ * Join an emitted-asset name from a prefix and an HTML-relative walk, clamped
24
+ * the way Chrome resolves the matching URL: `..` segments cannot climb above
25
+ * the extension root, so leading `..` left after the join are dropped. Without
26
+ * the clamp, an asset referenced from a nested page (`../../../assets/x.png`
27
+ * from `adapters/chrome/popup/popup.html`) produces the asset NAME
28
+ * `../../assets/x.png` — the dev middleware then writes it OUTSIDE the output
29
+ * dir, on top of the source file, and the watcher loops on its own emit
30
+ * forever (the wild-corpus Sappgulf storm).
31
+ */
32
+ export declare function joinEmittedAssetName(prefix: string, rel: string): string;
33
+ export declare function computePosixRelative(fromPath: string, toPath: string): string;
34
+ export declare function resolveAbsoluteFsPath(params: {
35
+ asset: string;
36
+ projectRoot: string;
37
+ publicRootForResource: string;
38
+ outputRoot: string;
39
+ /** Manifest dir: Chrome resolves root URLs (/pages/x.html) against it. */
40
+ manifestRoot?: string;
41
+ }): {
42
+ absoluteFsPath: string;
43
+ isUnderPublicRoot: boolean;
44
+ isRootUrl: boolean;
45
+ };
46
+ export declare function getBaseHref(htmlDocument: any): string | undefined;
@@ -0,0 +1,36 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { FilepathList, PluginInterface } from '../../types';
3
+ /**
4
+ * HtmlPlugin is responsible for handling the HTML file
5
+ * defined in the manifest.json. Static assets and CSS files
6
+ * within the HTML file are added to the compilation. JS files
7
+ * are added as webpack entrypoints. It also supports ecxtra
8
+ * html files defined via this.include option. These extra
9
+ * html files are added to the compilation and are also HMR
10
+ * enabled. They are useful for adding extra pages to the
11
+ * extension runtime that are not defined in manifest.
12
+ *
13
+ * The plugin also has a guard against recompiling entrypoints
14
+ * at runtime, throwing an error if any of those files change.
15
+ *
16
+ * Features supported:
17
+ * action.default_popup - HMR enabled
18
+ * background.page - HMR enabled
19
+ * chrome_settings_overrides.homepage - HMR enabled
20
+ * chrome_url_overrides.newtab - HMR enabled
21
+ * chrome_url_overrides.history - HMR enabled
22
+ * chrome_url_overrides.bookmarks - HMR enabled
23
+ * devtools_page - HMR enabled
24
+ * options_ui.page - HMR enabled
25
+ * page_action.default_popup - HMR enabled
26
+ * sandbox.page - HMR enabled
27
+ * side_panel.default_panel - HMR enabled
28
+ * sidebar_action.default_panel - HMR enabled
29
+ */
30
+ export declare class HtmlPlugin {
31
+ readonly manifestPath: string;
32
+ readonly includeList?: FilepathList;
33
+ private readonly browser;
34
+ constructor(options: PluginInterface);
35
+ apply(compiler: Compiler): void;
36
+ }
@@ -0,0 +1,9 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import { type FilepathList, type PluginInterface } from '../../../types';
3
+ export declare class AddAssetsToCompilation {
4
+ readonly manifestPath: string;
5
+ readonly includeList?: FilepathList;
6
+ readonly browser?: string;
7
+ constructor(options: PluginInterface);
8
+ apply(compiler: Compiler): void;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import { type FilepathList, type PluginInterface } from '../../../types';
3
+ export declare class AddScriptsAndStylesToCompilation {
4
+ readonly manifestPath: string;
5
+ readonly includeList?: FilepathList;
6
+ readonly browser?: string;
7
+ constructor(options: PluginInterface);
8
+ apply(compiler: Compiler): void;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import { type FilepathList, type PluginInterface } from '../../../types';
3
+ export declare class AddToFileDependencies {
4
+ readonly manifestPath: string;
5
+ readonly includeList?: FilepathList;
6
+ readonly browser?: string;
7
+ constructor(options: PluginInterface);
8
+ apply(compiler: Compiler): void;
9
+ }