extension-develop 4.1.39 → 4.1.40-canary.459.2c1ba7b

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 (210) hide show
  1. package/README.md +13 -10
  2. package/dist/{771~0.mjs → 5h~0.mjs} +13 -3
  3. package/dist/{273~0.mjs → 6l~0.mjs} +1 -1
  4. package/dist/{524~0.mjs → 9~0.mjs} +18 -2
  5. package/dist/{640~0.mjs → bh~0.mjs} +6 -1
  6. package/dist/bridge.mjs +14 -8
  7. package/dist/b~0.mjs +8644 -0
  8. package/dist/command-dev.d.ts +2 -0
  9. package/dist/command-preview.d.ts +2 -0
  10. package/dist/contracts.mjs +2 -1
  11. package/dist/{469~0.mjs → cp~0.mjs} +66 -17
  12. package/dist/css-parse-guard-loader.mjs +2 -2
  13. package/dist/c~0.mjs +56 -0
  14. package/dist/dead-css-url-loader.mjs +20 -119
  15. package/dist/dev-server/control-bridge/actions-file.d.ts +7 -0
  16. package/dist/dev-server/control-bridge/broker.d.ts +42 -2
  17. package/dist/dev-server/control-bridge/consumer-client.d.ts +7 -0
  18. package/dist/dev-server/control-bridge/contracts.d.ts +29 -1
  19. package/dist/dev-server/control-bridge/logs-file.d.ts +6 -0
  20. package/dist/dev-server/control-bridge/loopback.d.ts +1 -0
  21. package/dist/dev-server/control-bridge/producer-runtime.d.ts +5 -2
  22. package/dist/dev-server/control-bridge/production-control.d.ts +1 -0
  23. package/dist/dev-server/control-bridge/session-token.d.ts +5 -2
  24. package/dist/dev-server/cors.d.ts +4 -2
  25. package/dist/dev-server/messages.d.ts +6 -0
  26. package/dist/dev-server/session-restart.d.ts +3 -1
  27. package/dist/dev-server~0.mjs +71 -129
  28. package/dist/df~0.mjs +197 -0
  29. package/dist/{846~0.mjs → d~0.mjs} +4 -3
  30. package/dist/ensure-hmr-for-scripts.js +3 -3
  31. package/dist/ensure-hmr-for-scripts.mjs +3 -3
  32. package/dist/extension-js-devtools/build-stamp.json +2 -2
  33. package/dist/extension-js-devtools/chrome/background/service_worker.js +2 -2
  34. package/dist/extension-js-devtools/chrome/pages/welcome.js +2 -2
  35. package/dist/extension-js-devtools/chromium/background/service_worker.js +2 -2
  36. package/dist/extension-js-devtools/chromium/pages/welcome.js +2 -2
  37. package/dist/extension-js-devtools/edge/background/service_worker.js +2 -2
  38. package/dist/extension-js-devtools/edge/pages/welcome.js +2 -2
  39. package/dist/extension-js-devtools/firefox/background/scripts.js +2 -2
  40. package/dist/extension-js-devtools/firefox/pages/welcome.js +2 -2
  41. package/dist/extension-js-theme/build-stamp.json +2 -2
  42. package/dist/{143~0.mjs → ey~0.mjs} +2 -2
  43. package/dist/e~0.mjs +33 -0
  44. package/dist/feature-scripts-classic-traced-globals-loader.mjs +7 -2
  45. package/dist/feature-scripts-content-script-wrapper.js +56 -18
  46. package/dist/feature-scripts-content-script-wrapper.mjs +56 -18
  47. package/dist/feature-scripts-native-geturl-import-loader.mjs +1 -1
  48. package/dist/{105~0.mjs → g0~0.mjs} +1 -1
  49. package/dist/{88~0.mjs → j6~0.mjs} +9 -1
  50. package/dist/{731~0.mjs → j~0.mjs} +2 -2
  51. package/dist/{712~0.mjs → ka~0.mjs} +18 -2
  52. package/dist/{852~0.mjs → k~0.mjs} +4 -2
  53. package/dist/late-css-import-loader.mjs +1 -1
  54. package/dist/lib/addon-lint.d.ts +6 -0
  55. package/dist/lib/build-summary.d.ts +6 -0
  56. package/dist/lib/dev-additions.d.ts +12 -0
  57. package/dist/lib/extension-base-from-stack.d.ts +16 -0
  58. package/dist/lib/localized-manifest-name.d.ts +9 -0
  59. package/dist/lib/manifest-types.d.ts +276 -0
  60. package/dist/lib/messages.d.ts +6 -2
  61. package/dist/lib/process-started-at.d.ts +1 -0
  62. package/dist/lib/real-path.d.ts +8 -0
  63. package/dist/lib/resource-path.d.ts +1 -0
  64. package/dist/lib/session-paths.d.ts +2 -0
  65. package/dist/lib/split-chunks.d.ts +2 -1
  66. package/dist/lib/stats-handler.d.ts +1 -0
  67. package/dist/lib/tsconfig-includes-file.d.ts +1 -0
  68. package/dist/l~0.mjs +2290 -0
  69. package/dist/main-world-bridge.js +92 -23
  70. package/dist/main-world-bridge.mjs +92 -23
  71. package/dist/manifest-entry.d.ts +2 -0
  72. package/dist/manifest.mjs +3 -1
  73. package/dist/module.mjs +3 -3
  74. package/dist/{832~0.mjs → m~0.mjs} +2244 -288
  75. package/dist/o~0.mjs +47 -0
  76. package/dist/plugin-browsers/index.d.ts +7 -0
  77. package/dist/plugin-browsers/safari-dev-plugin.d.ts +2 -0
  78. package/dist/plugin-compatibility/compatibility-lib/messages.d.ts +5 -1
  79. package/dist/plugin-compatibility/compatibility-lib/native-browser-namespace.d.ts +5 -0
  80. package/dist/plugin-compatibility/feature-browser-global.d.ts +11 -1
  81. package/dist/plugin-compatibility/index.d.ts +2 -0
  82. package/dist/plugin-compilation/compilation-lib/messages.d.ts +4 -1
  83. package/dist/plugin-compilation/env.d.ts +1 -0
  84. package/dist/plugin-compilation/index.d.ts +2 -0
  85. package/dist/plugin-compilation/node-builtins.d.ts +5 -0
  86. package/dist/plugin-compilation/one-diagnostic-per-location.d.ts +13 -0
  87. package/dist/plugin-compilation/resolve-file-requests.d.ts +16 -0
  88. package/dist/plugin-compilation/warm-ancestor-watchers.d.ts +19 -0
  89. package/dist/plugin-compilation/watch-real-project-path.d.ts +27 -0
  90. package/dist/plugin-compilation/zip.d.ts +2 -0
  91. package/dist/plugin-css/css-in-content-script-loader.d.ts +1 -1
  92. package/dist/plugin-css/css-lib/build-css-rules.d.ts +3 -0
  93. package/dist/plugin-css/css-lib/inline-content-script-css.d.ts +3 -1
  94. package/dist/plugin-css/css-lib/messages.d.ts +4 -0
  95. package/dist/plugin-css/css-lib/sfc-style-block.d.ts +26 -0
  96. package/dist/plugin-css/css-lib/unplaced-style-imports.d.ts +7 -0
  97. package/dist/plugin-css/css-lib/verbatim-css.d.ts +1 -0
  98. package/dist/plugin-css/dead-css-url-loader.d.ts +9 -1
  99. package/dist/plugin-css/index.d.ts +1 -0
  100. package/dist/plugin-css/sfc-style-block-loader.d.ts +18 -0
  101. package/dist/plugin-css/unplaced-style-import-loader.d.ts +16 -0
  102. package/dist/plugin-playwright/index.d.ts +22 -0
  103. package/dist/plugin-reload/classify-reload.d.ts +20 -0
  104. package/dist/plugin-reload/index.d.ts +4 -2
  105. package/dist/plugin-reload/messages.d.ts +1 -0
  106. package/dist/plugin-reload/reload-dispatch.d.ts +21 -2
  107. package/dist/plugin-reload/reload-lib/dev-content-scripts.d.ts +6 -0
  108. package/dist/plugin-reload/reload-lib/scripts-replay-shim.d.ts +1 -1
  109. package/dist/plugin-reload/steps/inject-bridge-producer.d.ts +6 -0
  110. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/ChunkLoader.d.ts +3 -0
  111. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/AutoPublicPath.d.ts +1 -1
  112. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/BaseUri.d.ts +1 -1
  113. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/LoadScript.d.ts +1 -1
  114. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/PublicPath.d.ts +1 -1
  115. package/dist/plugin-special-folders/get-data.d.ts +2 -0
  116. package/dist/plugin-special-folders/hint-import-only-scripts.d.ts +4 -0
  117. package/dist/plugin-special-folders/include-files.d.ts +2 -0
  118. package/dist/plugin-special-folders/messages.d.ts +1 -0
  119. package/dist/plugin-web-extension/feature-html/html-lib/inject.d.ts +1 -1
  120. package/dist/plugin-web-extension/feature-html/html-lib/patch-html.d.ts +1 -0
  121. package/dist/plugin-web-extension/feature-html/steps/update-html-file.d.ts +1 -0
  122. package/dist/plugin-web-extension/feature-icons/extract-action-theme-icons.d.ts +1 -0
  123. package/dist/plugin-web-extension/feature-icons/extract-icon-variants.d.ts +2 -0
  124. package/dist/plugin-web-extension/feature-json/json-validation.d.ts +2 -1
  125. package/dist/plugin-web-extension/feature-json/messages.d.ts +2 -0
  126. package/dist/plugin-web-extension/feature-json/process-assets.d.ts +1 -1
  127. package/dist/plugin-web-extension/feature-manifest/manifest-lib/filter-keys-gecko.d.ts +21 -0
  128. package/dist/plugin-web-extension/feature-manifest/manifest-lib/filter-keys-safari.d.ts +1 -1
  129. package/dist/plugin-web-extension/feature-manifest/manifest-lib/icon-variants-fallback.d.ts +15 -0
  130. package/dist/plugin-web-extension/feature-manifest/manifest-lib/sanitize-fatal-shapes.d.ts +2 -1
  131. package/dist/plugin-web-extension/feature-manifest/manifest-lib/webkit-unsupported-keys.d.ts +15 -0
  132. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/content_scripts.d.ts +1 -1
  133. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/icons.d.ts +3 -2
  134. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/omnibox.d.ts +1 -1
  135. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/page_action.d.ts +2 -1
  136. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/permissions.d.ts +1 -1
  137. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/sandbox.d.ts +1 -1
  138. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/browser_action.d.ts +4 -3
  139. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/action.d.ts +3 -2
  140. package/dist/plugin-web-extension/feature-manifest/messages.d.ts +15 -1
  141. package/dist/plugin-web-extension/feature-manifest/normalize-manifest-path.d.ts +2 -0
  142. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-additions.d.ts +8 -0
  143. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-background.d.ts +2 -2
  144. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-externally-connectable.d.ts +1 -1
  145. package/dist/plugin-web-extension/feature-manifest/steps/patch-gecko-background.d.ts +1 -0
  146. package/dist/plugin-web-extension/feature-manifest/steps/warn-content-script-host-access.d.ts +17 -0
  147. package/dist/plugin-web-extension/feature-manifest/steps/warn-description-length.d.ts +26 -0
  148. package/dist/plugin-web-extension/feature-manifest/steps/warn-gecko-unsupported-apis.d.ts +37 -2
  149. package/dist/plugin-web-extension/feature-scripts/contracts.d.ts +3 -0
  150. package/dist/plugin-web-extension/feature-scripts/index.d.ts +1 -0
  151. package/dist/plugin-web-extension/feature-scripts/messages.d.ts +10 -1
  152. package/dist/plugin-web-extension/feature-scripts/scripts-lib/completion-value.d.ts +13 -0
  153. package/dist/plugin-web-extension/feature-scripts/scripts-lib/injected-sheet-urls.d.ts +5 -0
  154. package/dist/plugin-web-extension/feature-scripts/scripts-lib/main-world-bridge-pairing.d.ts +5 -0
  155. package/dist/plugin-web-extension/feature-scripts/scripts-lib/main-world-copy-routing.d.ts +2 -0
  156. package/dist/plugin-web-extension/feature-scripts/scripts-lib/registration-worlds.d.ts +10 -0
  157. package/dist/plugin-web-extension/feature-scripts/scripts-lib/runtime-main-world-scripts.d.ts +25 -2
  158. package/dist/plugin-web-extension/feature-scripts/scripts-lib/runtime-script-sheet.d.ts +14 -0
  159. package/dist/plugin-web-extension/feature-scripts/scripts-lib/taken-extension-base.d.ts +10 -0
  160. package/dist/plugin-web-extension/feature-scripts/steps/add-base-uri-runtime-module.d.ts +7 -1
  161. package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/content-script-wrapper.d.ts +2 -0
  162. package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/index.d.ts +2 -0
  163. package/dist/plugin-web-extension/feature-scripts/steps/add-public-path-runtime-module.d.ts +6 -0
  164. package/dist/plugin-web-extension/feature-scripts/steps/classic-traced-globals-loader.d.ts +1 -0
  165. package/dist/plugin-web-extension/feature-scripts/steps/compile-main-world-scripts.d.ts +4 -0
  166. package/dist/plugin-web-extension/feature-scripts/steps/keep-completion-value.d.ts +6 -0
  167. package/dist/plugin-web-extension/feature-scripts/steps/pair-runtime-main-world-bridges.d.ts +12 -0
  168. package/dist/plugin-web-extension/feature-scripts/steps/place-runtime-script-sheets.d.ts +12 -0
  169. package/dist/plugin-web-extension/feature-scripts/steps/prune-main-world-bridges.d.ts +1 -0
  170. package/dist/plugin-web-extension/feature-scripts/steps/root-injected-sheet-urls.d.ts +9 -0
  171. package/dist/plugin-web-extension/feature-scripts/steps/route-main-world-copies.d.ts +10 -0
  172. package/dist/plugin-web-extension/feature-scripts/steps/source-literals.d.ts +24 -0
  173. package/dist/plugin-web-extension/feature-scripts/steps/take-extension-base.d.ts +11 -0
  174. package/dist/plugin-web-extension/feature-scripts/steps/trace-runtime-loaded-files.d.ts +18 -3
  175. package/dist/plugin-web-extension/feature-scripts/steps/warn-main-world-registration-changed.d.ts +12 -0
  176. package/dist/plugin-web-extension/feature-scripts/steps/warn-moved-page-relative-urls.d.ts +30 -0
  177. package/dist/plugin-web-extension/feature-scripts/steps/warn-page-relative-script-path.d.ts +10 -0
  178. package/dist/plugin-web-extension/feature-scripts/steps/warn-unknown-registration-world.d.ts +10 -0
  179. package/dist/plugin-web-extension/feature-web-resources/collect-entry-imports.d.ts +1 -0
  180. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/messages.d.ts +2 -0
  181. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/page-requests.d.ts +5 -0
  182. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/resolve-war.d.ts +1 -0
  183. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/unreachable-resources.d.ts +1 -0
  184. package/dist/plugin-web-extension/shared/script-graph.d.ts +12 -0
  185. package/dist/preprocessor-passthrough-loader.mjs +1 -1
  186. package/dist/preview.mjs +1 -1
  187. package/dist/public-css-url-loader.mjs +1 -1
  188. package/dist/{331~0.mjs → q~0.mjs} +2 -2
  189. package/dist/rj~0.mjs +125 -0
  190. package/dist/{519~0.mjs → rl~0.mjs} +56 -5
  191. package/dist/rspack-config~0.mjs +3140 -3302
  192. package/dist/{177~0.mjs → r~0.mjs} +2 -2
  193. package/dist/sfc-style-block-loader.mjs +49 -0
  194. package/dist/stats-handler~0.mjs +15 -7
  195. package/dist/tm~0.mjs +71 -0
  196. package/dist/types.d.ts +46 -5
  197. package/dist/{285~0.mjs → t~0.mjs} +41 -26
  198. package/dist/unplaced-style-import-loader.mjs +131 -0
  199. package/dist/x~0.mjs +3 -0
  200. package/dist/y~0.mjs +234 -0
  201. package/dist/zip~0.mjs +5 -4
  202. package/dist/{363~0.mjs → z~0.mjs} +563 -281
  203. package/package.json +6 -6
  204. package/dist/527~0.mjs +0 -3
  205. package/dist/840~0.mjs +0 -5635
  206. /package/dist/{895~0.mjs → 3~0.mjs} +0 -0
  207. /package/dist/{374~0.mjs → 5~0.mjs} +0 -0
  208. /package/dist/{206~0.mjs → 6~0.mjs} +0 -0
  209. /package/dist/{471~0.mjs → g~0.mjs} +0 -0
  210. /package/dist/{117~0.mjs → w~0.mjs} +0 -0
