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,38 @@
1
+ import type { Configuration } from '@rspack/core';
2
+ import type { BrowserConfig, DevOptions } from '../types';
3
+ export declare function loadCustomConfig(projectPath: string): Promise<(config: Configuration) => Configuration>;
4
+ export declare function loadCommandConfig(projectPath: string, command: 'dev' | 'build' | 'start' | 'preview'): Promise<{
5
+ perfBudgets: any;
6
+ transpilePackages: any;
7
+ extensions: any;
8
+ } | {
9
+ perfBudgets?: undefined;
10
+ transpilePackages: any;
11
+ extensions: any;
12
+ } | {
13
+ perfBudgets: any;
14
+ transpilePackages?: undefined;
15
+ extensions: any;
16
+ } | {
17
+ perfBudgets?: undefined;
18
+ transpilePackages?: undefined;
19
+ extensions: any;
20
+ } | {
21
+ perfBudgets: any;
22
+ transpilePackages: any;
23
+ extensions?: undefined;
24
+ } | {
25
+ perfBudgets?: undefined;
26
+ transpilePackages: any;
27
+ extensions?: undefined;
28
+ } | {
29
+ perfBudgets: any;
30
+ transpilePackages?: undefined;
31
+ extensions?: undefined;
32
+ } | {
33
+ perfBudgets?: undefined;
34
+ transpilePackages?: undefined;
35
+ extensions?: undefined;
36
+ }>;
37
+ export declare function loadBrowserConfig(projectPath: string, browser?: DevOptions['browser']): Promise<BrowserConfig>;
38
+ export declare function isUsingExperimentalConfig(projectPath: string): Promise<boolean>;
@@ -0,0 +1,11 @@
1
+ export declare const CERTIFICATE_DESTINATION_PATH: string;
2
+ export declare const CHROMIUM_BASED_BROWSERS: string[];
3
+ export declare const GECKO_BASED_BROWSERS: string[];
4
+ export declare const CHROMIUM_FAMILY_ALIASES: string[];
5
+ export declare const GECKO_FAMILY_ALIASES: string[];
6
+ export declare const SUPPORTED_BROWSERS: string[];
7
+ export declare const SUPPORTED_PACKAGE_MANAGERS: readonly ["npm", "pnpm", "yarn", "bun", "deno"];
8
+ export declare const SUPPORTED_UI_FRAMEWORKS: readonly ["react", "preact", "vue", "svelte"];
9
+ export declare const SUPPORTED_CSS_TECH: readonly ["css", "css-modules", "sass", "less", "postcss", "tailwind"];
10
+ export declare function isChromiumBasedBrowser(browser: string): boolean;
11
+ export declare function isGeckoBasedBrowser(browser: string): boolean;
@@ -0,0 +1,9 @@
1
+ import { type BrowserConfig, type BrowserType } from '../types';
2
+ export declare function getDarkModeDefaults(browser: BrowserType): Pick<BrowserConfig, 'browserFlags' | 'preferences'>;
3
+ /**
4
+ * Merge dark-mode defaults into an existing BrowserConfig without overriding
5
+ * explicit user choices. Flags are de-duplicated preserving user order.
6
+ */
7
+ export declare function withDarkMode<T extends BrowserConfig & {
8
+ browser: BrowserType;
9
+ }>(config: T): T;
@@ -0,0 +1,4 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ export declare const HMR_CLIENT_SPECIFIER = "@rspack/dev-server/client/index.js";
3
+ export declare const HMR_HOT_SPECIFIER = "@rspack/core/hot/dev-server";
4
+ export declare function getDevServerHmrImports(compiler: Compiler): string[];
@@ -0,0 +1,3 @@
1
+ export declare function findExtensionDevelopRoot(): string | null;
2
+ export declare function resolveDevelopInstallRoot(): string | undefined;
3
+ export declare function resolveDevelopDistFile(stem: string): string;
@@ -0,0 +1,10 @@
1
+ import { type AbsolutePath } from './paths';
2
+ /**
3
+ * Install the user's project dependencies if node_modules is missing or stale.
4
+ * This runs `npm install` (or pnpm/yarn/bun) in the project directory so that
5
+ * user-declared dependencies (sass, vue, react, etc.) are available to the
6
+ * bundler. Without this, `pnpm dlx extension build` in a clean directory would
7
+ * fail to resolve project dependencies.
8
+ */
9
+ export declare function ensureUserProjectDependencies(packageJsonDir: AbsolutePath): Promise<void>;
10
+ export declare function ensureDevelopArtifacts(): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function computeExtensionsToLoad(baseDir: string, mode: 'development' | 'production' | 'none' | string | undefined, browser: string, userExtensionOutputPath: string, extraExtensionDirs?: string[], userManifestPath?: string): string[];
@@ -0,0 +1 @@
1
+ export declare function generateExtensionTypes(manifestDir: string, packageJsonDir: string): Promise<void>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * True when `packageName` is declared by the project's manifest: package.json
3
+ * dependency fields (dependencies, devDependencies, optionalDependencies,
4
+ * peerDependencies) or a deno.json(c) `npm:` import.
5
+ */
6
+ export declare function hasDependency(projectPath: string, packageName: string): boolean;
@@ -0,0 +1,2 @@
1
+ import type { Manifest, DevOptions } from '../types';
2
+ export declare function filterKeysForThisBrowser(manifest: Manifest, browser: DevOptions['browser']): any;
@@ -0,0 +1,55 @@
1
+ import type { DevOptions, Manifest } from '../types';
2
+ export declare const fmt: {
3
+ heading: (title: string) => string;
4
+ label: (key: string) => string;
5
+ val: (value: string) => string;
6
+ code: (value: string) => string;
7
+ bullet: (value: string) => string;
8
+ block(title: string, rows: Array<[string, string]>): string;
9
+ truncate(input: unknown, max?: number): string;
10
+ };
11
+ export declare function resolvedWorkspaceManifest(projectPath: string, manifestPath: string): string;
12
+ export declare function remoteFetchTimedOut(target: string, ms: number): string;
13
+ export declare function manifestInvalidJson(manifestPath: string, error: unknown): string;
14
+ export declare function notAnExtensionManifestError(manifestPath: string): string;
15
+ export declare function manifestNotFoundError(manifestPath: string, candidates?: string[]): string;
16
+ export declare function building(browser: DevOptions['browser']): string;
17
+ export declare function previewing(browser: DevOptions['browser']): string;
18
+ export declare function previewSkippedNoBrowser(browser: DevOptions['browser']): string;
19
+ export declare function authorInstallNotice(target: string): string;
20
+ export declare function projectInstallFallbackToNpm(pmName: string): string;
21
+ export declare function projectInstallScriptsDisabled(pmName: string): string;
22
+ export declare function buildWebpack(projectDir: string, stats: any, browser: DevOptions['browser']): string;
23
+ export declare function buildSuccess(): string;
24
+ export declare function buildSuccessWithWarnings(warningCount: number): string;
25
+ export declare function buildWarningsDetails(warnings: any[]): string;
26
+ export declare function fetchingProjectPath(owner: string, project: string): string;
27
+ export declare function downloadingProjectPath(projectName: string): string;
28
+ export declare function creatingProjectPath(projectPath: string): string;
29
+ export declare function downloadedProjectFolderNotFound(cwd: string, candidates: string[]): string;
30
+ export declare function packagingSourceFiles(zipPath: string): string;
31
+ export declare function packagingDistributionFiles(zipPath: string): string;
32
+ export declare function treeWithSourceAndDistFiles(browser: DevOptions['browser'], name: string, sourceZip: string, destZip: string): string;
33
+ export declare function treeWithDistFilesbrowser(name: string, ext: string, browser: DevOptions['browser'], zipPath: string): string;
34
+ export declare function treeWithSourceFiles(name: string, ext: string, browser: DevOptions['browser'], zipPath: string): string;
35
+ export declare function writingTypeDefinitions(manifest: Manifest): string;
36
+ export declare function writingTypeDefinitionsError(error: any): string;
37
+ export declare function downloadingText(url: string): string;
38
+ export declare function unpackagingExtension(zipFilePath: string): string;
39
+ export declare function unpackagedSuccessfully(): string;
40
+ export declare function failedToDownloadOrExtractZIPFileError(error: any): string;
41
+ export declare function invalidRemoteZip(url: string, contentType: string): string;
42
+ export declare function notAZipArchive(source: string, contentType?: string): string;
43
+ export declare function localZipNotFound(zipFilePath: string): string;
44
+ export declare function isUsingExperimentalConfig(integration: any): string;
45
+ export declare function debugDirs(manifestDir: string, packageJsonDir: string): string;
46
+ export declare function debugBrowser(browser: DevOptions['browser'], chromiumBinary?: string, geckoBinary?: string): string;
47
+ export declare function debugOutputPath(pathValue: string): string;
48
+ export declare function debugPreviewOutput(outputPath: string, distPath: string): string;
49
+ export declare function debugContextPath(packageJsonDir: string): string;
50
+ export declare function debugExtensionsToLoad(extensions: string[]): string;
51
+ export declare function noCompanionExtensionsResolved(): string;
52
+ export declare function configLoadingError(configPath: string, error: unknown): string;
53
+ export declare function buildCommandFailed(error: unknown): string;
54
+ export declare function devCommandFailed(error: unknown): string;
55
+ export declare function managedDependencyConflict(duplicates: string[], userPackageJsonPath: string): string;
@@ -0,0 +1,14 @@
1
+ export type OptionalDependencyVerificationRule = {
2
+ type: 'install-root';
3
+ packageId: string;
4
+ } | {
5
+ type: 'module-context-resolve' | 'module-context-load';
6
+ fromPackage: string;
7
+ packageId: string;
8
+ };
9
+ export type OptionalDependencyContract = {
10
+ id: string;
11
+ integration: string;
12
+ installPackages: string[];
13
+ verificationRules: OptionalDependencyVerificationRule[];
14
+ };
@@ -0,0 +1,13 @@
1
+ import type { OptionalDependencyContract, OptionalDependencyVerificationRule } from './optional-dependency-types';
2
+ declare const OPTIONAL_DEPENDENCY_CONTRACTS: {
3
+ typescript: OptionalDependencyContract;
4
+ 'react-refresh': OptionalDependencyContract;
5
+ 'preact-refresh': OptionalDependencyContract;
6
+ vue: OptionalDependencyContract;
7
+ svelte: OptionalDependencyContract;
8
+ less: OptionalDependencyContract;
9
+ postcss: OptionalDependencyContract;
10
+ sass: OptionalDependencyContract;
11
+ };
12
+ export declare function getOptionalDependencyContract(contractId: string): OptionalDependencyContract;
13
+ export { OPTIONAL_DEPENDENCY_CONTRACTS, type OptionalDependencyContract, type OptionalDependencyVerificationRule };
@@ -0,0 +1,41 @@
1
+ import type { OptionalDependencyContract } from './optional-dependency-types';
2
+ type EnsureResolveInput = {
3
+ integration: string;
4
+ projectPath: string;
5
+ dependencyId: string;
6
+ installDependencies?: string[];
7
+ verifyPackageIds?: string[];
8
+ contract?: OptionalDependencyContract;
9
+ };
10
+ type EnsureLoadInput<T = any> = EnsureResolveInput & {
11
+ moduleAdapter?: (loaded: any) => T;
12
+ };
13
+ export declare function getContractVerificationFailuresFromKnownLocations(contract: OptionalDependencyContract, projectPath: string): string[];
14
+ export declare function getContractVerificationFailuresAtInstallRoot(contract: OptionalDependencyContract, installRoot: string): string[];
15
+ export declare function ensureOptionalPackageResolved(input: EnsureResolveInput): Promise<string>;
16
+ export declare function resolveOptionalPackageWithoutInstall(input: EnsureResolveInput): string;
17
+ export declare function ensureOptionalModuleLoaded<T = any>(input: EnsureLoadInput<T>): Promise<T>;
18
+ export declare function loadOptionalModuleWithoutInstall<T = any>(input: EnsureLoadInput<T>): T;
19
+ export declare function ensureOptionalContractPackageResolved(input: {
20
+ contractId: string;
21
+ projectPath: string;
22
+ dependencyId: string;
23
+ }): Promise<string>;
24
+ export declare function ensureOptionalContractModuleLoaded<T = any>(input: {
25
+ contractId: string;
26
+ projectPath: string;
27
+ dependencyId: string;
28
+ moduleAdapter?: (loaded: any) => T;
29
+ }): Promise<T>;
30
+ export declare function resolveOptionalContractPackageWithoutInstall(input: {
31
+ contractId: string;
32
+ projectPath: string;
33
+ dependencyId: string;
34
+ }): string;
35
+ export declare function loadOptionalContractModuleWithoutInstall<T = any>(input: {
36
+ contractId: string;
37
+ projectPath: string;
38
+ dependencyId: string;
39
+ moduleAdapter?: (loaded: any) => T;
40
+ }): T;
41
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare function findNearestPackageJson(manifestPath: string): Promise<string | null>;
2
+ export declare function findNearestPackageJsonSync(manifestPath: string): string | null;
3
+ export declare function validatePackageJson(packageJsonPath: string): boolean;
@@ -0,0 +1,61 @@
1
+ import { buildExecEnv } from 'prefers-yarn';
2
+ export { buildExecEnv };
3
+ import { SUPPORTED_PACKAGE_MANAGERS } from './constants';
4
+ export type PackageManagerName = (typeof SUPPORTED_PACKAGE_MANAGERS)[number];
5
+ export type PackageManagerResolution = {
6
+ name: PackageManagerName;
7
+ execPath?: string;
8
+ runnerCommand?: string;
9
+ runnerArgs?: string[];
10
+ };
11
+ type ExecOptions = {
12
+ cwd?: string;
13
+ stdio?: 'inherit' | 'ignore' | 'pipe';
14
+ env?: Record<string, string>;
15
+ };
16
+ export declare function resolvePackageManager(opts?: {
17
+ cwd?: string;
18
+ }): PackageManagerResolution;
19
+ /**
20
+ * Extra args that confine a *project* dependency install to the project
21
+ * directory. pnpm walks up from cwd and, on finding any ancestor
22
+ * `pnpm-workspace.yaml`, installs that ENTIRE workspace instead of the
23
+ * project — for a project that merely sits under an unrelated monorepo
24
+ * (G28), that installs a foreign codebase's dependency tree. Skip the
25
+ * confinement only when the workspace is genuinely the project's own:
26
+ * the project dir is itself a workspace root, or its package.json uses
27
+ * `workspace:` specifiers (a standalone install could never satisfy those).
28
+ */
29
+ export declare function projectInstallArgs(pm: PackageManagerResolution, projectDir: string): string[];
30
+ /**
31
+ * Args/env that stop an auto-install from running lifecycle scripts
32
+ * (preinstall/postinstall/prepare) — the project being built was never
33
+ * vetted by the user typing an install command, so a wild package.json
34
+ * must not get code execution as a side effect of `extension dev/build`.
35
+ * Matches the pnpm 10 / Bun default. Opt back in with
36
+ * EXTENSION_ALLOW_INSTALL_SCRIPTS=true.
37
+ *
38
+ * yarn needs env instead of a flag: yarn 1 accepts --ignore-scripts but
39
+ * Berry rejects unknown flags outright, and the resolved binary's major
40
+ * is unknowable here. Berry maps YARN_ENABLE_SCRIPTS -> enableScripts;
41
+ * yarn 1 reads npm_config_* and ignores YARN_ENABLE_SCRIPTS. deno install
42
+ * already refuses npm lifecycle scripts unless --allow-scripts is passed.
43
+ */
44
+ export declare function installScriptSuppression(pm: PackageManagerResolution): {
45
+ args: string[];
46
+ env: Record<string, string>;
47
+ };
48
+ /**
49
+ * A hydrated npm resolution for fallback installs: PATH npm first, then the
50
+ * npm CLI bundled with the running Node.
51
+ */
52
+ export declare function resolveNpmPackageManager(): PackageManagerResolution;
53
+ export declare function buildInstallCommand(pm: PackageManagerResolution, args: string[]): {
54
+ command: string;
55
+ args: string[];
56
+ };
57
+ export declare function buildSpawnInvocation(command: string, args: string[]): {
58
+ command: string;
59
+ args: string[];
60
+ };
61
+ export declare function execInstallCommand(command: string, args: string[], options?: ExecOptions): Promise<void>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Strips the UTF-8 BOM (0xFEFF) that some editors prepend to JSON files.
3
+ * Chrome tolerates the BOM in every extension JSON it reads (manifest.json,
4
+ * declarativeNetRequest rulesets, _locales) — verified against live Chrome —
5
+ * so every parse of user-authored JSON must strip it too.
6
+ */
7
+ export declare function stripBom(text: string | Buffer): string;
8
+ /**
9
+ * JSON.parse with BOM stripping. Empty input parses as `{}`; invalid JSON
10
+ * still throws. Use `JSON.parse(stripBom(...))` instead where empty input
11
+ * must stay an error.
12
+ */
13
+ export declare function parseJsonSafe(text: string | Buffer): any;
@@ -0,0 +1,19 @@
1
+ import type { ProjectStructure } from './project';
2
+ export type AbsolutePath = string & {
3
+ readonly __brand: 'AbsolutePath';
4
+ };
5
+ export type BrowserInput = 'chrome' | 'edge' | 'chromium' | 'firefox' | 'brave' | 'opera' | 'vivaldi' | 'yandex' | 'waterfox' | 'librewolf' | 'chromium-based' | 'gecko-based' | 'firefox-based' | 'safari' | 'webkit-based' | undefined;
6
+ export type NormalizedBrowser = 'chrome' | 'edge' | 'chromium' | 'firefox' | 'brave' | 'opera' | 'vivaldi' | 'yandex' | 'waterfox' | 'librewolf' | 'chromium-based' | 'gecko-based' | 'safari' | 'webkit-based';
7
+ export declare function asAbsolute(p: string): AbsolutePath;
8
+ export declare function toPosixPath(p: string): string;
9
+ export declare function getDirs(struct: ProjectStructure): {
10
+ manifestDir: AbsolutePath;
11
+ packageJsonDir: AbsolutePath;
12
+ };
13
+ export declare function getNodeModulesDir(packageJsonDir: AbsolutePath): AbsolutePath;
14
+ export declare function needsInstall(packageJsonDir: AbsolutePath): boolean;
15
+ export declare function normalizeBrowser(browser: BrowserInput, chromiumBinary?: string, geckoBinary?: string, safariBinary?: string): NormalizedBrowser;
16
+ export declare function getDistPath(packageJsonDir: AbsolutePath, browser: string): AbsolutePath;
17
+ export declare function computePreviewOutputPath(struct: ProjectStructure, browser: string, explicitOutputPath?: string): AbsolutePath;
18
+ export declare function ensureDirSync(dir: AbsolutePath): void;
19
+ export declare function devtoolsEngineFor(browser: any): 'chrome' | 'edge' | 'chromium' | 'firefox';
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Files that mark a directory as a project root and declare its dependencies.
3
+ * package.json is the npm-family manifest; deno.json(c) is Deno's, where npm
4
+ * dependencies appear as `npm:` specifiers in the `imports` map.
5
+ */
6
+ export declare const PROJECT_MANIFEST_FILENAMES: readonly ["package.json", "deno.jsonc", "deno.json"];
7
+ export declare const DENO_CONFIG_FILENAMES: readonly ["deno.jsonc", "deno.json"];
8
+ /**
9
+ * Removes JSONC extensions (// and block comments, trailing commas) so the
10
+ * result parses with JSON.parse. String contents — including commas and
11
+ * comment-looking sequences inside them — are preserved verbatim.
12
+ */
13
+ export declare function stripJsoncExtensions(text: string): string;
14
+ /**
15
+ * JSON.parse for JSONC input (comments + trailing commas tolerated).
16
+ * Empty input parses as `{}`; invalid syntax still throws.
17
+ */
18
+ export declare function parseJsoncSafe(text: string | Buffer): any;
19
+ /**
20
+ * Parses an `npm:` import specifier into its package name and version range.
21
+ * Handles `npm:pkg@ver`, `npm:@scope/pkg@ver`, the path form `npm:/pkg@ver/sub`,
22
+ * and versionless `npm:pkg` (version `*`).
23
+ */
24
+ export declare function parseNpmSpecifier(specifier: unknown): {
25
+ name: string;
26
+ version: string;
27
+ } | undefined;
28
+ export declare function findDenoConfigPath(projectDir: string): string | undefined;
29
+ /**
30
+ * Dependencies a deno.json(c) declares through `npm:` specifiers in its
31
+ * `imports` map. Both the npm package name and the import alias are
32
+ * registered: the alias is what project source imports, the package name is
33
+ * what lands in node_modules — dependency checks may ask for either.
34
+ */
35
+ export declare function readDenoConfigDependencies(denoConfigPath: string): Record<string, string>;
36
+ /**
37
+ * The project's declared dependencies, merged across every manifest present
38
+ * in `projectDir`: package.json dependency fields and deno.json(c) `npm:`
39
+ * imports. package.json wins when both declare the same package.
40
+ */
41
+ export declare function readProjectDependencies(projectDir: string): Record<string, string>;
42
+ export declare function hasProjectDependency(projectDir: string, packageName: string): boolean;
43
+ /**
44
+ * Walks up from `startPath` to the nearest directory containing a project
45
+ * manifest (package.json or deno.json(c)).
46
+ */
47
+ export declare function findNearestProjectManifestDirSync(startPath: string, maxDepth?: number): string | undefined;
48
+ /**
49
+ * Find-up variant that returns the manifest file path itself, preferring
50
+ * package.json when a directory holds more than one manifest. Walks to the
51
+ * filesystem root, mirroring findNearestPackageJsonSync.
52
+ */
53
+ export declare function findNearestProjectManifestSync(manifestPath: string): string | null;
54
+ /**
55
+ * Walks up from the extension manifest to the nearest deno.json(c), mirroring
56
+ * findNearestPackageJson's contract (walks to the filesystem root).
57
+ */
58
+ export declare function findNearestDenoConfigSync(manifestPath: string): string | null;
59
+ /** True when the file exists and parses as JSONC. */
60
+ export declare function validateDenoConfig(denoConfigPath: string): boolean;
@@ -0,0 +1,7 @@
1
+ export interface ProjectStructure {
2
+ manifestPath: string;
3
+ packageJsonPath?: string;
4
+ denoJsonPath?: string;
5
+ }
6
+ export declare function getProjectPath(pathOrRemoteUrl: string | undefined): Promise<string>;
7
+ export declare function getProjectStructure(pathOrRemoteUrl: string | undefined): Promise<ProjectStructure>;
@@ -0,0 +1,4 @@
1
+ export declare function canonicalizeDir(dir: string): string;
2
+ export declare function canonicalizeResourcePath(resourcePath: string): string;
3
+ export declare function toResourceKey(resourcePath: string): string;
4
+ export declare function isResourceUnderDirs(resource: string, dirs: string[]): boolean;
@@ -0,0 +1,2 @@
1
+ export declare const RUST_MIN_STACK_BYTES: number;
2
+ export declare function ensureRustMinStack(env?: NodeJS.ProcessEnv): void;
@@ -0,0 +1 @@
1
+ export declare function sanitize<T extends Record<string, any>>(obj: T): Partial<T>;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * THE owner of every on-disk session-state path. Dev sessions are
3
+ * per project+browser, so every artifact here must embed the browser key —
4
+ * a per-project single slot gets clobbered the moment a second browser
5
+ * session starts on the same project (the control.token defect: session B's
6
+ * start overwrote session A's eval token, and either shutdown deleted it
7
+ * for both). New artifacts MUST be registered in SESSION_ARTIFACTS; the
8
+ * layout spec fails any per-project shape that isn't an explicitly
9
+ * allowlisted legacy slot, and a repo-scan spec fails path joins that
10
+ * bypass this module.
11
+ *
12
+ * Two roots with different lifetimes:
13
+ * - `<project>/.extension-js/` survives dist wipes. Anything a browser
14
+ * profile may have baked in (ports, tokens) lives here — a profile can
15
+ * outlive dist/, and state that dies with dist strands the profile's
16
+ * cached service worker (issue #484).
17
+ * - `<project>/dist/extension-js/<browser>/` dies with dist. Machine
18
+ * contracts and logs that describe the CURRENT session only.
19
+ */
20
+ export declare function sessionStateDir(projectPath: string): string;
21
+ export declare function controlPortFilePath(projectPath: string, browser: string): string;
22
+ /** Pre-#484 location: died with dist/ while profiles outlived it. Read-only
23
+ * fallback so a 4.0.6-era profile's cached SW can still resync. */
24
+ export declare function legacyControlPortFilePath(projectPath: string, browser: string): string;
25
+ export declare function controlTokenPath(projectPath: string, browser: string): string;
26
+ /** Pre-fix single-slot token shared by every browser session of a project. */
27
+ export declare function legacyControlTokenPath(projectPath: string): string;
28
+ export declare function browserArtifactsDir(projectPath: string, browser: string): string;
29
+ export declare function readyContractPath(projectPath: string, browser: string): string;
30
+ export declare function eventsPath(projectPath: string, browser: string): string;
31
+ export declare function logsPath(projectPath: string, browser: string): string;
32
+ export declare function actionsPath(projectPath: string, browser: string): string;
33
+ export type SessionArtifactKeying = 'per-browser' | 'legacy-shared' | 'legacy-per-browser-in-dist';
34
+ export interface SessionArtifact {
35
+ name: string;
36
+ keying: SessionArtifactKeying;
37
+ build: (projectPath: string, browser: string) => string;
38
+ }
39
+ export declare const SESSION_ARTIFACTS: ReadonlyArray<SessionArtifact>;
@@ -0,0 +1 @@
1
+ export declare function handleStatsErrors(stats: any): void;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Resolves package roots for transpile allowlist entries.
3
+ * We keep both the symlinked package path and its real path so include/exclude
4
+ * checks work across npm/pnpm/yarn and different symlink modes.
5
+ */
6
+ export declare function resolveTranspilePackageDirs(projectRoot: string, transpilePackages?: string[]): string[];
7
+ export declare function isSubPath(resourcePath: string, directoryPath: string): boolean;
@@ -0,0 +1 @@
1
+ export declare function assertNoManagedDependencyConflicts(userManifestPath: string, projectPath: string): void;
@@ -0,0 +1,2 @@
1
+ export declare function downloadAndExtractZip(url: string, targetPath: string): Promise<string>;
2
+ export declare function extractLocalZip(zipFilePath: string, targetPath: string): Promise<string>;
@@ -0,0 +1,8 @@
1
+ import './lib/rust-min-stack';
2
+ import { extensionBuild } from './command-build';
3
+ import { extensionDev } from './command-dev';
4
+ import { extensionPreview } from './command-preview';
5
+ import { type FileConfig, type BuildOptions, type DevOptions, type PreviewOptions, type Manifest } from './types';
6
+ import { BuildEmitter, type CompiledEvent, type BuildErrorEvent, type BrowserLauncherFn, type BrowserLaunchOptions, type BrowserController } from './plugin-browsers';
7
+ import { type ReloadType, type ReloadInstruction } from './plugin-reload';
8
+ export { extensionBuild, BuildOptions, extensionDev, DevOptions, extensionPreview, PreviewOptions, FileConfig, Manifest, BuildEmitter, CompiledEvent, BuildErrorEvent, ReloadType, ReloadInstruction, BrowserLauncherFn, BrowserLaunchOptions, BrowserController };
@@ -0,0 +1,108 @@
1
+ import { EventEmitter } from 'node:events';
2
+ import type { Compiler } from '@rspack/core';
3
+ import { type ReloadBroker, type ReloadInstruction } from '../plugin-reload';
4
+ export interface CompiledEvent {
5
+ outputPath: string;
6
+ contextDir: string;
7
+ isFirstCompile: boolean;
8
+ reloadInstruction?: ReloadInstruction;
9
+ extensionsToLoad?: string[];
10
+ }
11
+ export interface BuildErrorEvent {
12
+ errors: string[];
13
+ }
14
+ export interface BuildEventMap {
15
+ compiled: [CompiledEvent];
16
+ error: [BuildErrorEvent];
17
+ close: [];
18
+ }
19
+ export declare class BuildEmitter extends EventEmitter<BuildEventMap> {
20
+ constructor();
21
+ }
22
+ export interface BrowserLaunchOptions {
23
+ browser: string;
24
+ outputPath: string;
25
+ contextDir: string;
26
+ extensionsToLoad: string[];
27
+ mode?: 'development' | 'production';
28
+ enableDevtools?: boolean;
29
+ noOpen?: boolean;
30
+ profile?: string | false;
31
+ persistProfile?: boolean;
32
+ keepProfileChanges?: boolean;
33
+ copyFromProfile?: string;
34
+ preferences?: Record<string, unknown>;
35
+ browserFlags?: string[];
36
+ excludeBrowserFlags?: string[];
37
+ startingUrl?: string;
38
+ chromiumBinary?: string;
39
+ geckoBinary?: string;
40
+ instanceId?: string;
41
+ port?: number | string;
42
+ dryRun?: boolean;
43
+ logLevel?: string;
44
+ logContexts?: string[];
45
+ logFormat?: 'pretty' | 'json' | 'ndjson';
46
+ logTimestamps?: boolean;
47
+ logColor?: boolean;
48
+ logUrl?: string;
49
+ logTab?: number | string;
50
+ }
51
+ export interface BrowserController {
52
+ enableUnifiedLogging(opts: {
53
+ level?: string;
54
+ contexts?: string[];
55
+ format?: 'pretty' | 'json' | 'ndjson';
56
+ timestamps?: boolean;
57
+ color?: boolean;
58
+ urlFilter?: string;
59
+ tabFilter?: number | string;
60
+ }): Promise<void>;
61
+ }
62
+ export type BrowserLauncherFn = (opts: BrowserLaunchOptions) => Promise<BrowserController>;
63
+ export interface RunnerPlugin {
64
+ readonly emitter: BuildEmitter;
65
+ extensionsToLoad: string[];
66
+ apply(compiler: Compiler): void;
67
+ }
68
+ export interface BrowsersPluginOptions {
69
+ /** Injected browser launcher — provided by the CLI from programs/extension/browsers/ */
70
+ launcher: BrowserLauncherFn;
71
+ /** Browser-related options forwarded to the launcher (outputPath/contextDir/extensionsToLoad are filled at compile time) */
72
+ browserOptions: Omit<BrowserLaunchOptions, 'outputPath' | 'contextDir' | 'extensionsToLoad'>;
73
+ }
74
+ /**
75
+ * BrowsersPlugin
76
+ *
77
+ * An rspack plugin that manages the browser lifecycle for extension development.
78
+ * On first successful compilation it launches a browser via the injected launcher
79
+ * function; on subsequent compilations it classifies changed files and triggers
80
+ * the appropriate reload strategy (full / service-worker / content-scripts).
81
+ *
82
+ * A `BuildEmitter` is exposed as `plugin.emitter` so that external consumers
83
+ * (CLI telemetry, wait-mode, etc.) can subscribe to build events without
84
+ * coupling to rspack.
85
+ */
86
+ export declare class BrowsersPlugin implements RunnerPlugin {
87
+ private readonly options;
88
+ static readonly name = "plugin-browsers";
89
+ /** EventEmitter for build lifecycle events (compiled, error, close). */
90
+ readonly emitter: BuildEmitter;
91
+ /**
92
+ * Extension directories to load alongside the user extension.
93
+ * Set externally by webpack-config after computing companion extensions,
94
+ * before the first compilation.
95
+ */
96
+ extensionsToLoad: string[];
97
+ private isFirstCompile;
98
+ private controller;
99
+ private reloadBroker;
100
+ constructor(options: BrowsersPluginOptions);
101
+ /**
102
+ * Option B: the dev server injects the control-bridge broker so a launched
103
+ * Chromium reloads through the SW producer (the same path as `--no-browser`),
104
+ * not the CDP controller. Called once, before the first compile.
105
+ */
106
+ setReloadBroker(broker: ReloadBroker): void;
107
+ apply(compiler: Compiler): void;
108
+ }
@@ -0,0 +1,19 @@
1
+ import type { Compiler } from '@rspack/core';
2
+ import { BuildEmitter, type RunnerPlugin } from './index';
3
+ export type SafariPackagerFn = (distPath: string, mode: 'full' | 'resync') => Promise<void>;
4
+ export declare class SafariDevPlugin implements RunnerPlugin {
5
+ private readonly packager;
6
+ static readonly name = "safari-dev";
7
+ readonly emitter: BuildEmitter;
8
+ extensionsToLoad: string[];
9
+ private firstRun;
10
+ private active;
11
+ private pending;
12
+ private idleWaiters;
13
+ constructor(packager: SafariPackagerFn);
14
+ apply(compiler: Compiler): void;
15
+ idle(): Promise<void>;
16
+ private drain;
17
+ private runOne;
18
+ private settleIdle;
19
+ }
@@ -0,0 +1,5 @@
1
+ import type { DevOptions } from '../../types';
2
+ export declare function webextensionPolyfillNotFound(): string;
3
+ export declare function compatibilityPolyfillEnabled(browser: DevOptions['browser'], polyfillPath: string): string;
4
+ export declare function compatibilityPolyfillSkipped(reason: string, browser: DevOptions['browser']): string;
5
+ export declare function compatibilityPolyfillDisabled(browser: DevOptions['browser']): string;
@@ -0,0 +1,11 @@
1
+ import { Compiler } from '@rspack/core';
2
+ import type { PluginInterface, DevOptions } from '../types';
3
+ /**
4
+ * PolyfillPlugin is responsible for providing the `browser`
5
+ * global variable to the extension's codebase.
6
+ */
7
+ export declare class PolyfillPlugin {
8
+ readonly browser: DevOptions['browser'];
9
+ constructor(options: PluginInterface);
10
+ apply(compiler: Compiler): void;
11
+ }