extension-develop 4.1.41 → 4.1.42-canary.466.1b67056

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 (361) hide show
  1. package/README.md +127 -92
  2. package/dist/3~0.mjs +1 -1
  3. package/dist/5h~0.mjs +5 -13
  4. package/dist/5~0.mjs +60 -4
  5. package/dist/6~0.mjs +406 -28
  6. package/dist/7~0.mjs +38 -0
  7. package/dist/8~0.mjs +1508 -0
  8. package/dist/9q~0.mjs +248 -0
  9. package/dist/9~0.mjs +5 -99
  10. package/dist/asset-source-maps~0.mjs +19 -0
  11. package/dist/bh~0.mjs +27 -2
  12. package/dist/bridge-entry.d.ts +2 -2
  13. package/dist/bridge.mjs +10 -140
  14. package/dist/br~0.mjs +274 -0
  15. package/dist/b~0.mjs +53 -8624
  16. package/dist/command-build~0.mjs +1526 -0
  17. package/dist/command-dev.d.ts +1 -0
  18. package/dist/command-dev~0.mjs +309 -0
  19. package/dist/command-preview.d.ts +5 -7
  20. package/dist/command-preview~0.mjs +596 -0
  21. package/dist/config-loader~0.mjs +717 -0
  22. package/dist/contract/codes.json +290 -77
  23. package/dist/contract/envelope.schema.json +4 -1
  24. package/dist/contract/golden.doctor.healthy.json +1 -1
  25. package/dist/contract/golden.doctor.session-not-found.json +1 -1
  26. package/dist/contracts.mjs +3 -1
  27. package/dist/css-parse-guard-loader.mjs +4 -3
  28. package/dist/c~0.mjs +1 -1
  29. package/dist/dark-mode~0.mjs +77 -0
  30. package/dist/dead-css-url-loader.mjs +148 -23
  31. package/dist/dev-content-scripts~0.mjs +589 -0
  32. package/dist/dev-server/auto-exit.d.ts +2 -1
  33. package/dist/dev-server/cleanup.d.ts +23 -1
  34. package/dist/dev-server/control-bridge/broker.d.ts +5 -0
  35. package/dist/dev-server/control-bridge/consumer-client.d.ts +1 -0
  36. package/dist/dev-server/control-bridge/contracts.d.ts +3 -1
  37. package/dist/dev-server/control-bridge/producer-runtime.d.ts +1 -1
  38. package/dist/dev-server/control-bridge/production-control.d.ts +1 -33
  39. package/dist/dev-server/control-bridge/ws-control-server.d.ts +1 -0
  40. package/dist/dev-server/control-bridge-start.d.ts +24 -0
  41. package/dist/dev-server/cors.d.ts +23 -0
  42. package/dist/dev-server/file-event-assist.d.ts +25 -0
  43. package/dist/dev-server/index.d.ts +3 -3
  44. package/dist/dev-server/lifecycle-stream.d.ts +22 -6
  45. package/dist/dev-server/main-world-restart.d.ts +14 -0
  46. package/dist/dev-server/messages.d.ts +9 -0
  47. package/dist/dev-server/port-manager.d.ts +1 -0
  48. package/dist/dev-server/ready-contract-codes.d.ts +3 -0
  49. package/dist/dev-server/server-config.d.ts +26 -0
  50. package/dist/dev-server/session-claim.d.ts +1 -0
  51. package/dist/dev-server/session-end.d.ts +6 -0
  52. package/dist/dev-server/session-env.d.ts +3 -0
  53. package/dist/dev-server/session-gone-outputs.d.ts +15 -0
  54. package/dist/dev-server/session-holdings.d.ts +12 -0
  55. package/dist/dev-server/session-restart-handler.d.ts +47 -0
  56. package/dist/dev-server/session-restart-holds.d.ts +4 -0
  57. package/dist/dev-server/session-restart.d.ts +12 -3
  58. package/dist/dev-server/start-bundler.d.ts +91 -0
  59. package/dist/dev-server~0.mjs +1028 -470
  60. package/dist/d~0.mjs +178 -445
  61. package/dist/ensure-hmr-for-scripts.mjs +6 -17
  62. package/dist/extension-js-devtools/build-stamp.json +2 -2
  63. package/dist/extension-js-devtools/chrome/background/service_worker.js +2 -2
  64. package/dist/extension-js-devtools/chrome/extension-js-session.json +1 -1
  65. package/dist/extension-js-devtools/chrome/pages/welcome.css +1 -1
  66. package/dist/extension-js-devtools/chrome/pages/welcome.js +2 -2
  67. package/dist/extension-js-devtools/chromium/background/service_worker.js +2 -2
  68. package/dist/extension-js-devtools/chromium/extension-js-session.json +1 -1
  69. package/dist/extension-js-devtools/chromium/pages/welcome.css +1 -1
  70. package/dist/extension-js-devtools/chromium/pages/welcome.js +2 -2
  71. package/dist/extension-js-devtools/edge/background/service_worker.js +2 -2
  72. package/dist/extension-js-devtools/edge/extension-js-session.json +1 -1
  73. package/dist/extension-js-devtools/edge/pages/welcome.css +1 -1
  74. package/dist/extension-js-devtools/edge/pages/welcome.js +2 -2
  75. package/dist/extension-js-devtools/firefox/background/scripts.js +2 -2
  76. package/dist/extension-js-devtools/firefox/extension-js-session.json +1 -1
  77. package/dist/extension-js-devtools/firefox/pages/welcome.css +1 -1
  78. package/dist/extension-js-devtools/firefox/pages/welcome.js +2 -2
  79. package/dist/extension-js-theme/build-stamp.json +2 -2
  80. package/dist/ey~0.mjs +16 -2
  81. package/dist/e~0.mjs +1 -1
  82. package/dist/feature-scripts-classic-concat-loader.mjs +21 -4
  83. package/dist/feature-scripts-classic-traced-globals-loader.mjs +2 -2
  84. package/dist/feature-scripts-content-script-wrapper.mjs +87 -89
  85. package/dist/feature-scripts-native-geturl-import-loader.mjs +1 -1
  86. package/dist/g0~0.mjs +8 -9
  87. package/dist/g~0.mjs +407 -91
  88. package/dist/i~0.mjs +246 -0
  89. package/dist/j6~0.mjs +14 -2
  90. package/dist/j8~0.mjs +579 -0
  91. package/dist/j~0.mjs +1 -1
  92. package/dist/ka~0.mjs +25 -3
  93. package/dist/ke~0.mjs +382 -0
  94. package/dist/k~0.mjs +1344 -291
  95. package/dist/late-css-import-loader.mjs +3 -2
  96. package/dist/lib/addon-lint.d.ts +1 -1
  97. package/dist/lib/addon-reviewer-note.d.ts +0 -1
  98. package/dist/lib/build-output-guard.d.ts +9 -0
  99. package/dist/lib/build-summary.d.ts +5 -1
  100. package/dist/lib/coded-warnings.d.ts +5 -2
  101. package/dist/lib/config-loader.d.ts +10 -5
  102. package/dist/lib/constants.d.ts +0 -5
  103. package/dist/lib/corepack-registry.d.ts +5 -0
  104. package/dist/lib/dev-additions.d.ts +1 -1
  105. package/dist/lib/dev-server-client-import.d.ts +5 -1
  106. package/dist/lib/develop-build-entries.d.ts +6 -0
  107. package/dist/lib/development-artifacts.d.ts +0 -1
  108. package/dist/lib/diagnostic-code.d.ts +5 -0
  109. package/dist/lib/duplicate-output-files.d.ts +0 -1
  110. package/dist/lib/ensure-develop-artifacts.d.ts +11 -2
  111. package/dist/lib/extension-base-from-stack.d.ts +0 -1
  112. package/dist/lib/extension-id.d.ts +5 -0
  113. package/dist/lib/extensions-to-load.d.ts +24 -1
  114. package/dist/lib/generate-extension-types.d.ts +2 -1
  115. package/dist/lib/install-registry-failure.d.ts +30 -0
  116. package/dist/lib/launch-codes.d.ts +1 -0
  117. package/dist/lib/loader-source-maps.d.ts +0 -1
  118. package/dist/lib/machine-text.d.ts +1 -0
  119. package/dist/lib/manifest-utils.d.ts +3 -1
  120. package/dist/lib/messages.d.ts +47 -5
  121. package/dist/lib/messaging.d.ts +59 -12
  122. package/dist/lib/missing-reference-watch.d.ts +9 -0
  123. package/dist/lib/named-cause.d.ts +5 -0
  124. package/dist/lib/normalize-split-chunks.d.ts +0 -1
  125. package/dist/lib/optional-deps-resolver.d.ts +0 -1
  126. package/dist/lib/package-json.d.ts +0 -1
  127. package/dist/lib/package-manager.d.ts +8 -5
  128. package/dist/lib/parse-json-safe.d.ts +11 -0
  129. package/dist/lib/paths.d.ts +3 -2
  130. package/dist/lib/production-control/index.d.ts +38 -0
  131. package/dist/lib/project-manifest.d.ts +0 -2
  132. package/dist/lib/project.d.ts +3 -0
  133. package/dist/lib/real-path.d.ts +1 -0
  134. package/dist/lib/recorded-build-browser.d.ts +2 -0
  135. package/dist/lib/reload-session.d.ts +1 -0
  136. package/dist/lib/resource-path.d.ts +1 -0
  137. package/dist/lib/resource-query.d.ts +1 -0
  138. package/dist/lib/session-contract.d.ts +16 -0
  139. package/dist/lib/session-paths.d.ts +2 -13
  140. package/dist/lib/split-chunks.d.ts +0 -1
  141. package/dist/lib/thrown-location.d.ts +1 -0
  142. package/dist/lib/transpile-packages.d.ts +0 -1
  143. package/dist/lib/withheld-file.d.ts +13 -0
  144. package/dist/lib/zip.d.ts +0 -1
  145. package/dist/l~0.mjs +14 -1898
  146. package/dist/manifest-entry.d.ts +25 -3
  147. package/dist/manifest.mjs +11 -4
  148. package/dist/mn~0.mjs +234 -0
  149. package/dist/module.d.ts +12 -8
  150. package/dist/module.mjs +19 -4
  151. package/dist/m~0.mjs +188 -5907
  152. package/dist/o~0.mjs +19 -44
  153. package/dist/plugin-browsers/bounded-wait.d.ts +10 -0
  154. package/dist/plugin-browsers/index.d.ts +21 -12
  155. package/dist/plugin-browsers/launch-timeout-stamp.d.ts +2 -0
  156. package/dist/plugin-browsers/messages.d.ts +5 -0
  157. package/dist/plugin-browsers/safari-dev-plugin.d.ts +8 -3
  158. package/dist/plugin-browsers~0.mjs +873 -0
  159. package/dist/plugin-compatibility/compatibility-lib/no-extension-api-files.d.ts +4 -0
  160. package/dist/plugin-compatibility/feature-polyfill.d.ts +7 -2
  161. package/dist/plugin-compilation/boring.d.ts +7 -1
  162. package/dist/plugin-compilation/compilation-lib/js-literal.d.ts +1 -0
  163. package/dist/plugin-compilation/compilation-lib/messages.d.ts +25 -6
  164. package/dist/plugin-compilation/env.d.ts +4 -1
  165. package/dist/plugin-compilation/index.d.ts +3 -4
  166. package/dist/plugin-compilation/process-module.d.ts +2 -0
  167. package/dist/plugin-compilation/zip.d.ts +16 -1
  168. package/dist/plugin-css/common-style-loaders.d.ts +8 -0
  169. package/dist/plugin-css/css-lib/build-css-rules.d.ts +4 -0
  170. package/dist/plugin-css/css-lib/dead-url-refs.d.ts +6 -1
  171. package/dist/plugin-css/css-lib/inline-content-script-css.d.ts +6 -0
  172. package/dist/plugin-css/css-lib/inline-css-imports.d.ts +45 -0
  173. package/dist/plugin-css/css-lib/messages.d.ts +26 -5
  174. package/dist/plugin-css/css-lib/style-diagnostics.d.ts +2 -0
  175. package/dist/plugin-css/css-lib/user-css-rules.d.ts +5 -0
  176. package/dist/plugin-css/css-lib/verbatim-css.d.ts +2 -1
  177. package/dist/plugin-css/css-parse-guard-loader.d.ts +1 -0
  178. package/dist/plugin-css/css-tools/postcss.d.ts +15 -1
  179. package/dist/plugin-css/css-tools/sass.d.ts +1 -1
  180. package/dist/plugin-css/css-tools/tailwind.d.ts +1 -0
  181. package/dist/plugin-css/dead-css-url-loader.d.ts +4 -0
  182. package/dist/plugin-css/index.d.ts +5 -3
  183. package/dist/plugin-css/preprocessor-passthrough-loader.d.ts +5 -0
  184. package/dist/plugin-css/public-css-url-loader.d.ts +7 -0
  185. package/dist/plugin-js-frameworks/js-frameworks-lib/load-loader-options.d.ts +3 -1
  186. package/dist/plugin-js-frameworks/js-frameworks-lib/messages.d.ts +0 -4
  187. package/dist/plugin-js-frameworks/js-tools/decorators.d.ts +7 -0
  188. package/dist/plugin-js-frameworks/js-tools/preact.d.ts +3 -1
  189. package/dist/plugin-js-frameworks/js-tools/react.d.ts +3 -1
  190. package/dist/plugin-js-frameworks/js-tools/solid.d.ts +3 -1
  191. package/dist/plugin-js-frameworks/js-tools/svelte.d.ts +13 -2
  192. package/dist/plugin-js-frameworks/js-tools/typescript-reach.d.ts +7 -0
  193. package/dist/plugin-js-frameworks/js-tools/typescript.d.ts +9 -17
  194. package/dist/plugin-js-frameworks/js-tools/vue.d.ts +3 -1
  195. package/dist/plugin-perf-budgets/categorize.d.ts +9 -1
  196. package/dist/plugin-perf-budgets/index.d.ts +18 -5
  197. package/dist/plugin-perf-budgets/messages.d.ts +9 -0
  198. package/dist/plugin-perf-budgets/referrers.d.ts +2 -2
  199. package/dist/plugin-playwright/index.d.ts +7 -0
  200. package/dist/plugin-reload/build-reload.d.ts +9 -0
  201. package/dist/plugin-reload/index.d.ts +16 -12
  202. package/dist/plugin-reload/messages.d.ts +2 -0
  203. package/dist/plugin-reload/reload-after-package.d.ts +3 -0
  204. package/dist/plugin-reload/reload-lib/content-script-reinject.d.ts +3 -0
  205. package/dist/plugin-reload/reload-lib/dev-content-scripts.d.ts +3 -4
  206. package/dist/plugin-reload/steps/add-content-script-reinject.d.ts +7 -0
  207. package/dist/plugin-reload/steps/inject-bridge-producer.d.ts +7 -0
  208. package/dist/plugin-reload/steps/inject-bridge-relay.d.ts +6 -0
  209. package/dist/plugin-reload/steps/setup-reload-strategy/index.d.ts +1 -11
  210. package/dist/plugin-reload/steps/setup-reload-strategy/setup-background-entry.d.ts +4 -0
  211. package/dist/plugin-special-folders/emit-root-absolute-refs.d.ts +8 -2
  212. package/dist/plugin-special-folders/folder-extensions/resolve-config.d.ts +3 -0
  213. package/dist/plugin-special-folders/folder-extensions/resolve-dirs.d.ts +1 -0
  214. package/dist/plugin-special-folders/folders-config.d.ts +1 -2
  215. package/dist/plugin-special-folders/get-data.d.ts +7 -1
  216. package/dist/plugin-special-folders/messages.d.ts +4 -0
  217. package/dist/plugin-special-folders/public-private-files.d.ts +15 -0
  218. package/dist/plugin-special-folders/resolve-public-folder.d.ts +3 -1
  219. package/dist/plugin-special-folders/walked-scripts.d.ts +6 -0
  220. package/dist/plugin-special-folders/warn-upon-folder-changes.d.ts +14 -0
  221. package/dist/plugin-static-assets/index.d.ts +0 -5
  222. package/dist/plugin-web-extension/feature-chunk-loading/background-entry-name.d.ts +8 -0
  223. package/dist/plugin-web-extension/feature-chunk-loading/chunk-loading-target.d.ts +7 -0
  224. package/dist/plugin-web-extension/feature-chunk-loading/content-scripts-meta.d.ts +3 -0
  225. package/dist/plugin-web-extension/feature-chunk-loading/options.d.ts +22 -0
  226. package/dist/plugin-web-extension/feature-chunk-loading/runtime-modules/browser-runtime.d.ts +4 -0
  227. package/dist/plugin-web-extension/feature-chunk-loading/runtime-modules/chunk-loader-fallback.d.ts +2 -0
  228. package/dist/plugin-web-extension/feature-chunk-loading/runtime-modules/load-script.d.ts +3 -0
  229. package/dist/plugin-web-extension/feature-chunk-loading/runtime-modules/public-path.d.ts +2 -0
  230. package/dist/plugin-web-extension/feature-chunk-loading/runtime-modules/template-fn.d.ts +4 -0
  231. package/dist/plugin-web-extension/feature-chunk-loading/steps/chunk-loader.d.ts +12 -0
  232. package/dist/plugin-web-extension/feature-chunk-loading/steps/no-danger-name.d.ts +4 -0
  233. package/dist/plugin-web-extension/feature-html/html-lib/assets.d.ts +2 -1
  234. package/dist/plugin-web-extension/feature-html/html-lib/messages.d.ts +4 -3
  235. package/dist/plugin-web-extension/feature-html/html-lib/options-dialog-floor.d.ts +1 -0
  236. package/dist/plugin-web-extension/feature-html/html-lib/patch-html.d.ts +1 -1
  237. package/dist/plugin-web-extension/feature-html/html-lib/source-may-ship.d.ts +6 -0
  238. package/dist/plugin-web-extension/feature-html/html-lib/utils.d.ts +6 -2
  239. package/dist/plugin-web-extension/feature-html/index.d.ts +2 -0
  240. package/dist/plugin-web-extension/feature-html/steps/add-assets-to-compilation.d.ts +1 -0
  241. package/dist/plugin-web-extension/feature-html/steps/add-scripts-and-styles-to-compilation.d.ts +2 -0
  242. package/dist/plugin-web-extension/feature-html/steps/emit-html-file.d.ts +1 -1
  243. package/dist/plugin-web-extension/feature-html/steps/throw-if-recompile-is-needed.d.ts +1 -0
  244. package/dist/plugin-web-extension/feature-json/index.d.ts +9 -3
  245. package/dist/plugin-web-extension/feature-json/messages.d.ts +1 -0
  246. package/dist/plugin-web-extension/feature-json/process-assets.d.ts +1 -1
  247. package/dist/plugin-web-extension/feature-json/resolve-json-resource.d.ts +2 -0
  248. package/dist/plugin-web-extension/feature-json/track-dependencies.d.ts +1 -1
  249. package/dist/plugin-web-extension/feature-locales/get-locales.d.ts +1 -0
  250. package/dist/plugin-web-extension/feature-locales/index.d.ts +1 -2
  251. package/dist/plugin-web-extension/feature-manifest/index.d.ts +2 -2
  252. package/dist/plugin-web-extension/feature-manifest/manifest-lib/filter-keys-safari.d.ts +1 -2
  253. package/dist/plugin-web-extension/feature-manifest/manifest-lib/manifest.d.ts +3 -0
  254. package/dist/plugin-web-extension/feature-manifest/manifest-lib/shadowed-declaration.d.ts +9 -0
  255. package/dist/plugin-web-extension/feature-manifest/manifest-lib/theme-values.d.ts +5 -5
  256. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/content_scripts.d.ts +1 -1
  257. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/index.d.ts +1 -1
  258. package/dist/plugin-web-extension/feature-manifest/messages.d.ts +38 -2
  259. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-additions.d.ts +3 -0
  260. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-injected-hosts.d.ts +1 -1
  261. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-injected-permissions.d.ts +4 -1
  262. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/emitted-evidence.d.ts +1 -1
  263. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-csp.d.ts +3 -2
  264. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults.d.ts +1 -0
  265. package/dist/plugin-web-extension/feature-manifest/steps/emit-manifest.d.ts +5 -1
  266. package/dist/plugin-web-extension/feature-manifest/steps/patch-chromium-theme-colors.d.ts +5 -0
  267. package/dist/plugin-web-extension/feature-manifest/steps/patch-gecko-background.d.ts +1 -0
  268. package/dist/plugin-web-extension/feature-manifest/steps/update-manifest.d.ts +4 -0
  269. package/dist/plugin-web-extension/feature-manifest/steps/validate-theme-values.d.ts +1 -1
  270. package/dist/plugin-web-extension/feature-manifest/steps/warn-gecko-unsupported-apis.d.ts +1 -0
  271. package/dist/plugin-web-extension/feature-manifest/steps/warn-ignored-host-permissions.d.ts +10 -0
  272. package/dist/plugin-web-extension/feature-manifest/steps/warn-webassembly.d.ts +27 -0
  273. package/dist/plugin-web-extension/feature-scripts/contracts.d.ts +6 -0
  274. package/dist/plugin-web-extension/feature-scripts/messages.d.ts +12 -1
  275. package/dist/plugin-web-extension/feature-scripts/scripts-lib/default-export.d.ts +28 -0
  276. package/dist/plugin-web-extension/feature-scripts/scripts-lib/front-rules.d.ts +4 -0
  277. package/dist/plugin-web-extension/feature-scripts/scripts-lib/injected-sheet-urls.d.ts +35 -0
  278. package/dist/plugin-web-extension/feature-scripts/scripts-lib/top-level-await.d.ts +6 -0
  279. package/dist/plugin-web-extension/feature-scripts/scripts-lib/utils.d.ts +6 -1
  280. package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/classic-concat-loader.d.ts +1 -0
  281. package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/content-script-wrapper.d.ts +6 -1
  282. package/dist/plugin-web-extension/feature-scripts/steps/add-scripts.d.ts +4 -1
  283. package/dist/plugin-web-extension/feature-scripts/steps/source-literals.d.ts +1 -0
  284. package/dist/plugin-web-extension/feature-scripts/steps/trace-runtime-loaded-files.d.ts +22 -1
  285. package/dist/plugin-web-extension/feature-scripts/steps/warn-main-world-registration-changed.d.ts +0 -2
  286. package/dist/plugin-web-extension/feature-scripts/steps/warn-split-initial-chunks.d.ts +0 -3
  287. package/dist/plugin-web-extension/feature-web-resources/index.d.ts +0 -1
  288. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/messages.d.ts +0 -1
  289. package/dist/plugin-web-extension/index.d.ts +2 -0
  290. package/dist/plugin-web-extension/shared/chunk-loading-target-extensions.d.ts +10 -0
  291. package/dist/plugin-web-extension/shared/classic-concat.d.ts +9 -0
  292. package/dist/plugin-web-extension/shared/content-script-wrapper-extensions.d.ts +29 -0
  293. package/dist/plugin-web-extension/shared/kept-page-paths.d.ts +16 -0
  294. package/dist/plugin-web-extension/shared/reported-missing-pages.d.ts +2 -0
  295. package/dist/preprocessor-passthrough-loader.mjs +4 -3
  296. package/dist/preview-entry.d.ts +2 -2
  297. package/dist/preview.mjs +6 -2
  298. package/dist/producer-runtime~0.mjs +3448 -0
  299. package/dist/public-css-url-loader.mjs +2 -2
  300. package/dist/q~0.mjs +1 -3
  301. package/dist/rename-with-retry~0.mjs +33 -0
  302. package/dist/rj~0.mjs +1 -1
  303. package/dist/rl~0.mjs +92 -9
  304. package/dist/rspack-config~0.mjs +16139 -8719
  305. package/dist/rz~0.mjs +137 -0
  306. package/dist/r~0.mjs +533 -90
  307. package/dist/session-end~0.mjs +28 -0
  308. package/dist/sfc-style-block-loader.mjs +2 -2
  309. package/dist/solid-jsx-gate-loader.mjs +1 -1
  310. package/dist/stats-handler~0.mjs +7 -4
  311. package/dist/sy~0.mjs +3905 -0
  312. package/dist/s~0.mjs +948 -0
  313. package/dist/types.d.ts +238 -78
  314. package/dist/unplaced-style-import-loader.mjs +2 -2
  315. package/dist/u~0.mjs +312 -0
  316. package/dist/w~0.mjs +1 -1
  317. package/dist/xk~0.mjs +778 -0
  318. package/dist/x~0.mjs +687 -3
  319. package/dist/y~0.mjs +29 -12
  320. package/dist/zip~0.mjs +6 -6
  321. package/dist/z~0.mjs +59 -2208
  322. package/package.json +5 -17
  323. package/dist/6l~0.mjs +0 -55
  324. package/dist/cp~0.mjs +0 -1363
  325. package/dist/dev-server/frameworks.d.ts +0 -2
  326. package/dist/df~0.mjs +0 -197
  327. package/dist/ensure-hmr-for-scripts.js +0 -104
  328. package/dist/feature-scripts-classic-concat-loader.js +0 -365
  329. package/dist/feature-scripts-content-script-wrapper.js +0 -310
  330. package/dist/lib/stable-loader-paths.d.ts +0 -14
  331. package/dist/main-world-bridge.js +0 -178
  332. package/dist/minimum-chromium-file.js +0 -5
  333. package/dist/minimum-firefox-file.js +0 -5
  334. package/dist/minimum-script-file.js +0 -54
  335. package/dist/package.json +0 -3
  336. package/dist/plugin-compilation/clean-dist.d.ts +0 -8
  337. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/index.d.ts +0 -2
  338. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/ChunkLoader.d.ts +0 -12
  339. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/HMRDevServer.d.ts +0 -3
  340. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/InitialChunkFile.d.ts +0 -5
  341. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/NoDangerNamePlugin.d.ts +0 -3
  342. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/AutoPublicPath.d.ts +0 -2
  343. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/BaseUri.d.ts +0 -2
  344. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/BrowserRuntime.d.ts +0 -8
  345. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/ChunkLoaderFallback.d.ts +0 -1
  346. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/EagerlyLoadChunks.d.ts +0 -1
  347. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/LoadScript.d.ts +0 -4
  348. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/PublicPath.d.ts +0 -2
  349. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/ServiceWorkerPlugin.d.ts +0 -6
  350. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/helper.d.ts +0 -12
  351. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/index.d.ts +0 -5
  352. package/dist/plugin-wasm/index.d.ts +0 -16
  353. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/commands.d.ts +0 -16
  354. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/permissions.d.ts +0 -4
  355. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/host_permissions.d.ts +0 -4
  356. package/dist/rslib.config.d.ts +0 -3
  357. package/dist/tm~0.mjs +0 -71
  358. package/dist/t~0.mjs +0 -102
  359. package/runtime/process-shim.cjs +0 -53
  360. /package/dist/{plugin-reload/steps/setup-chunk-loading-target.d.ts → plugin-web-extension/feature-chunk-loading/index.d.ts} +0 -0
  361. /package/dist/plugin-web-extension/{feature-scripts → feature-chunk-loading}/steps/add-public-path-runtime-module.d.ts +0 -0