@@ -0,0 +1,5 @@
1
+ export declare const CHROMIUM_EXTENSION_ROOT = "chrome-extension://__MSG_@@extension_id__/";
2
+ export declare const GECKO_EXTENSION_ROOT = "moz-extension://__MSG_@@extension_id__/";
3
+ export declare function injectedSheetRoot(browser: string): string | undefined;
4
+ export declare function isInjectedSheet(assetName: string, runtimeEntries: string[]): boolean;
5
+ export declare function rootedAtExtension(css: string, root?: string): string;
@@ -0,0 +1,5 @@
1
+ export declare const MAIN_WORLD_BRIDGE_ENTRY = "scripts/extjs-main-world-bridge";
2
+ export declare const MAIN_WORLD_BRIDGE_PAIR_PREFIX = "extjs-main-world-bridge:";
3
+ export declare const MAIN_WORLD_BRIDGE_PAIRING_MARK = "__extjsMainWorldBridgePaired";
4
+ export declare const REFUSED_SCRIPT_ID = "_extjs-main-world-bridge:";
5
+ export declare function buildMainWorldBridgePairingSource(bridgeFile?: string, baseReaders?: string[] | null, injectable?: string[] | null, baseGlobal?: string): string;
@@ -0,0 +1,2 @@
1
+ export declare const MAIN_WORLD_COPY_ROUTING_MARK = "__extjsMainWorldCopiesRouted";
2
+ export declare function buildMainWorldCopyRoutingSource(copies: Record<string, string>): string;
@@ -0,0 +1,10 @@
1
+ import { type ImportedModuleReader } from '../steps/source-literals.js';
2
+ export type RegisteredWorld = 'MAIN' | 'ISOLATED' | 'UNKNOWN';
3
+ export interface RegisteredFileSighting {
4
+ file: string;
5
+ world: RegisteredWorld;
6
+ index: number;
7
+ kept: boolean;
8
+ }
9
+ export declare function extractRegisteredFileSightings(source: string, readImported?: ImportedModuleReader): RegisteredFileSighting[];
10
+ export declare function extractMainWorldRegisteredFileLiterals(source: string, readImported?: ImportedModuleReader): string[];
@@ -2,9 +2,32 @@ import type { FilepathList } from '../../../types.js';
2
2
  export interface RuntimeMainWorldEntry {
3
3
  entryName: string;
4
4
  files: string[];
5
+ registeredBy: string;
6
+ copyOf?: string;
5
7
  }
