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,12 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { PluginInterface, DevOptions } from '../types';
3
+ export declare class CompatibilityPlugin {
4
+ static readonly name: string;
5
+ readonly manifestPath: string;
6
+ readonly browser: DevOptions['browser'];
7
+ readonly polyfill: DevOptions['polyfill'];
8
+ constructor(options: PluginInterface & {
9
+ polyfill: DevOptions['polyfill'];
10
+ });
11
+ apply(compiler: Compiler): void;
12
+ }
@@ -0,0 +1,11 @@
1
+ import { Compiler } from '@rspack/core';
2
+ import { type PluginInterface } from '../types';
3
+ export declare class BoringPlugin {
4
+ static readonly name: string;
5
+ readonly manifestPath: string;
6
+ readonly browser: PluginInterface['browser'];
7
+ private sawUserInvalidation;
8
+ private printedPostBannerStartupSuccess;
9
+ constructor(options: PluginInterface);
10
+ apply(compiler: Compiler): void;
11
+ }
@@ -0,0 +1,8 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ export declare class CleanDistFolderPlugin {
3
+ private options;
4
+ constructor(options: {
5
+ browser: string;
6
+ });
7
+ apply(compiler: Compiler): void;
8
+ }
@@ -0,0 +1,11 @@
1
+ import type { Stats } from '@rspack/core';
2
+ export declare function boring(manifestName: string, durationMs: number, stats: Stats): string;
3
+ export declare function portInUse(requestedPort: number, newPort: number): string;
4
+ export declare function extensionJsRunnerError(error: unknown): string;
5
+ export declare function cleanDistStarting(distPath: string): string;
6
+ export declare function cleanDistRemovedSummary(removedCount: number, distPath: string): string;
7
+ export declare function cleanDistSkippedNotFound(distPath: string): string;
8
+ export declare function zipPackagingSkipped(reason: string): string;
9
+ export declare function envSelectedFile(envPath: string): string;
10
+ export declare function envInjectedPublicVars(count: number): string;
11
+ export declare function envNoMatchingFile(browser: string, mode: string, presentFiles: string[], expectedCandidates: string[]): string;
@@ -0,0 +1,7 @@
1
+ export declare const sharedState: {
2
+ bannerPrinted: boolean;
3
+ pendingCompilationLine: string;
4
+ };
5
+ export declare function markBannerPrinted(): void;
6
+ export declare function isBannerPrinted(): boolean;
7
+ export declare function setPendingCompilationLine(line: string): void;
@@ -0,0 +1,17 @@
1
+ import { Compiler } from '@rspack/core';
2
+ import type { PluginInterface, DevOptions } from '../types';
3
+ /**
4
+ * Env files resolve family-wide, mirroring the manifest-prefix contract
5
+ * (lib/manifest-utils.ts): `chrome:`/`chromium:`/`edge:` manifest keys all
6
+ * apply to any chromium-family target, so `.env.chrome` must equally apply
7
+ * when building the default `chromium` target. The exact browser name always
8
+ * wins over family siblings; Safari/webkit inherit the chromium family for
9
+ * the same reason they inherit its manifest keys.
10
+ */
11
+ export declare function getEnvFileCandidates(browser: DevOptions['browser'], mode: string): string[];
12
+ export declare class EnvPlugin {
13
+ readonly browser: DevOptions['browser'];
14
+ readonly manifestPath?: string;
15
+ constructor(options: Partial<PluginInterface>);
16
+ apply(compiler: Compiler): void;
17
+ }
@@ -0,0 +1,22 @@
1
+ import { Compiler } from '@rspack/core';
2
+ import { type PluginInterface } from '../types';
3
+ export declare class CompilationPlugin {
4
+ static readonly name: string;
5
+ readonly manifestPath: string;
6
+ readonly browser: PluginInterface['browser'];
7
+ readonly clean: boolean;
8
+ readonly zip?: boolean;
9
+ readonly zipSource?: boolean;
10
+ readonly zipFilename?: string;
11
+ readonly port?: number;
12
+ constructor(options: PluginInterface & {
13
+ clean: boolean;
14
+ } & {
15
+ zip?: boolean;
16
+ zipSource?: boolean;
17
+ zipFilename?: string;
18
+ port?: number;
19
+ });
20
+ private applyIgnoreWarnings;
21
+ apply(compiler: Compiler): void;
22
+ }
@@ -0,0 +1,18 @@
1
+ import type { Compiler } from '@rspack/core';
2
+ import type { DevOptions } from '../types';
3
+ export interface ZipPluginOptions {
4
+ manifestPath?: string;
5
+ browser: DevOptions['browser'];
6
+ zipData?: {
7
+ zip?: boolean;
8
+ zipSource?: boolean;
9
+ zipFilename?: string;
10
+ };
11
+ }
12
+ export declare class ZipPlugin {
13
+ private readonly options;
14
+ private readonly browser;
15
+ private readonly zipData;
16
+ constructor(options: ZipPluginOptions);
17
+ apply(compiler: Compiler): void;
18
+ }
@@ -0,0 +1,8 @@
1
+ import { type RuleSetRule } from '@rspack/core';
2
+ import { type DevOptions } from '../types';
3
+ export interface StyleLoaderOptions {
4
+ mode: DevOptions['mode'];
5
+ loader?: string;
6
+ loaderOptions?: Record<string, any>;
7
+ }
8
+ export declare function commonStyleLoaders(projectPath: string, opts: StyleLoaderOptions): Promise<RuleSetRule['use']>;
@@ -0,0 +1,4 @@
1
+ import type { RuleSetRule } from '@rspack/core';
2
+ import { type PreprocessorUsage } from './css-lib/build-css-rules';
3
+ import type { DevOptions } from '../types';
4
+ export declare function cssInContentScriptLoader(projectPath: string, manifestPath: string, mode: DevOptions['mode'], usage?: PreprocessorUsage): Promise<RuleSetRule[]>;
@@ -0,0 +1,4 @@
1
+ import type { RuleSetRule } from '@rspack/core';
2
+ import { type PreprocessorUsage } from './css-lib/build-css-rules';
3
+ import type { DevOptions } from '../types';
4
+ export declare function cssInHtmlLoader(projectPath: string, mode: DevOptions['mode'], manifestPath: string, usage?: PreprocessorUsage): Promise<RuleSetRule[]>;
@@ -0,0 +1,12 @@
1
+ import type { RuleSetRule } from '@rspack/core';
2
+ import type { DevOptions } from '../../types';
3
+ export interface PreprocessorUsage {
4
+ useSass?: boolean;
5
+ useLess?: boolean;
6
+ }
7
+ interface BuildCssRulesOptions {
8
+ nonModuleType: 'asset/inline' | 'css';
9
+ issuer: (issuer: string) => boolean;
10
+ }
11
+ export declare function buildCssRules(projectPath: string, mode: DevOptions['mode'], usage: PreprocessorUsage, opts: BuildCssRulesOptions): Promise<RuleSetRule[]>;
12
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Injects a `<link rel="stylesheet">` tag into the given `<head>` node
3
+ * for the bundled CSS of an entry feature.
4
+ *
5
+ * @param headNode – The parse5 `<head>` node to append to.
6
+ * @param feature – Entry name (e.g. `chrome_url_overrides/newtab`).
7
+ * @param firstLinkAttrs – Attributes captured from the first user-authored
8
+ * `<link>` so that non-default attributes (media, integrity, …) are
9
+ * propagated to the injected tag.
10
+ * @param hrefOverride – When the emitted CSS filename differs from the
11
+ * canonical `/<feature>.css`, pass the actual public href here.
12
+ */
13
+ export declare function injectCssLink(headNode: any, feature: string, firstLinkAttrs?: Array<{
14
+ name: string;
15
+ value: string;
16
+ }>, hrefOverride?: string): void;
@@ -0,0 +1 @@
1
+ export declare function isContentScriptEntry(absolutePath: string, manifestPath: string, projectPath: string): boolean;
@@ -0,0 +1,9 @@
1
+ export declare function cssIntegrationsEnabled(integrations: string[]): string;
2
+ export declare function cssConfigsDetected(postcssConfig?: string, tailwindConfig?: string, browserslistSource?: string): string;
3
+ export declare function isUsingIntegration(name: string): string;
4
+ export declare function youAreAllSet(name: string): string;
5
+ export declare function missingSassDependency(): string;
6
+ export declare function postCssPluginNotResolved(pluginName: string, projectPath: string): string;
7
+ export declare function cssParseErrorShippedVerbatim(resourcePath: string, error: unknown): string;
8
+ export declare function preprocessorShippedUncompiled(resourcePath: string, tool: 'sass' | 'less'): string;
9
+ export declare function deadCssUrlRef(issuerPath: string, request: string): string;
@@ -0,0 +1,21 @@
1
+ import { type Compilation } from '@rspack/core';
2
+ export interface CssAssetResult {
3
+ /** Whether a CSS asset was found for this feature. */
4
+ found: boolean;
5
+ /**
6
+ * When the asset lives under a name that differs from the canonical
7
+ * `<feature>.css` (e.g. a chunk split by rspack's native CSS), this
8
+ * holds the public href to use in the injected `<link>` tag.
9
+ * Undefined when the canonical name matched directly.
10
+ */
11
+ href: string | undefined;
12
+ }
13
+ /**
14
+ * Resolves the CSS asset emitted for a given entry feature.
15
+ *
16
+ * First tries the canonical name (`<feature>.css`). If that misses —
17
+ * which can happen when rspack's native CSS (`experiments.css`) splits
18
+ * the stylesheet into a chunk whose name differs from the entry — it
19
+ * falls back to inspecting the entrypoint's actual chunk files.
20
+ */
21
+ export declare function resolveCssAsset(compilation: Compilation, feature: string): CssAssetResult;
@@ -0,0 +1,8 @@
1
+ interface CssParseGuardLoaderContext {
2
+ resourcePath: string;
3
+ async(): (err: Error | null, content?: string) => void;
4
+ emitWarning(warning: Error): void;
5
+ }
6
+ export default function cssParseGuardLoader(this: unknown, source: string): string;
7
+ export declare function pitch(this: CssParseGuardLoaderContext): void;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ export declare function isUsingLess(projectPath: string): boolean;
2
+ /**
3
+ * Resolve (and install if missing) the less-loader contract. The actual loader
4
+ * rules are emitted by the content-script/HTML CSS loaders — this only ensures
5
+ * the optional dependency is present before that chain runs.
6
+ */
7
+ export declare function maybeUseLess(projectPath: string): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import type { StyleLoaderOptions } from '../common-style-loaders';
2
+ export declare function findPostCssConfig(projectPath: string): string | undefined;
3
+ export declare function isUsingPostCss(projectPath: string): boolean;
4
+ export declare function maybeUsePostCss(projectPath: string, opts: StyleLoaderOptions): Promise<Record<string, any>>;
@@ -0,0 +1,10 @@
1
+ export declare function isUsingSass(projectPath: string): boolean;
2
+ /**
3
+ * Resolve the Sass implementation from the user's project first, then fall back
4
+ * to the Extension.js cache/runtime. This mirrors the PostCSS/Tailwind
5
+ * resolution strategy so we don't depend on Node resolving `sass` from the
6
+ * loader path inside the npx cache.
7
+ */
8
+ export declare function resolveSassImplementation(projectPath: string): any | undefined;
9
+ export declare function createSassLoaderOptions(projectPath: string, mode: 'development' | 'production'): Record<string, any>;
10
+ export declare function maybeUseSass(projectPath: string): Promise<void>;
@@ -0,0 +1,2 @@
1
+ export declare function isUsingTailwind(projectPath: string): boolean;
2
+ export declare function getTailwindConfigFile(projectPath: string): string | undefined;
@@ -0,0 +1,26 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { PluginInterface } from '../types';
3
+ export { resolveCssAsset } from './css-lib/resolve-css-asset';
4
+ export type { CssAssetResult } from './css-lib/resolve-css-asset';
5
+ export { injectCssLink } from './css-lib/inject-css-link';
6
+ export declare class CssPlugin {
7
+ static readonly name: string;
8
+ readonly manifestPath: string;
9
+ constructor(options: PluginInterface);
10
+ private configureOptions;
11
+ /**
12
+ * A stylesheet url() whose file exists nowhere in the project is a fatal
13
+ * "Module not found" to rspack's CSS parser, but Chrome applies the rest
14
+ * of the stylesheet and 404s the reference silently (wild:
15
+ * mozilla/contain-facebook ships url(/img/login_continue_*.png) with no
16
+ * such files anywhere — the extension is store-published and works).
17
+ * Cancel these requests before resolution and warn instead, mirroring the
18
+ * dead-HTML-ref policy; EXTENSION_STRICT_REFS=true keeps them fatal.
19
+ * Only unambiguous file refs are tolerated — '/x' (extension root),
20
+ * './x'/'../x' (issuer-relative), and bare paths with a non-CSS asset
21
+ * extension. Bare specifiers without one stay with the resolver so
22
+ * node_modules @imports keep failing loudly when genuinely broken.
23
+ */
24
+ private tolerateDeadUrlRefs;
25
+ apply(compiler: Compiler): Promise<void>;
26
+ }
@@ -0,0 +1,6 @@
1
+ interface PreprocessorPassthroughLoaderContext {
2
+ resourcePath: string;
3
+ emitWarning(warning: Error): void;
4
+ }
5
+ export default function preprocessorPassthroughLoader(this: PreprocessorPassthroughLoaderContext, source: string): string;
6
+ export {};
@@ -0,0 +1,4 @@
1
+ import { hasDependency } from '../../lib/has-dependency';
2
+ import { resolveDevelopInstallRoot } from '../../lib/develop-context';
3
+ export { hasDependency, resolveDevelopInstallRoot };
4
+ export declare function isUsingJSFramework(projectPath: string): boolean;
@@ -0,0 +1,18 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { PluginInterface, DevOptions } from '../types';
3
+ export declare class JsFrameworksPlugin {
4
+ static readonly name: string;
5
+ readonly manifestPath: string;
6
+ readonly browser: DevOptions['browser'];
7
+ readonly mode: DevOptions['mode'];
8
+ readonly transpilePackages: string[];
9
+ constructor(options: PluginInterface & {
10
+ mode: DevOptions['mode'];
11
+ transpilePackages?: string[];
12
+ });
13
+ private findVueLoaderRuleIndices;
14
+ private mergeVueRule;
15
+ private patchReactRefreshRules;
16
+ private configureOptions;
17
+ apply(compiler: Compiler): Promise<void>;
18
+ }
@@ -0,0 +1,2 @@
1
+ export declare function resolveLoaderConfigPath(projectPath: string, framework: 'vue' | 'svelte'): string | null;
2
+ export declare function loadLoaderOptions(projectPath: string, framework: 'vue' | 'svelte'): Promise<any>;
@@ -0,0 +1,10 @@
1
+ export declare function installingRootDependencies(integration: string): string;
2
+ export declare function integrationInstalledSuccessfully(integration: string): string;
3
+ export declare function isUsingIntegration(name: string): string;
4
+ export declare function youAreAllSet(name: string): string;
5
+ export declare function creatingTSConfig(): string;
6
+ export declare function failedToInstallIntegration(integration: string, error: unknown): string;
7
+ export declare function isUsingCustomLoader(loaderPath: string): string;
8
+ export declare function jsFrameworksIntegrationsEnabled(integrations: string[]): string;
9
+ export declare function jsFrameworksConfigsDetected(tsConfigPath?: string, tsRoot?: string, targets?: string[]): string;
10
+ export declare function jsFrameworksHmrSummary(enabled: boolean, frameworks: string[]): string;
@@ -0,0 +1,3 @@
1
+ import { JsFramework } from '../../types';
2
+ export declare function isUsingPreact(projectPath: string): boolean;
3
+ export declare function maybeUsePreact(projectPath: string): Promise<JsFramework | undefined>;
@@ -0,0 +1,8 @@
1
+ import { JsFramework } from '../../types';
2
+ type MaybeUseReactOptions = {
3
+ refreshExclude?: unknown;
4
+ disableRefresh?: boolean;
5
+ };
6
+ export declare function isUsingReact(projectPath: string): boolean;
7
+ export declare function maybeUseReact(projectPath: string, options?: MaybeUseReactOptions): Promise<JsFramework | undefined>;
8
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { JsFramework } from '../../types';
2
+ import type { DevOptions } from '../../types';
3
+ export declare function isUsingSvelte(projectPath: string): boolean;
4
+ export declare function maybeUseSvelte(projectPath: string, mode: DevOptions['mode']): Promise<JsFramework | undefined>;
@@ -0,0 +1,37 @@
1
+ import { type DevOptions } from '../../types';
2
+ export declare function isUsingTypeScript(projectPath: string): boolean;
3
+ export declare function ensureTypeScriptConfig(projectPath: string): void;
4
+ export declare function defaultTypeScriptConfig(projectPath: string, _opts?: any): {
5
+ compilerOptions: {
6
+ allowJs: boolean;
7
+ allowSyntheticDefaultImports: boolean;
8
+ esModuleInterop: boolean;
9
+ forceConsistentCasingInFileNames: boolean;
10
+ jsx: string;
11
+ lib: string[];
12
+ moduleResolution: string;
13
+ module: string;
14
+ resolveJsonModule: boolean;
15
+ strict: boolean;
16
+ target: string;
17
+ isolatedModules: boolean;
18
+ skipLibCheck: boolean;
19
+ };
20
+ exclude: string[];
21
+ };
22
+ export declare function getUserTypeScriptConfigFile(projectPath: string): string | undefined;
23
+ export declare function getTypeScriptConfigOverrides(opts: {
24
+ mode: DevOptions['mode'];
25
+ }): {
26
+ compilerOptions: {
27
+ sourceMap: boolean;
28
+ skipLibCheck: boolean;
29
+ inlineSourceMap: boolean;
30
+ declarationMap: boolean;
31
+ noEmit: boolean;
32
+ incremental: boolean;
33
+ tsBuildInfoFile: string;
34
+ };
35
+ exclude: string[];
36
+ };
37
+ export declare function maybeUseTypeScript(projectPath: string): Promise<boolean>;
@@ -0,0 +1,3 @@
1
+ import { JsFramework } from '../../types';
2
+ export declare function isUsingVue(projectPath: string): boolean;
3
+ export declare function maybeUseVue(projectPath: string, mode?: 'development' | 'production' | string): Promise<JsFramework | undefined>;
@@ -0,0 +1,3 @@
1
+ export type AssetCategory = 'content-script' | 'service-worker' | 'page' | 'ignored';
2
+ export declare function categorizeAsset(rawName: string): AssetCategory;
3
+ export declare const BUDGET_BYTES: Record<AssetCategory, number>;
@@ -0,0 +1,34 @@
1
+ import type { Compiler } from '@rspack/core';
2
+ import { type AssetCategory } from './categorize';
3
+ interface PerfBudgetsPluginOptions {
4
+ enabled?: boolean;
5
+ budgets?: Partial<Record<AssetCategory, number>>;
6
+ }
7
+ /**
8
+ * PerfBudgetsPlugin — extension-aware performance budgets.
9
+ *
10
+ * Replaces rspack's stock single-threshold `performance.hints` with a
11
+ * per-asset-category budget tuned to how browser extensions actually
12
+ * load code:
13
+ *
14
+ * content_scripts/* → 512 KiB (injected on every navigation)
15
+ * background / SW → 512 KiB (wakes from cold each session)
16
+ * pages / sidebar / … → 1 MiB (opened on demand)
17
+ * images, fonts, etc. → silenced (not a code-splitting concern)
18
+ *
19
+ * Numbers are sized to clear realistic framework templates (React/Vue/
20
+ * Preact/Svelte + a design system) and still flag genuine outliers
21
+ * (multi-MiB AI sidebars, heavyweight WASM service workers). Override
22
+ * per-category via `perfBudgets` in `extension.config.{js,ts}`.
23
+ *
24
+ * Set `compiler.options.performance.hints = false` when this plugin is
25
+ * registered to avoid double-warnings.
26
+ */
27
+ export declare class PerfBudgetsPlugin {
28
+ static readonly name = "plugin-perf-budgets";
29
+ private readonly options;
30
+ constructor(options?: PerfBudgetsPluginOptions);
31
+ apply(compiler: Compiler): void;
32
+ }
33
+ export { BUDGET_BYTES, categorizeAsset } from './categorize';
34
+ export type { AssetCategory } from './categorize';
@@ -0,0 +1,8 @@
1
+ import type { AssetCategory } from './categorize';
2
+ export interface OversizedAsset {
3
+ name: string;
4
+ size: number;
5
+ budget: number;
6
+ category: AssetCategory;
7
+ }
8
+ export declare function perfBudgetWarning(assets: OversizedAsset[]): string;
@@ -0,0 +1,89 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import { type AbsolutePath } from '../lib/paths';
3
+ export type PlaywrightAutomationCommand = 'dev' | 'start' | 'preview' | 'build';
4
+ export type ReadyStatus = 'starting' | 'ready' | 'error';
5
+ export type ReadyMetadata = {
6
+ schemaVersion: 2;
7
+ status: ReadyStatus;
8
+ command: PlaywrightAutomationCommand;
9
+ browser: string;
10
+ runId: string;
11
+ startedAt: string;
12
+ distPath: string;
13
+ manifestPath: string;
14
+ port: number | null;
15
+ host?: string;
16
+ pid: number;
17
+ ts: string;
18
+ compiledAt: string | null;
19
+ errors: string[];
20
+ code?: string;
21
+ message?: string;
22
+ instanceId?: string;
23
+ controlPort?: number | null;
24
+ controlPath?: string;
25
+ logsPath?: string;
26
+ cdpPort?: number;
27
+ toolchainVersion: string;
28
+ extensionName?: string;
29
+ extensionVersion?: string;
30
+ browserExitedAt?: string;
31
+ browserExitCode?: number | null;
32
+ };
33
+ export type PlaywrightAutomationEvent = {
34
+ type: 'compile_start' | 'compile_success' | 'compile_error' | 'shutdown';
35
+ ts: string;
36
+ command: PlaywrightAutomationCommand;
37
+ browser: string;
38
+ runId?: string;
39
+ durationMs?: number;
40
+ errorCount?: number;
41
+ errors?: string[];
42
+ };
43
+ type WriterOptions = {
44
+ packageJsonDir: string;
45
+ browser: string;
46
+ command: PlaywrightAutomationCommand;
47
+ distPath: string;
48
+ manifestPath: string;
49
+ port?: number | string | null;
50
+ host?: string;
51
+ instanceId?: string;
52
+ controlPort?: number | string | null;
53
+ controlPath?: string;
54
+ logsPath?: string;
55
+ };
56
+ type PluginOptions = {
57
+ packageJsonDir: string;
58
+ browser?: string;
59
+ mode?: 'development' | 'production' | 'none';
60
+ outputPath: string;
61
+ manifestPath: string;
62
+ port?: number | string | null;
63
+ host?: string;
64
+ command?: PlaywrightAutomationCommand;
65
+ instanceId?: string;
66
+ controlPort?: number | string | null;
67
+ controlPath?: string;
68
+ logsPath?: string;
69
+ };
70
+ export declare function formatStatsErrors(errors: unknown): string[];
71
+ export declare function getPlaywrightMetadataDir(packageJsonDir: string, browser: string): AbsolutePath;
72
+ export declare function createPlaywrightMetadataWriter(options: WriterOptions): {
73
+ metadataDir: AbsolutePath;
74
+ readyPath: AbsolutePath;
75
+ eventsPath: AbsolutePath;
76
+ writeStarting(): void;
77
+ writeReady(compiledAt?: string | null): void;
78
+ writeError(code: string, message: string, errors?: string[]): void;
79
+ appendEvent: (event: PlaywrightAutomationEvent) => void;
80
+ };
81
+ export declare class PlaywrightPlugin {
82
+ static readonly name = "plugin-playwright";
83
+ private readonly writer;
84
+ private readonly command;
85
+ private readonly browser;
86
+ constructor(options: PluginOptions);
87
+ apply(compiler: Compiler): void;
88
+ }
89
+ export {};
@@ -0,0 +1,86 @@
1
+ export type ReloadType = 'full' | 'service-worker' | 'content-scripts';
2
+ export interface ReloadInstruction {
3
+ /**
4
+ * 'page' is a notify-only instruction: the extension itself is NOT reloaded
5
+ * (rspack-dev-server's livereload refreshes the open surface), but the
6
+ * signal still travels the bridge so every "Reloading…" surface (stdout,
7
+ * devtools pill) reflects it.
8
+ */
9
+ type: ReloadType | 'page';
10
+ changedContentScriptEntries?: string[];
11
+ changedAssets?: string[];
12
+ /**
13
+ * Human context label shared VERBATIM by every surface that announces this
14
+ * reload — CLI stdout, the page's devtools console line, and the devtools
15
+ * extension pill — so they can never disagree about what is reloading.
16
+ * e.g. "content_script (content/scripts.tsx)".
17
+ */
18
+ label?: string;
19
+ }
20
+ /** "context (fileA, fileB +2 more)" — the one label every reload surface shows. */
21
+ export declare function formatReloadContextLabel(context: string, files: string[]): string;
22
+ /**
23
+ * Best-effort page-context name for a page-only edit, mirroring the path
24
+ * heuristics used for the service-worker branch. Only used for the label —
25
+ * never for the reload decision.
26
+ */
27
+ export declare function pageContextFromSources(changedSources: string[]): string;
28
+ /**
29
+ * Which dev-reload feature owns each project source file, derived from the
30
+ * compilation's chunk graph. Name-pattern heuristics are NOT trustworthy for
31
+ * this decision: a service worker named `background-ultimate.js` fails the
32
+ * `background.`/`service-worker` patterns and would be re-injected as a
33
+ * content script (the SW then never restarts — the wild-corpus anshul bug).
34
+ */
35
+ export interface SourceFeatureIndex {
36
+ /** Sources bundled into a background/* chunk (SW or MV2 scripts). */
37
+ swSources: Set<string>;
38
+ /** Source → canonical content_scripts entry names whose chunks contain it. */
39
+ contentEntriesBySource: Map<string, Set<string>>;
40
+ /** Sources bundled only into page chunks (popup/options/devtools/…). */
41
+ pageSources: Set<string>;
42
+ }
43
+ /**
44
+ * Walk the finished compilation and record, for every bundled source file,
45
+ * which reload feature its chunks belong to. Nameless (async) chunks are
46
+ * skipped — sources reached only through dynamic imports fall back to the
47
+ * name heuristics in {@link classifyReloadFromSources}.
48
+ */
49
+ export declare function buildSourceFeatureIndex(compilation: any, contextDir: string): SourceFeatureIndex;
50
+ /**
51
+ * Pure reload classifier shared by the launched-browser path (BrowsersPlugin,
52
+ * below) and the controller-less path (the dev server's `--no-browser` reload
53
+ * broadcast). Centralizing the decision keeps both paths converged: the same
54
+ * change always resolves to the same {@link ReloadType}, whether it is handed
55
+ * to the CDP controller or broadcast over the control bridge.
56
+ *
57
+ * Decision order per changed file:
58
+ * 1. manifest/_locales (forcedFull) → full reload.
59
+ * 2. Chunk-graph membership ({@link buildSourceFeatureIndex}): background
60
+ * chunk → service-worker; content chunk → content-scripts (re-injecting
61
+ * ONLY the entries whose chunks contain a changed file); page chunk →
62
+ * notify-only page.
63
+ * 3. Emitted static asset (exists at the same relative path in the output
64
+ * dir: manifest icons, web-accessible resources, DNR rulesets) → full
65
+ * reload — the browser only re-reads those from disk on an extension
66
+ * reload, and re-injecting content scripts for an icon edit is a storm
67
+ * of no-ops (the wild-corpus Sappgulf bug).
68
+ * 4. Name heuristics, as before, for anything the graph can't see.
69
+ *
70
+ * The thunks keep the (cheap) index build and manifest read lazy — they only
71
+ * run when a classification actually needs them.
72
+ *
73
+ * Returns a notify-only `type: 'page'` instruction for page-only edits
74
+ * (popup/options/devtools/newtab HTML/CSS/JS) — those are delivered by
75
+ * rspack-dev-server's livereload broadcast, so firing an extension reload
76
+ * would race it and flash the open surface. The 'page' instruction only
77
+ * carries the announcement label; dispatch never reloads the extension for it.
78
+ */
79
+ export declare function classifyReloadFromSources(opts: {
80
+ changedSources: string[];
81
+ forcedFull?: boolean;
82
+ getContentScriptCount: () => number;
83
+ getSourceFeatureIndex?: () => SourceFeatureIndex | null;
84
+ outputPath?: string;
85
+ }): ReloadInstruction | undefined;
86
+ export declare function readContentScriptCount(compilation: any, outputPath: string): number;