package/README.md CHANGED
@@ -25,42 +25,40 @@ pnpm add extension-develop
25
25
 
26
26
  ```ts
27
27
  import {
28
- extensionDev,
29
28
  extensionBuild,
30
- extensionStart,
31
- extensionPreview,
32
- type DevOptions,
33
29
  type BuildOptions,
34
- type StartOptions,
35
- type PreviewOptions
30
+ type BuildSummary
36
31
  } from 'extension-develop'
32
+ import {
33
+ extensionPreview,
34
+ type PreviewLauncherFn,
35
+ type PreviewOptions
36
+ } from 'extension-develop/preview'
37
+
38
+ // Production build of the project in the current folder, with a zip
39
+ const summary: BuildSummary = await extensionBuild(undefined, {
40
+ browser: 'chrome',
41
+ zip: true
42
+ } satisfies BuildOptions)
37
43
 
38
- async function run() {
39
- // Development server
40
- await extensionDev(undefined, {
41
- browser: 'chrome',
42
- open: true
43
- } satisfies DevOptions)
44
-
45
- // Production build + zip
46
- await extensionBuild(undefined, {
47
- browser: 'firefox',
48
- zip: true
49
- } satisfies BuildOptions)
50
-
51
- // Build then preview from dist/<browser>
52
- await extensionStart(undefined, {browser: 'edge'} satisfies StartOptions)
53
-
54
- // Preview using an existing output folder or project path
55
- await extensionPreview(undefined, {
56
- browser: 'chrome',
57
- mode: 'production'
58
- } satisfies PreviewOptions)
44
+ console.log(summary.errors_count)
45
+
46
+ // This package starts no browser. The caller passes the launcher, which
47
+ // receives the built folder and every unpacked extension to load.
48
+ const launcher: PreviewLauncherFn = async ({browser, extensionsToLoad}) => {
49
+ console.log(`Start ${browser} with`, extensionsToLoad)
59
50
  }
60
51
 
61
- run()
52
+ // Runs the build in dist/chrome with no dev server
53
+ await extensionPreview(
54
+ undefined,
55
+ {browser: 'chrome', mode: 'production'} satisfies PreviewOptions,
56
+ launcher
57
+ )
62
58
  ```