6
- export declare function findRuntimeMainWorldEntries(options: {
8
+ export interface RuntimeMainWorldOptions {
7
9
  includeList: FilepathList;
10
+ pageList?: FilepathList;
8
11
  manifestDir: string;
9
12
  projectPath: string;
10
- }): RuntimeMainWorldEntry[];
13
+ }
14
+ export declare function findRuntimeMainWorldEntries(options: RuntimeMainWorldOptions): RuntimeMainWorldEntry[];
15
+ export declare function withMainWorldCopyEntries(options: RuntimeMainWorldOptions): FilepathList;
16
+ export interface UnknownWorldRegistration {
17
+ file: string;
18
+ line: number;
19
+ literal: string;
20
+ emitted: string;
21
+ }
22
+ export declare function findUnknownWorldRegistrations(options: RuntimeMainWorldOptions): UnknownWorldRegistration[];
23
+ export interface PageRelativeScriptPath {
24
+ page: string;
25
+ file: string;
26
+ literal: string;
27
+ requested: string;
28
+ emitted: string;
29
+ }
30
+ export declare function findPageRelativeScriptPaths(options: RuntimeMainWorldOptions & {
31
+ outputHolds?: (distRel: string) => boolean;
32
+ }): PageRelativeScriptPath[];
33
+ export declare function findBridgePairingPages(pageList: FilepathList | undefined, projectPath: string): string[];
@@ -0,0 +1,14 @@
1
+ export declare const SHEET_BLOCK_OPEN = "/*extjs-sheet*/(function(module){";
2
+ export declare const SHEET_BLOCK_CLOSE = "})({});/*extjs-sheet-end*/";
3
+ export declare function runtimeScriptSheetName(entryName: string): string;
4
+ export declare function rootedSheet(css: string): string;
5
+ export declare function runtimeScriptSheetBlock(input: {
6
+ css: string;
7
+ entryName: string;
8
+ devSalt: string;
9
+ gecko: boolean;
10
+ baseAttribute?: string;
11
+ baseScheme?: string;
12
+ }): string;
13
+ export declare function withoutSheetBlock(text: string): string;
14
+ export declare function namesSheet(scriptText: string, sheetName: string): boolean;
@@ -0,0 +1,10 @@
1
+ import type { DevOptions } from '../../../types.js';
2
+ export declare const TAKE_BLOCK_COLUMNS: number;
3
+ export declare function extensionBaseGlobalFor(manifestPath: string, browser?: DevOptions['browser']): string;
4
+ export declare function extensionBaseAttributeFor(manifestPath: string | undefined, browser?: DevOptions['browser']): string;
5
+ export declare function takesExtensionBase(text: string): boolean;
6
+ export declare function closeTakeBlock(text: string, global?: string): {
7
+ open: string;
8
+ closed: string;
9
+ };
10
+ export declare function isEntryFile(assetName: string, entryName: string): boolean;
@@ -1,5 +1,11 @@
1
1
  import type { Compiler } from '@rspack/core';