63
59
 
60
+ The `extension-develop/manifest` entry is deprecated and is removed in the next minor.
61
+
64
62
  ## Features
65
63
 
66
64
  - Live reload/HMR development server with per-instance browser runners
@@ -70,7 +68,7 @@ run()
70
68
  - Zipping: distribution and/or source packages (respects `.gitignore`)
71
69
  - Auto-install of missing build + optional dependencies on first run
72
70
  - Type generation for TS projects via `extension-env.d.ts`
73
- - User config via `extension.config.(js|mjs)` for commands, browser start, unified logger defaults, and webpack config hooks
71
+ - User config via `extension.config.(js|mjs)` for commands, browser start, unified logger defaults, and the bundler config hooks (`config`, `configResolved`)
74
72
  - Managed dependency guard to avoid conflicts
75
73
 
76
74
  ## Commands
@@ -85,73 +83,102 @@ run()
85
83
 
86
84
  ## Command options
87
85
 
88
- Options accepted by each command. Values shown are typical types or enumerations; see the tables for specifics.
89
-
90
- ### Common (browser/runtime)
91
-
92
- | Option | Type / Values | Description |
93
- | -------------- | -------------------------------------------------- | --------------------------------------------------------------- |
94
- | browser | chrome, edge, firefox, safari, chromium-based, gecko-based | Target browser/runtime |
95
- | profile | string or false | Profile path or disable profile persistence |
96
- | startingUrl | string | Initial URL to open |
97
- | open | boolean | Focus/open the browser window (CLI: use `--no-open` to disable) |
98
- | --no-browser | boolean | Skip launching the browser |
99
- | chromiumBinary | string | Custom Chromium-based executable path |
100
- | geckoBinary | string | Custom Gecko-based executable path |
86
+ Each table lists fields of the exported option types `DevOptions`, `BuildOptions`, `StartOptions` and `PreviewOptions`, under the commands whose type has them. Every field is optional except `browser` and, for `start`, `mode`.
87
+
88
+ `extensionDev` and `extensionPreview` start a browser only through a launcher the caller passes. This package exports no `extensionStart`. `StartOptions` types the `start` command the CLI runs as `extensionBuild` followed by `extensionPreview`.
89
+
90
+ ### dev, build, start and preview
91
+
92
+ | Option | Type / Values | Description |
93
+ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
94
+ | `browser` | chrome, edge, firefox, safari, chromium, brave, opera, vivaldi, yandex, waterfox, librewolf, zen, floorp, chromium-based, gecko-based, firefox-based, webkit-based, chromium-emulator | Target browser |
95
+ | `mode` | development, production, none | Bundler mode. `dev` always runs `development`, `start` and `preview` take `production` only, `build` defaults to `production` |
96
+ | `chromiumBinary` | string | Path of a Chromium-based executable to run |
97
+ | `geckoBinary` | string | Path of a Gecko-based executable to run |
98
+ | `firefoxBinary` | string | Same as `geckoBinary`, which wins when both are set |
99
+ | `extensions` | string[] or `{dir, paths}` | Companion extensions for this command, see "Companion extensions" below |
100
+
101
+ ### dev, start and preview
102
+
103
+ | Option | Type / Values | Description |
104
+ | -------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
105
+ | `noOpen` | boolean | Start the browser without opening a tab for the extension |
106
+ | `noBrowser` | boolean | Start no browser at all |
107
+ | `profile` | string or false | Profile folder to use. `false` asks for the browser's own default profile. Defaults to a fresh managed profile |
108
+ | `persistProfile` | boolean | Reuse one managed profile across runs, off by default |
109
+ | `keepProfileChanges` | boolean | Keep the managed profile and what the run changed in it |
110
+ | `copyFromProfile` | string | Seed the managed profile from a copy of this profile folder, on first creation |
111
+ | `startingUrl` | string | Page to open when the browser starts |
112
+ | `port` | number or string | `dev`: the dev server port, 8080 by default. `start` and `preview`: handed to the launcher, which seeds the browser debug port from it |
113
+ | `host` | string | Address to bind, 127.0.0.1 by default. `dev` binds the dev server, `start` and `preview` bind the control channel |
114
+ | `publicHost` | string | `dev`: the address the browser dials when it differs from `host`. Accepted and unused by `start` and `preview` |
115
+ | `logLevel` | off, error, warn, info, debug, trace, all | Lowest level of browser log printed in the terminal, `off` by default |
116
+ | `logContexts` | array of: background, content, page, popup, options, sidebar, devtools, newtab, history, bookmarks | Contexts whose logs print. Leave unset for all of them |
117
+ | `logFormat` | pretty, json, ndjson | Output format of the printed logs, `pretty` by default |
118
+ | `logTimestamps` | boolean | Timestamps in `pretty` output, on by default |
119
+ | `logColor` | boolean | Colors in `pretty` output, on by default |
120
+ | `logUrl` | string | Print only logs whose URL holds this text or matches this `/regex/flags` literal |
121
+ | `logTab` | number or string | Print only logs from this tab id |
122
+ | `preferences` | object | Browser preferences to set in the profile |
123
+ | `browserFlags` | string[] | Extra flags for the browser command line |
124
+ | `excludeBrowserFlags` | string[] | Default flags to leave off the browser command line |
125
+
126
+ ### dev and build
127
+
128
+ | Option | Type / Values | Description |
129
+ | ----------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
130
+ | `polyfill` | boolean | Bundle `webextension-polyfill` on a Chromium target, off by default |
131
+ | `safariBinary` | string | Path of a Safari or WebKit-based app to run |
132
+ | `appName` | string | Safari app name, the manifest name by default |
133
+ | `bundleId` | string | Safari bundle identifier |
134
+ | `developmentTeam` | string | Apple development team that signs the Safari app |
135
+ | `macOsOnly` | boolean | Generate the macOS-only Xcode project, on by default |
136
+ | `appIcon` | string | Square 1024 px PNG the Safari app icon set is made from, relative to the project |
137
+ | `forceRegenerate` | boolean | Regenerate the Xcode project even when it is current |
138
+ | `safariPackager` | function | The callback that packages the Safari app. Without it no Safari app is produced |
139
+ | `zip` | boolean | `build`: package `dist/<browser>` as an archive. Accepted and unused by `dev`, which writes no archive |
140
+ | `zipSource` | boolean | `build`: package the source files, respecting `.gitignore`. Unused by `dev` |
141
+ | `zipFilename` | string | `build`: base name of the archives. Unused by `dev` |
142
+ | `zipDir` | string | `build`: folder for the archives, relative to the project or absolute. Unused by `dev` |
143
+ | `sourceMaps` | boolean | `build`: write a `.map` file beside each script and stylesheet of a production build, never zipped. Unused by `dev`, which always writes maps |
144
+ | `exitOnError` | boolean | `dev`: exit the process with code 1 on a failed session, off by default for a library. Deprecated and ignored by `build`: a failed build rejects and the caller owns the exit |
101
145
 
102
146
  ### dev
103
147
 
104
- | Option | Type / Values | Description |
105
- | ------------------- | ----------------------------------- | --------------------------------------------------------------------------------- |
106
- | mode | development, production, none | Build mode |
107
- | polyfill | boolean | Bundle `webextension-polyfill` on a Chromium target, off by default |
108
- | port | number or string | Dev server port |
109
- | source | string | Inspect a source directory |
110
- | watchSource | boolean | Watch the source directory |
111
- | sourceFormat | pretty,json,ndjson | Output format for source HTML |
112
- | sourceSummary | boolean | Output a compact summary instead of full HTML |
113
- | sourceMeta | boolean | Output page metadata (readyState, viewport, frames) |
114
- | sourceProbe | string[] | CSS selectors to probe for quick validation |
115
- | sourceTree | off,root-only | Output a compact extension root tree |
116
- | sourceConsole | boolean | Output console summary (best-effort) |
117
- | sourceDom | boolean | Output DOM snapshots and diffs |
118
- | sourceMaxBytes | number | Limit HTML output size in bytes (0 disables truncation) |
119
- | sourceRedact | off,safe,strict | Redact sensitive content in HTML output |
120
- | sourceIncludeShadow | off,open-only,all | Control Shadow DOM inclusion |
121
- | sourceDiff | boolean | Include diff metadata on watch updates |
122
- | logs | off,error,warn,info,debug,trace,all | Unified logger verbosity (all shows everything) |
123
- | logContext | list or `all` | Comma-separated contexts (background,content,page,sidebar,popup,options,devtools) |
124
- | logFormat | pretty,json,ndjson | Pretty text or JSON/NDJSON output |
125
- | logTimestamps | boolean | Include timestamps in pretty output |
126
- | logColor | boolean | Colorize pretty output |
127
- | logUrl | string or /regex/flags | Filter by URL substring or JS-style regex literal |
128
- | logTab | number | Filter by tabId |
148
+ | Option | Type / Values | Description |
149
+ | --------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------ |
150
+ | `allowedHosts` | string or string[] | Extra host names the dev server answers. A leading dot allows every subdomain |
151
+ | `hashContentScripts` | boolean | Put a content hash in each content script file name, on by default |
152
+ | `allowControl` | boolean | Open the control channel for the act verbs |
153
+ | `allowEval` | boolean | Also allow the `eval` verb. Implies `allowControl` |
154
+ | `hintFor` | function | The hint for a terminal `failed` or `usage` frame that carries none. Called with the code, returns a string or undefined |
155
+
156
+ A host that learns a session cannot go on calls `endSessionAsFailed(code, message, instanceId?)`, exported beside `extensionDev`. It ends the named session, or the newest one, with one `failed` frame and answers `false` when that session is not live or is already stopping. A host that did not pass `exitOnError` keeps running.
129
157
 