2
+ import type { DevOptions } from '../../../types.js';
2
3
  export declare class AddBaseUriRuntimeModule {
4
+ private readonly options;
5
+ constructor(options?: {
6
+ browser?: DevOptions['browser'];
7
+ manifestPath?: string;
8
+ });
3
9
  apply(compiler: Compiler): void;
4
10
  }
5
- export declare function baseUriRuntimeSource(baseUriGlobal: string): string[];
11
+ export declare function baseUriRuntimeSource(baseUriGlobal: string, gecko?: boolean, attribute?: string, scheme?: string): string[];
@@ -5,6 +5,8 @@ interface ContentScriptLoaderContext {
5
5
  devSession?: boolean;
6
6
  browser?: string;
7
7
  mainWorldScripts?: string[];
8
+ mainWorldCopies?: string[];
9
+ mainWorldBundle?: boolean;
8
10
  scriptsFolder?: string | false;
9
11
  };
10
12
  _compilation?: unknown;
@@ -1,11 +1,13 @@
1
1
  import { type Compiler } from '@rspack/core';
2
2
  import type { DevOptions, FilepathList, PluginInterface } from '../../../../types.js';
3
3
  export declare function resolveBundleCssProbeMarker(cssPath: string, hasAsset: (name: string) => boolean, assetNames: () => string[]): string;