130
158
  ### build
131
159
 
132
- | Option | Type / Values | Description |
133
- | ----------- | ------------- | -------------------------------------------------------------- |
134
- | zip | boolean | Package `dist/<browser>` as an artifact (e.g., `.zip`, `.xpi`) |
135
- | zipSource | boolean | Package source files (respects `.gitignore`) |
136
- | zipFilename | string | Custom base name for artifacts |
137
- | zipDir | string | Folder for the artifacts, relative to the project or absolute |
138
- | sourceMaps | boolean | Write source maps beside a production build, never zipped |
139
- | polyfill | boolean | Bundle `webextension-polyfill` on Chromium, off by default |
140
- | silent | boolean | Suppress non-error logs |
160
+ | Option | Type / Values | Description |
161
+ | --------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------- |
162
+ | `outDir` | string | Base folder of the output, relative to the project. The build writes `<outDir>/<browser>`, `dist/<browser>` by default |
163
+ | `silent` | boolean | Print nothing on stdout. A failure still prints |
164
+ | `addonLint` | boolean | Run `addons-linter` over a production build for a Gecko target, on by default when it is installed |
165
+ | `minify` | boolean | Minify first-party code in a production build. On by default, off for `opera` |
166
+ | `failOnWarning` | boolean | Deprecated. Nothing reads it, a build never fails on a warning |
141
167
 