4
+ export declare function findDeclaredMainWorldFiles(manifestPath: string, browser: DevOptions['browser']): string[];
4
5
  export declare class AddContentScriptWrapper {
5
6
  static getBridgeScripts(manifestPath: string, browser?: DevOptions['browser']): FilepathList;
6
7
  private readonly manifestPath;
7
8
  private readonly browser;
8
9
  private readonly includeList;
10
+ private readonly pageList?;
9
11
  private readonly devSession?;
10
12
  constructor(options: PluginInterface);
11
13
  private resolveLoader;
@@ -1,4 +1,10 @@
1
1
  import type { Compiler } from '@rspack/core';
2
+ import type { DevOptions } from '../../../types.js';
2
3
  export declare class AddPublicPathRuntimeModule {
4
+ private readonly options;
5
+ constructor(options?: {
6
+ browser?: DevOptions['browser'];
7
+ manifestPath?: string;
8
+ });
3
9
  apply(compiler: Compiler): void;
4
10
  }
@@ -1,6 +1,7 @@
1
1
  export declare function collectExposableClassicNames(content: string): string[];
2
2
  interface LoaderContext {
3
3
  resourcePath: string;
4
+ resourceQuery?: string;
4
5
  callback(err: Error | null, content?: string, sourceMap?: unknown): void;
5
6
  }
6
7
  export default function classicTracedGlobalsLoader(this: LoaderContext, source: string, inputSourceMap?: unknown): string | undefined;
@@ -6,11 +6,15 @@ export interface MainWorldGroup {
6
6
  files: string[];
7
7
  }
8
8
  export declare function findMainWorldGroups(manifestPath: string, browser: DevOptions['browser']): MainWorldGroup[];
9
+ type LooseGenerator = Record<string, Record<string, unknown>> | undefined;
10
+ export declare function withOwnClassNames(generator: LooseGenerator, entryName: string): NonNullable<LooseGenerator>;
9
11
  export declare class CompileMainWorldScripts {
10
12
  static readonly name: string;
11
13
  private readonly manifestPath;
12
14
  private readonly browser;
13
15
  private readonly includeList;
16
+ private readonly pageList?;
14
17
  constructor(options: PluginInterface);
15
18
  apply(compiler: Compiler): void;
16
19
  }
20
+ export {};
@@ -0,0 +1,6 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ export declare function keepCompletionValueOf(compilation: object, assetName: string): void;
3
+ export declare class KeepCompletionValue {
4
+ static readonly name: string;
5
+ apply(compiler: Compiler): void;
6
+ }
@@ -0,0 +1,12 @@
1
+ import { Compilation, type Compiler } from '@rspack/core';
2
+ import type { PluginInterface } from '../../../types.js';
3
+ export declare const BACKGROUND_ASSET: RegExp;
4
+ export declare function pageBundleNames(compilation: Compilation, page: string): string[];
5
+ export declare class PairRuntimeMainWorldBridges {
6
+ private readonly manifestPath;
7
+ private readonly browser;
8
+ private readonly includeList;
9
+ private readonly pageList?;
10
+ constructor(options: PluginInterface);
11
+ apply(compiler: Compiler): void;
12
+ }
@@ -0,0 +1,12 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { PluginInterface } from '../../../types.js';
3
+ export declare class PlaceRuntimeScriptSheets {
4
+ static readonly name: string;
5
+ private readonly browser;
6
+ private readonly includeList;
7
+ private readonly manifestPath?;
8
+ constructor(options: Pick<PluginInterface, 'browser' | 'includeList'> & {
9
+ manifestPath?: string;
10
+ });
11
+ apply(compiler: Compiler): void;
12
+ }
@@ -1,5 +1,6 @@
1
1
  import { type Compiler } from '@rspack/core';
2
2
  import type { DevOptions } from '../../../types.js';
3
+ export declare function getBaseReaderRequirements(compiler: Compiler): Set<string>;
3
4
  export declare class PruneMainWorldBridges {
4
5
  private readonly options;
5
6
  constructor(options: {
@@ -0,0 +1,9 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { PluginInterface } from '../../../types.js';
3
+ export declare class RootInjectedSheetUrls {
4
+ static readonly name: string;
5
+ private readonly browser;
6
+ private readonly includeList;
7
+ constructor(options: Pick<PluginInterface, 'browser' | 'includeList'>);
8
+ apply(compiler: Compiler): void;
9
+ }
@@ -0,0 +1,10 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { PluginInterface } from '../../../types.js';
3
+ export declare class RouteMainWorldCopies {
4
+ static readonly name: string;
5
+ private readonly manifestPath;
6
+ private readonly includeList;
7
+ private readonly pageList?;
8
+ constructor(options: PluginInterface);
9
+ apply(compiler: Compiler): void;
10
+ }
@@ -0,0 +1,24 @@
1
+ export declare function forgetBlankedSources(): void;
2
+ export declare function keptBlankedSources(): number;
3
+ export declare function blankComments(source: string): string;
4
+ export declare function readBalancedArgs(code: string, openIndex: number): string | null;
5
+ export declare function readBalancedLiteral(code: string, openIndex: number): string | null;
6
+ export declare function skipString(code: string, start: number, cap: number): number;
7
+ export declare function splitTopLevelArgs(args: string): string[];
8
+ export declare function pureStringLiteral(arg: string): string | null;
9
+ export declare function unescapeStringBody(body: string): string;
10
+ export declare function escapeRegExp(text: string): string;
11
+ export interface ImportedModule {
12
+ source: string;
13
+ file: string;
14
+ }
15
+ export type ImportedModuleReader = (specifier: string, fromFile?: string) => string | ImportedModule | null;
16
+ export type LiteralLookup = (expression: string, useIndex?: number) => ResolvedLiteral | null;
17
+ export interface ResolvedLiteral {
18
+ text: string;
19
+ lookup: LiteralLookup;
20
+ index: number;
21
+ }
22
+ export declare function isConstantReference(text: string): boolean;
23
+ export declare function declaredValueIndex(code: string, name: string, useIndex: number): number | null;
24
+ export declare function literalLookup(code: string, readImported?: ImportedModuleReader): LiteralLookup;
@@ -0,0 +1,11 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { PluginInterface } from '../../../types.js';
3
+ export declare class TakeExtensionBase {
4
+ static readonly name: string;
5
+ private readonly manifestPath;
6
+ private readonly browser;
7
+ private readonly includeList;
8
+ private readonly pageList?;
9
+ constructor(options: PluginInterface);
10
+ apply(compiler: Compiler): void;
11
+ }
@@ -1,5 +1,7 @@
1
1
  import { Compilation, type Compiler } from '@rspack/core';
2
2
  import type { DevOptions } from '../../../types.js';
3
+ import { type ImportedModuleReader, type LiteralLookup, type ResolvedLiteral } from './source-literals.js';
4
+ export type { ImportedModule, ImportedModuleReader } from './source-literals.js';
3
5
  export type LoadContext = 'importScripts' | 'injected' | 'getURL' | 'html';
4
6
  export type TracedLoad = 'classic' | 'by-shape';
5
7
  export type TracedFormat = 'module' | 'classic';
@@ -77,6 +79,19 @@ export declare function resolveExtensionPath(literal: string, basePath: string):
77
79
  export declare function extractGetURLLiterals(source: string): string[];
78
80
  export declare function extractRuntimeSurfaceLiterals(source: string): string[];
79
81
  export declare function extractStaticImportLiterals(source: string): string[];
80
- export declare function extractMainWorldRegisteredFileLiterals(source: string): string[];
81
- export declare function extractInjectedFileLiterals(source: string): string[];
82
- export {};
82
+ export declare function splitTopLevelConditional(expression: string): [string, string] | null;
83
+ export declare function stringElements(found: ResolvedLiteral, strict: boolean): string[] | null;
84
+ export declare function constantStrings(lookup: LiteralLookup, expression: string, useIndex: number): string[] | null;
85
+ interface PathEntry {
86
+ value: string;
87
+ viaConstant: boolean;
88
+ }
89
+ export interface RegisteredScriptGroup {
90
+ text: string;
91
+ viaConstant: boolean;
92
+ lookup: LiteralLookup;
93
+ at: number;
94
+ }
95
+ export declare function splitRegisteredScriptGroups(lookup: LiteralLookup, args: string, useIndex: number): RegisteredScriptGroup[];
96
+ export declare function groupPropEntries(group: RegisteredScriptGroup, prop: string): PathEntry[];
97
+ export declare function extractInjectedFileLiterals(source: string, readImported?: ImportedModuleReader): string[];
@@ -0,0 +1,12 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { PluginInterface } from '../../../types.js';
3
+ export declare const MAIN_WORLD_SETTLE_MS = 300;
4
+ export declare function isAwaitingMainWorldRestart(compiler: object | undefined, compilation?: object): boolean;
5
+ export declare class WarnMainWorldRegistrationChanged {
6
+ static readonly name: string;
7
+ private readonly manifestPath;
8
+ private readonly includeList;
9
+ private readonly pageList?;
10
+ constructor(options: PluginInterface);
11
+ apply(compiler: Compiler): void;
12
+ }
@@ -0,0 +1,30 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { FilepathList } from '../../../types.js';
3
+ export declare function extractUrlAttributeLiterals(source: string): string[];
4
+ export interface MovedPageRelativeUrl {
5
+ page: string;
6
+ assetName: string;
7
+ literal: string;
8
+ requested: string;
9
+ emitted: string;
10
+ }
11
+ export interface MovedPage {
12
+ source: string;
13
+ output: string;
14
+ scripts: Array<{
15
+ assetName: string;
16
+ text: string;
17
+ }>;
18
+ }
19
+ export declare function findMovedPageRelativeUrls(pages: MovedPage[], isShipped: (distRel: string) => boolean): MovedPageRelativeUrl[];
20
+ export declare class WarnMovedPageRelativeUrls {
21
+ private readonly manifestPath;
22
+ private readonly pageList;
23
+ constructor(options: {
24
+ manifestPath: string;
25
+ pageList?: FilepathList;
26
+ });
27
+ apply(compiler: Compiler): void;
28
+ private movedPages;
29
+ private report;
30
+ }
@@ -0,0 +1,10 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { PluginInterface } from '../../../types.js';
3
+ export declare class WarnPageRelativeScriptPath {
4
+ private readonly manifestPath;
5
+ private readonly browser;
6
+ private readonly includeList;
7
+ private readonly pageList?;
8
+ constructor(options: PluginInterface);
9
+ apply(compiler: Compiler): void;
10
+ }
@@ -0,0 +1,10 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { PluginInterface } from '../../../types.js';
3
+ export declare class WarnUnknownRegistrationWorld {
4
+ static readonly name: string;
5
+ private readonly manifestPath;
6
+ private readonly includeList;
7
+ private readonly pageList?;
8
+ constructor(options: PluginInterface);
9
+ apply(compiler: Compiler): void;
10
+ }
@@ -3,6 +3,7 @@ import type { FilepathList } from '../../types.js';
3
3
  export declare function isInjectedScriptEntry(entryName: string): boolean;
4
4
  export declare function isPageContextEntry(entryName: string): boolean;
5
5
  export declare const EMITTED_ASSET_REF_PATTERN: RegExp;
6
+ export declare function collectNamedUnrequestedPages(source: string, emittedAssetNames: string[]): string[];
6
7
  export declare function listEmittedAssetNames(compilation: Compilation): string[];
7
8
  export declare function collectReferencedRuntimePayloads(source: string, emittedAssetNames: string[]): string[];
8
9
  export declare function collectContentScriptAsyncChunkFiles(compilation: Compilation): Record<string, string[]>;
@@ -6,7 +6,9 @@ export declare function warFieldError(filePath: string, opts?: {
6
6
  }): string;
7
7
  export declare function warStringEntryInMv3(entry: string): string;
8
8
  export declare function warInvalidMatchPattern(pattern: string): string;
9
+ export declare function warPatternLeavesRoot(pattern: string): string;
9
10
  export declare function warUnreachableResource(resource: string, entryName: string): string;
11
+ export declare function warPageNamedNotExposed(file: string, page: string): string;
10
12
  export declare function warInjectedScriptExposed(file: string, resources: string[]): string;
11
13
  export declare function entryImportsSummary(entryCount: number, totalResources: number): string;
12
14
  export declare function warPatchedSummary(v3Groups: number, v3ResourcesTotal: number, v2Resources: number): string;
@@ -0,0 +1,5 @@
1
+ export interface PageRequestScan {
2
+ names: (page: string) => boolean;
3
+ requests: (page: string) => boolean;
4
+ }
5
+ export declare function scanPageRequests(source: string): PageRequestScan;
@@ -10,5 +10,6 @@ export declare function resolveUserDeclaredWAR(compilation: Compilation, manifes
10
10
  matches: string[];
11
11
  resources: Set<string>;
12
12
  extra?: Record<string, unknown>;
13
+ matchesAbsent?: boolean;
13
14
  }[];
14
15
  };
@@ -1,6 +1,7 @@
1
1
  export declare function normalizeResourcePath(value: string): string;
2
2
  export declare function isResourceCovered(declared: readonly string[], candidate: string): boolean;
3
3
  export declare const GET_URL_LITERAL_PATTERN: RegExp;
4
+ export declare const MAX_SCANNED_SOURCE_BYTES: number;
4
5
  export declare function collectGetUrlLiterals(source: string): string[];
5
6
  export declare function findUnreachableRuntimeResources(options: {
6
7
  source: string;
@@ -1,4 +1,16 @@
1
+ export declare const MAX_LOCAL_IMPORT_DEPTH = 8;
2
+ export declare const MAX_LOCAL_IMPORT_FILES = 2000;
1
3
  export declare function readIfFile(absPath: string): string | undefined;
2
4
  export declare function scanScriptGraph(entryAbsPath: string, collect: (source: string) => string[]): string[];
5
+ export declare function collectModuleSpecifiers(source: string): string[];
6
+ export declare function isLocalScriptSource(file: string): boolean;
7
+ export declare function readScriptText(file: string): string | undefined;
8
+ export type LocalImportResolver = ((fromFile: string, specifier: string) => string | undefined) & {
9
+ scope: string;
10
+ };
11
+ export type BuildResolve = Record<string, unknown>;
12
+ export declare function rememberBuildResolve(projectPath: string, resolve: unknown): void;
13
+ export declare function createLocalImportResolver(projectPath: string): LocalImportResolver;
14
+ export declare function walkLocalImportGraph(entries: string[], importsOf: (file: string) => string[]): string[];
3
15
  export declare function scanPageScripts(htmlAbsPath: string, projectDir: string, collect: (source: string) => string[]): string[];
4
16
  export declare function rootRelativePages(literals: string[], projectDir: string): Record<string, string>;
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
2
- import { preprocessorShippedUncompiled } from "./524~0.mjs";
2
+ import { preprocessorShippedUncompiled } from "./9~0.mjs";
3
3
  import * as __rspack_external_node_path_806ed179 from "node:path";
4
4
  function preprocessorPassthroughLoader(source) {
5
5
  const ext = __rspack_external_node_path_806ed179.extname(this.resourcePath || '').toLowerCase();
package/dist/preview.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
2
- export { extensionPreview } from "./832~0.mjs";
2
+ export { extensionPreview } from "./m~0.mjs";
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
2
- export { PUBLIC_ROOT_SCHEME, default, keepPublicRootRefs } from "./177~0.mjs";
2
+ export { PUBLIC_ROOT_SCHEME, default, keepPublicRootRefs } from "./r~0.mjs";
@@ -33,7 +33,7 @@ const EMULATOR_BROWSER = 'chromium-emulator';
33
33
  function isEmulatorBrowser(browser) {
34
34
  return browser === EMULATOR_BROWSER;
35
35
  }
36
- [
36
+ const SUPPORTED_BROWSERS = [
37
37
  ...CHROMIUM_BASED_BROWSERS,
38
38
  ...GECKO_BASED_BROWSERS
39
39
  ];
@@ -46,4 +46,4 @@ function isGeckoBasedBrowser(browser) {
46
46
  function isWebkitBasedBrowser(browser) {
47
47
  return WEBKIT_BASED_BROWSERS.includes(browser) || String(browser).includes('webkit');
48
48
  }
49
- export { CHROMIUM_FAMILY_ALIASES, GECKO_FAMILY_ALIASES, isChromiumBasedBrowser, isEmulatorBrowser, isGeckoBasedBrowser, isWebkitBasedBrowser };
49
+ export { CHROMIUM_FAMILY_ALIASES, GECKO_FAMILY_ALIASES, SUPPORTED_BROWSERS, WEBKIT_BASED_BROWSERS, isChromiumBasedBrowser, isEmulatorBrowser, isGeckoBasedBrowser, isWebkitBasedBrowser };
package/dist/rj~0.mjs ADDED
@@ -0,0 +1,125 @@
1
+ import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
2
+ const WEBKIT_UNSUPPORTED_TOP_LEVEL_KEYS = Object.freeze({
3
+ side_panel: 'Safari has no side panel surface',
4
+ sidebar_action: 'Safari has no sidebar surface',
5
+ sandbox: 'Safari cannot run sandboxed extension pages',
6
+ user_scripts: 'Safari has no userScripts API',
7
+ omnibox: 'Safari has no omnibox keyword API',
8
+ chrome_settings_overrides: 'Safari lets no extension override these settings',
9
+ tts_engine: 'Safari has no speech engine API',
10
+ file_browser_handlers: 'ChromeOS only',
11
+ input_components: 'ChromeOS only',
12
+ cross_origin_embedder_policy: 'Safari reads no COEP key from a manifest',
13
+ cross_origin_opener_policy: 'Safari reads no COOP key from a manifest',
14
+ requirements: 'Chrome Web Store only',
15
+ oauth2: 'Safari has no identity API to consume it',
16
+ nacl_modules: 'Native Client is Chrome only',
17
+ replacement_web_app: 'Chrome Web Store only',
18
+ offline_enabled: 'Chrome Web Store only',
19
+ differential_fingerprint: 'Chrome Web Store only',
20
+ incognito: 'Safari always runs extensions in spanning mode and ignores the declared value'
21
+ });
22
+ const WEBKIT_UNSUPPORTED_PERMISSIONS = new Set([
23
+ 'accessibilityFeatures.modify',
24
+ 'accessibilityFeatures.read',
25
+ 'audio',
26
+ 'background',
27
+ 'bookmarks',
28
+ 'browsingData',
29
+ 'certificateProvider',
30
+ 'clipboardRead',
31
+ 'contentSettings',
32
+ 'debugger',
33
+ 'declarativeContent',
34
+ 'desktopCapture',
35
+ 'documentScan',
36
+ 'downloads',
37
+ 'enterprise.deviceAttributes',
38
+ 'enterprise.platformKeys',
39
+ 'experimental',
40
+ 'favicon',
41
+ 'fileSystemProvider',
42
+ 'fontSettings',
43
+ 'gcm',
44
+ 'geolocation',
45
+ 'history',
46
+ 'identity',
47
+ 'identity.email',
48
+ 'idle',
49
+ 'management',
50
+ 'notifications',
51
+ 'offscreen',
52
+ 'pageCapture',
53
+ 'platformKeys',
54
+ 'power',
55
+ 'printerProvider',
56
+ 'privacy',
57
+ 'processes',
58
+ 'proxy',
59
+ 'readingList',
60
+ 'search',
61
+ 'sessions',
62
+ 'sidePanel',
63
+ 'system.cpu',
64
+ 'system.display',
65
+ 'system.memory',
66
+ 'system.storage',
67
+ 'systemLog',
68
+ 'tabCapture',
69
+ 'tabGroups',
70
+ 'topSites',
71
+ 'tts',
72
+ 'ttsEngine',
73
+ 'userScripts',
74
+ 'vpnProvider',
75
+ 'wallpaper',
76
+ 'webAuthenticationProxy',
77
+ 'webRequestBlocking'
78
+ ]);
79
+ const WEBKIT_UNSUPPORTED_OPTIONS_UI_KEYS = Object.freeze({
80
+ open_in_tab: 'Safari always opens the options page in a tab'
81
+ });
82
+ function webkitUnsupportedManifestKeys() {
83
+ return [
84
+ ...Object.entries(WEBKIT_UNSUPPORTED_TOP_LEVEL_KEYS).map(([key, reason])=>({
85
+ key,
86
+ reason
87
+ })),
88
+ ...Object.entries(WEBKIT_UNSUPPORTED_OPTIONS_UI_KEYS).map(([key, reason])=>({
89
+ key: `options_ui.${key}`,
90
+ reason
91
+ }))
92
+ ];
93
+ }
94
+ function webkitUnsupportedPermissions() {
95
+ return [
96
+ ...WEBKIT_UNSUPPORTED_PERMISSIONS
97
+ ];
98
+ }
99
+ function pagePath(value) {
100
+ if ('string' != typeof value) return null;
101
+ const trimmed = value.trim().replace(/\\/g, '/').replace(/^\/+/, '');
102
+ const clean = trimmed.split(/[?#]/)[0];
103
+ return /\.html?$/i.test(clean) ? clean : null;
104
+ }
105
+ function webkitDroppedSurfacePages(manifest) {
106
+ if (!manifest) return [];
107
+ const pages = [];
108
+ const add = (key, owner, value)=>{
109
+ const found = pagePath(value);
110
+ if (!found) return;
111
+ pages.push({
112
+ path: found,
113
+ key,
114
+ reason: WEBKIT_UNSUPPORTED_TOP_LEVEL_KEYS[owner]
115
+ });
116
+ };
117
+ const sidePanel = manifest.side_panel;
118
+ add('side_panel.default_path', 'side_panel', sidePanel?.default_path);
119
+ const sidebar = manifest.sidebar_action;
120
+ add('sidebar_action.default_panel', 'sidebar_action', sidebar?.default_panel);
121
+ const sandbox = manifest.sandbox;
122
+ if (Array.isArray(sandbox?.pages)) for (const [index, page] of sandbox.pages.entries())add(`sandbox.pages.${String(index)}`, 'sandbox', page);
123
+ return pages;
124
+ }
125
+ export { WEBKIT_UNSUPPORTED_OPTIONS_UI_KEYS, WEBKIT_UNSUPPORTED_PERMISSIONS, WEBKIT_UNSUPPORTED_TOP_LEVEL_KEYS, webkitDroppedSurfacePages, webkitUnsupportedManifestKeys, webkitUnsupportedPermissions };