142
168
  ### start
143
169
 
144
- | Option | Type / Values | Description |
145
- | -------- | ------------- | --------------------------------------------- |
146
- | mode | `production` | Build mode |
147
- | polyfill | boolean | Bundle `webextension-polyfill`, default off |
170
+ | Option | Type / Values | Description |
171
+ | ---------- | ------------- | ------------------------------------------------------------------- |
172
+ | `polyfill` | boolean | Bundle `webextension-polyfill` on a Chromium target, off by default |
148
173
 
149
174
  ### preview
150
175
 
151
- | Option | Type / Values | Description |
152
- | ---------- | ------------- | ------------------------------------------------------------------- |
153
- | mode | `production` | Build mode |
154
- | outputPath | string | Directory to run from (defaults to `dist/<browser>` when available) |
176
+ | Option | Type / Values | Description |
177
+ | -------------- | ------------- | ---------------------------------------------------------------- |
178
+ | `outputPath` | string | Folder to run from, `dist/<browser>` by default |
179
+ | `allowControl` | boolean | Open the control channel for the act verbs on the production run |
180
+ | `allowEval` | boolean | Also allow the `eval` verb. Implies `allowControl` |
181
+ | `dryRun` | boolean | Handed to the launcher, which then starts no browser |
155
182
 
156
183
  ## Project detection and inputs
157
184
 
@@ -229,12 +256,14 @@ export default {
229
256
  - `extension.config.*` runs in a Node context during command startup.
230
257
  - Use `process.env.*` to read environment variables inside the config file.
231
258
  - `import.meta.env.*` is available in your extension code at bundle time (via the Env plugin), not in the Node config.
232
- - During config loading, develop preloads environment files from the project directory into `process.env` using the following order (first match wins):
233
- 1. `.env.defaults` (always merged first when present)
234
- 2. `.env.development`
235
- 3. `.env.local`
236
- 4. `.env`
237
- - In monorepos, if none of the files above exist in the project directory, develop falls back to the nearest workspace root (directory containing `pnpm-workspace.yaml`) and applies the same loading order there.
259
+ - Before the config runs, develop loads the env files that match the running mode and browser into `process.env`. Values layer key by key: every matching file is read, and for each key the strongest file that sets it wins. A value already set in the shell or CI wins over every file. Strongest first:
260
+ 1. `.env.<browser>.<mode>`, then `.env.<browser>`, for the browser and then for each name of its family (for example `.env.chrome.production`, `.env.chrome`, `.env.chromium`). These apply once the browser is known.
261
+ 2. `.env.<mode>.local`
262
+ 3. `.env.<mode>` (`development` for `dev`, `production` otherwise)
263
+ 4. `.env.local`
264
+ 5. `.env`
265
+ 6. `.env.defaults` (weakest, it only fills keys no other file sets)
266
+ - In a monorepo, a package with none of the files 1 to 5 reads them from the nearest workspace root instead (the directory containing `pnpm-workspace.yaml`), even when the package has its own `.env.defaults`. The root's `.env.defaults` is then the weakest layer, the package's `.env.defaults` comes above it, and the root's other env files come above both. A package with any of the files 1 to 5 reads only its own folder.
238
267
  - Only variables you read explicitly in the config are used there; client-side injection still requires the `EXTENSION_PUBLIC_*` prefix.
239
268
  - Example:
240
269
 
@@ -302,11 +331,17 @@ dist/
302
331
  | Name | Group | Summary |
303
332
  | -------------------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
304
333
  | plugin-web-extension | core | - Core builder: emits pages and scripts<br/>- Validates and rewrites `manifest.json`<br/>- Ships icons, JSON, locales, and web resources<br/>- Ensures dev parity between local and shipped output |
305
- | plugin-css | core | - Auto‑wires CSS for HTML and content scripts<br/>- Optional SASS/LESS/PostCSS when configs exist<br/>- Integrates Stylelint when configured |
334
+ | plugin-css | core | - Auto‑wires CSS for HTML and content scripts<br/>- Optional SASS/LESS/PostCSS when configs exist |
306
335
  | plugin-js-frameworks | core | - Detects React/Preact/Vue/Svelte and TypeScript<br/>- Configures SWC parsing, loaders/plugins, and safe aliases<br/>- Sets `tsconfig` resolution<br/>- Defers heavy work to `beforeRun` in production |
307
- | plugin-static-assets | core | - Emits images, fonts, and misc files to `assets/`<br/>- Inlines small SVGs (≤2KB), emits larger ones<br/>- Content hashing in production; stable names in development<br/>- Respects existing custom SVG rules |
336
+ | plugin-static-assets | core | - Emits images, fonts, and misc files to `assets/`<br/>- Inlines files up to 2 KB, emits larger ones<br/>- Content-hashed names in development and production<br/>- Steps aside for user asset rules<br/>- Appends `.wasm` to the resolve extensions |
308
337
  | plugin-compatibility | core | - Cross‑browser helpers<br/>- Normalizes browser‑specific manifest fields<br/>- Optional `webextension-polyfill` for Chromium (skipped for Firefox/Safari) |
309
338
  | plugin-compilation | core | - Loads env and templating (`EXTENSION_PUBLIC_*`)<br/>- Optional `dist/<browser>` cleaning<br/>- Compact, de‑duplicated compilation summary |
339
+ | plugin-special-folders | core | - Copies `public/` to the output root<br/>- Builds the pages in `pages/` and the scripts in `scripts/`<br/>- Resolves companion extensions from `extensions/`<br/>- Applies the `include` and `exclude` lists |
340
+ | plugin-wasm | core | - Enables async WebAssembly<br/>- Resolves `.wasm` imports<br/>- Aliases runtime wasm assets |
341
+ | plugin-perf-budgets | core | - Size budgets per extension surface<br/>- Replaces the bundler's single size threshold |
342
+ | plugin-reload | dev | - Reload and HMR strategy of `extension dev`<br/>- Injects the dev reload runtime<br/>- Classifies each change and dispatches the reload<br/>- Does nothing outside a dev session |
343
+ | plugin-playwright | dev | - Writes the session contract (`ready.json`, `events.ndjson`) under `dist/extension-js/<browser>`<br/>- Read by `--wait`, `logs` and automation |
344
+ | plugin-browsers | dev | - Launches the target browser with the built extension loaded<br/>- Passed in by the CLI, absent under `--no-browser` |
310
345
 
311
346
  ## Notes and compatibility
312
347
 
package/dist/3~0.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
1
+ import "node:module";
2
2
  function identityLineMap(resourcePath, source) {
3
3
  const lineCount = source.split('\n').length;
4
4
  const groups = [];
package/dist/5h~0.mjs CHANGED
@@ -1,7 +1,8 @@
1
- import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
1
+ import "node:module";
2
2
  import { spawnSync } from "node:child_process";
3
- import { humanLine } from "./k~0.mjs";
4
- import { sessionStateIgnoreAdded } from "./cp~0.mjs";
3
+ import { sessionArtifactsRootDir, browserArtifactsDir } from "./7~0.mjs";
4
+ import { humanLine } from "./ke~0.mjs";
5
+ import { sessionStateIgnoreAdded } from "./k~0.mjs";
5
6
  import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
6
7
  import * as __rspack_external_node_path_806ed179 from "node:path";
7
8
  function sessionStateDir(projectPath) {
@@ -30,9 +31,6 @@ function ensureSessionStateIgnoreFile(projectPath) {
30
31
  if (!__rspack_external_node_fs_1b05aee1.existsSync(ignoreFile)) __rspack_external_node_fs_1b05aee1.writeFileSync(ignoreFile, SESSION_STATE_IGNORE_CONTENT);
31
32
  } catch {}
32
33
  }
33
- function sessionArtifactsRootDir(projectPath) {
34
- return __rspack_external_node_path_806ed179.resolve(projectPath, 'dist', 'extension-js');
35
- }
36
34
  const SESSION_ARTIFACTS_IGNORE_CONTENT = "# Extension.js session state: managed browser profiles (cookies, history,\n# logins), session logs and machine contracts. Personal data lives here:\n# this directory must never be committed or shipped.\n*\n";
37
35
  function sessionArtifactsIgnoreFilePath(projectPath) {
38
36
  return __rspack_external_node_path_806ed179.join(sessionArtifactsRootDir(projectPath), '.gitignore');
@@ -132,18 +130,12 @@ function ensureSessionStateInProjectGitignore(projectPath) {
132
130
  humanLine(sessionStateIgnoreAdded(gitignorePath));
133
131
  } catch {}
134
132
  }
135
- function browserArtifactsDir(projectPath, browser) {
136
- return __rspack_external_node_path_806ed179.join(sessionArtifactsRootDir(projectPath), browser);
137
- }
138
133
  function browserProfileRootDir(projectPath, browser) {
139
134
  return __rspack_external_node_path_806ed179.join(sessionArtifactsRootDir(projectPath), 'profiles', `${browser}-profile`);
140
135
  }
141
136
  function browserDistDir(projectPath, browser) {
142
137
  return __rspack_external_node_path_806ed179.resolve(projectPath, 'dist', browser);
143
138
  }
144
- function readyContractPath(projectPath, browser) {
145
- return __rspack_external_node_path_806ed179.join(browserArtifactsDir(projectPath, browser), 'ready.json');
146
- }
147
139
  function eventsPath(projectPath, browser) {
148
140
  return __rspack_external_node_path_806ed179.join(browserArtifactsDir(projectPath, browser), 'events.ndjson');
149
141
  }
@@ -156,4 +148,4 @@ function actionsPath(projectPath, browser) {
156
148
  function buildSummaryPath(projectPath, browser) {
157
149
  return __rspack_external_node_path_806ed179.join(browserArtifactsDir(projectPath, browser), 'build-summary.json');
158
150
  }
159
- export { CONTROL_TOKEN_FILE_PREFIX, actionsPath, browserArtifactsDir, browserDistDir, browserProfileRootDir, buildSummaryPath, controlPortFilePath, controlTokenPath, ensureSessionArtifactsIgnoreFile, ensureSessionStateIgnoreFile, ensureSessionStateInProjectGitignore, eventsPath, legacyControlPortFilePath, legacyControlTokenPath, logsPath, readyContractPath, sessionArtifactsRootDir, sessionStateDir };
151
+ export { CONTROL_TOKEN_FILE_PREFIX, actionsPath, browserDistDir, browserProfileRootDir, buildSummaryPath, controlPortFilePath, controlTokenPath, ensureSessionArtifactsIgnoreFile, ensureSessionStateIgnoreFile, ensureSessionStateInProjectGitignore, eventsPath, legacyControlPortFilePath, legacyControlTokenPath, logsPath, sessionStateDir };
package/dist/5~0.mjs CHANGED
@@ -1,10 +1,66 @@
1
- import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
1
+ import "node:module";
2
+ import { isGeckoBasedBrowser } from "./q~0.mjs";
2
3
  function stripBom(text) {
3
4
  const raw = 'string' == typeof text ? text : String(text || '');
4
5
  return raw && 0xfeff === raw.charCodeAt(0) ? raw.slice(1) : raw;
5
6
  }
7
+ function blankJsonComments(source) {
8
+ const raw = stripBom(source);
9
+ let out = '';
10
+ let hasComments = false;
11
+ let firstBlockComment = -1;
12
+ let i = 0;
13
+ while(i < raw.length){
14
+ const char = raw[i];
15
+ if ('"' === char) {
16
+ let j = i + 1;
17
+ while(j < raw.length && '"' !== raw[j] && '\n' !== raw[j])j += '\\' === raw[j] ? 2 : 1;
18
+ out += raw.slice(i, j + 1);
19
+ i = j + 1;
20
+ continue;
21
+ }
22
+ if ('/' === char && '/' === raw[i + 1]) {
23
+ let j = i;
24
+ while(j < raw.length && '\n' !== raw[j] && '\r' !== raw[j])j++;
25
+ out += ' '.repeat(j - i);
26
+ hasComments = true;
27
+ i = j;
28
+ continue;
29
+ }
30
+ if ('/' === char && '*' === raw[i + 1]) {
31
+ const end = raw.indexOf('*/', i + 2);
32
+ if (-1 !== end) {
33
+ out += raw.slice(i, end + 2).replace(/[^\r\n]/g, ' ');
34
+ hasComments = true;
35
+ if (-1 === firstBlockComment) firstBlockComment = i;
36
+ i = end + 2;
37
+ continue;
38
+ }
39
+ }
40
+ out += char;
41
+ i++;
42
+ }
43
+ return {
44
+ text: out,
45
+ hasComments,
46
+ firstBlockComment
47
+ };
48
+ }
49
+ function hasJsonComments(source) {
50
+ return blankJsonComments(source).hasComments;
51
+ }
52
+ function lineAndColumn(text, offset) {
53
+ const before = text.slice(0, offset).split('\n');
54
+ return `line ${before.length} column ${before[before.length - 1].length + 1}`;
55
+ }
56
+ function parseAuthoredJson(source, options = {}) {
57
+ const scan = blankJsonComments(source);
58
+ if (-1 !== scan.firstBlockComment && options.browser && isGeckoBasedBrowser(String(options.browser))) throw new SyntaxError(`Firefox does not read a /* */ block comment, found at ${lineAndColumn(scan.text, scan.firstBlockComment)}. Write it as // line comments, which Chromium and Firefox both read`);
59
+ return JSON.parse(options.emptyAsObject && !scan.text ? '{}' : scan.text);
60
+ }
6
61
  function parseJsonSafe(text) {
7
- const s = stripBom(text);
8
- return JSON.parse(s || '{}');
62
+ return parseAuthoredJson(text, {
63
+ emptyAsObject: true
64
+ });
9
65
  }
10
- export { parseJsonSafe, stripBom };
66
+ export { hasJsonComments, parseAuthoredJson, parseJsonSafe, stripBom };