extension-develop 4.1.19 → 4.1.21

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 (76) hide show
  1. package/dist/672~0.mjs +24 -1
  2. package/dist/747~0.mjs +4 -2
  3. package/dist/832~0.mjs +26 -6
  4. package/dist/840~0.mjs +507 -26
  5. package/dist/950~0.mjs +18 -26
  6. package/dist/dev-server/control-bridge/actions-file.d.ts +0 -1
  7. package/dist/dev-server/control-bridge/broker.d.ts +6 -4
  8. package/dist/dev-server/control-bridge/contracts.d.ts +1 -1
  9. package/dist/dev-server/control-bridge/logs-file.d.ts +0 -1
  10. package/dist/dev-server/control-bridge/producer-runtime.d.ts +1 -2
  11. package/dist/dev-server~0.mjs +19 -5
  12. package/dist/extension-js-devtools/edge/manifest.json +0 -1
  13. package/dist/lib/addon-lint.d.ts +4 -1
  14. package/dist/lib/chunk-dependency-provenance.d.ts +14 -0
  15. package/dist/lib/constants.d.ts +1 -0
  16. package/dist/lib/ensure-develop-artifacts.d.ts +0 -7
  17. package/dist/lib/has-dependency.d.ts +0 -5
  18. package/dist/lib/manifest-utils.d.ts +2 -0
  19. package/dist/lib/merge-options.d.ts +0 -40
  20. package/dist/lib/messages.d.ts +4 -4
  21. package/dist/lib/package-manager.d.ts +2 -0
  22. package/dist/lib/project-manifest.d.ts +0 -1
  23. package/dist/lib/session-paths.d.ts +0 -22
  24. package/dist/plugin-browsers/index.d.ts +0 -7
  25. package/dist/plugin-browsers/safari-dev-plugin.d.ts +4 -0
  26. package/dist/plugin-compatibility/feature-polyfill.d.ts +0 -4
  27. package/dist/plugin-compilation/env.d.ts +2 -5
  28. package/dist/plugin-css/css-lib/dead-url-refs.d.ts +0 -6
  29. package/dist/plugin-css/css-lib/inline-content-script-css.d.ts +0 -15
  30. package/dist/plugin-css/css-lib/resolve-css-asset.d.ts +0 -8
  31. package/dist/plugin-js-frameworks/js-frameworks-lib/messages.d.ts +1 -0
  32. package/dist/plugin-js-frameworks/js-tools/solid.d.ts +3 -0
  33. package/dist/plugin-js-frameworks/js-tools/typescript.d.ts +16 -0
  34. package/dist/plugin-perf-budgets/categorize.d.ts +2 -1
  35. package/dist/plugin-perf-budgets/index.d.ts +1 -22
  36. package/dist/plugin-playwright/index.d.ts +3 -2
  37. package/dist/plugin-reload/index.d.ts +1 -1
  38. package/dist/plugin-reload/reload-dispatch.d.ts +6 -3
  39. package/dist/plugin-reload/steps/setup-chunk-loading-target.d.ts +0 -13
  40. package/dist/plugin-special-folders/index.d.ts +0 -9
  41. package/dist/plugin-web-extension/feature-html/html-lib/utils.d.ts +0 -1
  42. package/dist/plugin-web-extension/feature-html/index.d.ts +0 -27
  43. package/dist/plugin-web-extension/feature-icons/index.d.ts +0 -12
  44. package/dist/plugin-web-extension/feature-json/index.d.ts +0 -9
  45. package/dist/plugin-web-extension/feature-locales/index.d.ts +0 -4
  46. package/dist/plugin-web-extension/feature-manifest/index.d.ts +0 -10
  47. package/dist/plugin-web-extension/feature-manifest/manifest-lib/filter-key-edge.d.ts +5 -0
  48. package/dist/plugin-web-extension/feature-manifest/manifest-lib/filter-keys-safari.d.ts +11 -0
  49. package/dist/plugin-web-extension/feature-manifest/manifest-lib/gecko-data-collection.d.ts +0 -12
  50. package/dist/plugin-web-extension/feature-manifest/manifest-lib/legacy-paths.d.ts +0 -13
  51. package/dist/plugin-web-extension/feature-manifest/manifest-lib/sanitize-fatal-shapes.d.ts +0 -36
  52. package/dist/plugin-web-extension/feature-manifest/messages.d.ts +20 -0
  53. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-injected-hosts.d.ts +0 -5
  54. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/emitted-evidence.d.ts +22 -0
  55. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-background.d.ts +9 -0
  56. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-web-resources.d.ts +7 -16
  57. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults.d.ts +6 -2
  58. package/dist/plugin-web-extension/feature-manifest/steps/patch-war.d.ts +0 -5
  59. package/dist/plugin-web-extension/feature-manifest/steps/patch-webkit-background.d.ts +2 -0
  60. package/dist/plugin-web-extension/feature-manifest/steps/update-manifest.d.ts +1 -0
  61. package/dist/plugin-web-extension/feature-manifest/steps/warn-gecko-unsupported-apis.d.ts +119 -26
  62. package/dist/plugin-web-extension/feature-scripts/index.d.ts +0 -10
  63. package/dist/plugin-web-extension/feature-scripts/messages.d.ts +5 -0
  64. package/dist/plugin-web-extension/feature-scripts/steps/native-geturl-import-loader.d.ts +0 -3
  65. package/dist/plugin-web-extension/feature-scripts/steps/warn-page-context-worker.d.ts +5 -0
  66. package/dist/plugin-web-extension/feature-web-resources/collect-entry-imports.d.ts +1 -0
  67. package/dist/plugin-web-extension/feature-web-resources/index.d.ts +0 -10
  68. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/clean-matches.d.ts +0 -6
  69. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/messages.d.ts +1 -0
  70. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/unreachable-resources.d.ts +9 -0
  71. package/dist/plugin-web-extension/shared/discover-devtools-panels.d.ts +0 -6
  72. package/dist/plugin-web-extension/shared/paths.d.ts +0 -1
  73. package/dist/rspack-config.d.ts +1 -1
  74. package/dist/rspack-config~0.mjs +1074 -574
  75. package/package.json +1 -1
  76. package/runtime/process-shim.cjs +2 -0
@@ -3,42 +3,6 @@ export interface FatalShapeFix {
3
3
  field: string;
4
4
  detail: string;
5
5
  }
6
- /**
7
- * Repair author-manifest shapes that make Chrome refuse to load the whole
8
- * extension. Loading via --load-extension surfaces the refusal as a native
9
- * modal dialog (no CDP, no console), so a dev session just wedges, the
10
- * browser never binds its debug endpoint. Both shapes below were found in
11
- * the wild and are unambiguous to fix:
12
- *
13
- * - `"name"` missing, empty, or not a string, Chrome refuses with
14
- * "Required value 'name' is missing or invalid" (verified live on Chrome
15
- * 150 via CDP loadUnpacked for all three shapes). Coerce scalars,
16
- * fall back to "Unnamed Extension".
17
- * - `"version"` missing entirely, Chrome refuses with "Required value
18
- * 'version' is missing or invalid" (wild: Ananyakk71/javscript). Inject
19
- * "0.0.0" so the session can attach.
20
- * - `"version": 1.0`, JSON authors write a number; Chrome requires a string
21
- * of 1-4 dot-separated integers. String() preserves the intent.
22
- * - `"version": "x.y.z"` (any string that is not 1-4 dot-separated integers
23
- * 0-65535), a placeholder the author never filled in; Chrome refuses the
24
- * whole extension over it. Salvage the numeric parts when there are any,
25
- * fall back to "0.0.0" otherwise.
26
- * - `"default_icon": ""` (in action/browser_action/page_action), an empty
27
- * icon path rejects the extension. Empty means "no icon": drop the key.
28
- * - An icon path (`icons`, `*_action.default_icon`) whose file exists but is
29
- * 0 bytes (wild: Speak2Type ships an empty icon-128.png), Chrome cannot
30
- * decode it and refuses the whole extension with "Could not load icon".
31
- * Requires `manifestDir` to resolve the paths; drop the entry.
32
- * - `'unsafe-inline'` in `content_security_policy.extension_pages`
33
- * script-src, Chrome refuses the whole extension with "Insecure CSP
34
- * value" (wild: zenwerk/tonikakuyare). MV3 never honors it, so stripping
35
- * it changes nothing but the refusal.
36
- * - A named (non-`_execute_*`) command whose `description` is missing,
37
- * empty, or not a string, Chrome refuses the whole extension with
38
- * "Invalid value for 'commands[N].description'" (seen live loading a
39
- * built extension). Fall back to the command name so the shortcut stays
40
- * registered and the session can attach.
41
- */
42
6
  export declare function sanitizeFatalManifestShapes(manifest: Manifest, manifestDir?: string): {
43
7
  manifest: Manifest;
44
8
  fixes: FatalShapeFix[];
@@ -13,6 +13,26 @@ export declare function manifestLegacyWarningsSummary(count: number): string;
13
13
  export declare function pageActionNotSupportedByBrowser(browser: string): string;
14
14
  export declare function pageActionDroppedForBrowserAction(browser: string): string;
15
15
  export declare function vendorPrefixedKeyDropped(key: string, familyKey: string, vendor: 'chrome' | 'edge', browser: string): string;
16
+ export declare function manifestVersionLostForBrowser(browser: string, prefixedKeys: string[], resolved: unknown): string;
17
+ export declare function edgeStoreKeyDropped(browser: string): string;
16
18
  export declare function mv2SandboxPolicyDropped(browser: string): string;
17
19
  export declare function geckoSidePanelUnsupported(file: string): string;
20
+ export declare function safariSidePanelUnsupported(file: string): string;
21
+ export declare function safariOffscreenUnsupported(file: string): string;
22
+ export declare function safariTabGroupsUnsupported(file: string): string;
23
+ export declare function safariManagementUnsupported(file: string): string;
24
+ export declare function safariUserScriptsUnsupported(file: string): string;
25
+ export declare function safariIdentityUnsupported(file: string): string;
26
+ export declare function safariNotificationsUnsupported(file: string): string;
27
+ export declare function safariOmniboxUnsupported(file: string): string;
28
+ export declare function safariBookmarksUnsupported(file: string): string;
29
+ export declare function safariHistoryUnsupported(file: string): string;
30
+ export declare function safariDownloadsUnsupported(file: string): string;
31
+ export declare function safariIdleUnsupported(file: string): string;
32
+ export declare const safariMissingMemberDetails: Record<string, string>;
33
+ export declare function safariMemberUnsupported(file: string, api: string, member: string, kind: 'call' | 'read'): string;
18
34
  export declare function geckoActionUnsupportedOnMv2(file: string): string;
35
+ export declare function webkitUnsupportedKeysDropped(browser: string, dropped: Array<{
36
+ path: string;
37
+ reason: string;
38
+ }>): string;
@@ -16,10 +16,5 @@ interface ScannableModule {
16
16
  }
17
17
  export declare function isContentScriptModule(module: ScannableModule): boolean;
18
18
  export declare function findAbsoluteRequestUrls(source: string): string[];
19
- /**
20
- * Finds absolute request URLs whose host is granted only because dev unioned
21
- * the content-script matches into the manifest. Content-script modules are
22
- * skipped: their requests answer to page CORS rather than host permissions.
23
- */
24
19
  export declare function findInjectedOnlyHostUses(modules: Iterable<ScannableModule>, injected: readonly string[], declared: readonly string[], optional: readonly string[]): InjectedOnlyHostUse[];
25
20
  export {};
@@ -0,0 +1,22 @@
1
+ export interface EmittedModule {
2
+ resource?: string;
3
+ modules?: Iterable<EmittedModule>;
4
+ }
5
+ export interface EmittedChunk {
6
+ files?: Iterable<string>;
7
+ }
8
+ export interface EmittedCompilation {
9
+ getAssets?: () => readonly {
10
+ name: string;
11
+ source: {
12
+ source(): string | Buffer;
13
+ };
14
+ }[];
15
+ chunkGraph?: {
16
+ getModuleChunksIterable(module: EmittedModule): Iterable<EmittedChunk>;
17
+ };
18
+ }
19
+ export declare function shippableText(text: string): string;
20
+ export declare function readEmittedScripts(compilation: EmittedCompilation): Map<string, string>;
21
+ export declare function readProjectSource(resource: string): string | undefined;
22
+ export declare function emittedFilesOf(compilation: EmittedCompilation, module: EmittedModule): string[] | undefined;
@@ -1,5 +1,14 @@
1
1
  import type { DevOptions, Manifest } from '../../../../types.js';
2
2
  export default function patchBackground(manifest: Manifest, browser: DevOptions['browser']): {
3
+ background: ({
4
+ scripts?: string[] | undefined;
5
+ page?: string | undefined;
6
+ persistent?: boolean | undefined;
7
+ } & {
8
+ service_worker: string;
9
+ type?: "module";
10
+ }) | undefined;
11
+ } | {
3
12
  background: {
4
13
  scripts?: string[] | undefined;
5
14
  page?: string | undefined;
@@ -1,19 +1,10 @@
1
1
  import type { Manifest } from '../../../../types.js';
2
+ export declare const DEV_RUNTIME_RESOURCES: string[];
2
3
  declare function patchWebResourcesV2(manifest: Manifest): string[];
3
- declare function patchWebResourcesV3(manifest: Manifest): ({
4
- resources: string[];
5
- matches: string[];
6
- } | (string & {
7
- resources: string[];
8
- use_dynamic_url?: boolean | undefined;
9
- } & {
10
- extension_ids: string[];
11
- matches?: string[] | undefined;
12
- }) | (string & {
13
- resources: string[];
14
- use_dynamic_url?: boolean | undefined;
15
- } & {
16
- matches: string[];
17
- extension_ids?: string[] | undefined;
18
- }))[];
4
+ declare function patchWebResourcesV3(manifest: Manifest): unknown[];
5
+ export declare function patchWebResources(manifest: Manifest): {
6
+ web_accessible_resources?: undefined;
7
+ } | {
8
+ web_accessible_resources: Manifest['web_accessible_resources'];
9
+ };
19
10
  export { patchWebResourcesV2, patchWebResourcesV3 };
@@ -1,6 +1,10 @@
1
- import { Compilation, type Compiler } from '@rspack/core';
1
+ import { type Compiler } from '@rspack/core';
2
2
  import type { PluginInterface } from '../../../types.js';
3
- export declare function findInjectedOnlyPermissionUses(compilation: Pick<Compilation, 'modules'>, declared: Set<string>, injected: readonly string[]): Map<string, string>;
3
+ import { type EmittedCompilation, type EmittedModule } from './apply-dev-defaults-lib/emitted-evidence.js';
4
+ export interface PermissionScanCompilation extends EmittedCompilation {
5
+ modules: Iterable<EmittedModule>;
6
+ }
7
+ export declare function findInjectedOnlyPermissionUses(compilation: PermissionScanCompilation, declared: Set<string>, injected: readonly string[]): Map<string, string>;
4
8
  export declare class ApplyDevDefaults {
5
9
  private readonly manifestPath?;
6
10
  private readonly browser;
@@ -1,10 +1,5 @@
1
1
  import { type Compiler } from '@rspack/core';
2
2
  import type { DevOptions, PluginInterface } from '../../../types.js';
3
- /**
4
- * Patches manifest.json with web_accessible_resources from content script
5
- * imports. Depends on CollectContentEntryImports (feature-web-resources)
6
- * populating getSharedFor(compilation).entryImports before this runs.
7
- */
8
3
  export declare class PatchWAR {
9
4
  readonly manifestPath: string;
10
5
  readonly browser?: DevOptions['browser'];
@@ -0,0 +1,2 @@
1
+ import type { DevOptions, Manifest } from '../../../types.js';
2
+ export declare function patchWebkitBackground(manifest: Manifest, browser: DevOptions['browser']): Manifest;
@@ -4,6 +4,7 @@ export declare class UpdateManifest {
4
4
  readonly manifestPath: string;
5
5
  readonly browser: DevOptions['browser'];
6
6
  private reportedFatalFixes;
7
+ private reportedUnsupportedApis;
7
8
  constructor(options: PluginInterface);
8
9
  private applyDevOverrides;
9
10
  apply(compiler: Compiler): void;
@@ -1,40 +1,133 @@
1
1
  import { type Compilation, type Compiler } from '@rspack/core';
2
2
  import type { DevOptions, Manifest } from '../../../types.js';
3
- export type GeckoUnsupportedApi = 'sidePanel' | 'action';
3
+ import * as messages from '../messages.js';
4
+ import { type EmittedCompilation } from './apply-dev-defaults-lib/emitted-evidence.js';
5
+ declare const webkitUnsupportedApis: {
6
+ readonly sidePanel: typeof messages.safariSidePanelUnsupported;
7
+ readonly offscreen: typeof messages.safariOffscreenUnsupported;
8
+ readonly tabGroups: typeof messages.safariTabGroupsUnsupported;
9
+ readonly management: typeof messages.safariManagementUnsupported;
10
+ readonly userScripts: typeof messages.safariUserScriptsUnsupported;
11
+ readonly identity: typeof messages.safariIdentityUnsupported;
12
+ readonly notifications: typeof messages.safariNotificationsUnsupported;
13
+ readonly omnibox: typeof messages.safariOmniboxUnsupported;
14
+ readonly bookmarks: typeof messages.safariBookmarksUnsupported;
15
+ readonly history: typeof messages.safariHistoryUnsupported;
16
+ readonly downloads: typeof messages.safariDownloadsUnsupported;
17
+ readonly idle: typeof messages.safariIdleUnsupported;
18
+ };
19
+ type WebkitUnsupportedApi = keyof typeof webkitUnsupportedApis;
20
+ export type GeckoUnsupportedApi = WebkitUnsupportedApi | 'action';
21
+ export interface WebkitUnsupportedMember {
22
+ api: string;
23
+ member: string;
24
+ kind: 'call' | 'read';
25
+ }
26
+ export declare const webkitUnsupportedMembers: readonly [{
27
+ readonly api: 'action';
28
+ readonly member: 'getUserSettings';
29
+ readonly kind: 'call';
30
+ }, {
31
+ readonly api: 'action';
32
+ readonly member: 'getBadgeTextColor';
33
+ readonly kind: 'call';
34
+ }, {
35
+ readonly api: 'action';
36
+ readonly member: 'setBadgeTextColor';
37
+ readonly kind: 'call';
38
+ }, {
39
+ readonly api: 'action';
40
+ readonly member: 'onUserSettingsChanged';
41
+ readonly kind: 'read';
42
+ }, {
43
+ readonly api: 'storage';
44
+ readonly member: 'managed';
45
+ readonly kind: 'read';
46
+ }, {
47
+ readonly api: 'runtime';
48
+ readonly member: 'getContexts';
49
+ readonly kind: 'call';
50
+ }, {
51
+ readonly api: 'runtime';
52
+ readonly member: 'onSuspend';
53
+ readonly kind: 'read';
54
+ }, {
55
+ readonly api: 'runtime';
56
+ readonly member: 'onSuspendCanceled';
57
+ readonly kind: 'read';
58
+ }, {
59
+ readonly api: 'runtime';
60
+ readonly member: 'onUpdateAvailable';
61
+ readonly kind: 'read';
62
+ }, {
63
+ readonly api: 'declarativeNetRequest';
64
+ readonly member: 'getAvailableStaticRuleCount';
65
+ readonly kind: 'call';
66
+ }, {
67
+ readonly api: 'declarativeNetRequest';
68
+ readonly member: 'getDisabledRuleIds';
69
+ readonly kind: 'call';
70
+ }, {
71
+ readonly api: 'declarativeNetRequest';
72
+ readonly member: 'updateStaticRules';
73
+ readonly kind: 'call';
74
+ }, {
75
+ readonly api: 'declarativeNetRequest';
76
+ readonly member: 'testMatchOutcome';
77
+ readonly kind: 'call';
78
+ }, {
79
+ readonly api: 'declarativeNetRequest';
80
+ readonly member: 'onRuleMatchedDebug';
81
+ readonly kind: 'read';
82
+ }, {
83
+ readonly api: 'tabs';
84
+ readonly member: 'group';
85
+ readonly kind: 'call';
86
+ }, {
87
+ readonly api: 'tabs';
88
+ readonly member: 'ungroup';
89
+ readonly kind: 'call';
90
+ }, {
91
+ readonly api: 'webNavigation';
92
+ readonly member: 'onCreatedNavigationTarget';
93
+ readonly kind: 'read';
94
+ }, {
95
+ readonly api: 'webNavigation';
96
+ readonly member: 'onHistoryStateUpdated';
97
+ readonly kind: 'read';
98
+ }, {
99
+ readonly api: 'webNavigation';
100
+ readonly member: 'onReferenceFragmentUpdated';
101
+ readonly kind: 'read';
102
+ }, {
103
+ readonly api: 'webNavigation';
104
+ readonly member: 'onTabReplaced';
105
+ readonly kind: 'read';
106
+ }, {
107
+ readonly api: 'windows';
108
+ readonly member: 'onBoundsChanged';
109
+ readonly kind: 'read';
110
+ }];
111
+ export type WebkitMemberApi = (typeof webkitUnsupportedMembers)[number]['api'];
112
+ export type UnsupportedApiName = GeckoUnsupportedApi | WebkitMemberApi;
113
+ export type UnsupportedApiEngine = 'gecko' | 'webkit';
4
114
  export interface GeckoUnsupportedApiUse {
5
- api: GeckoUnsupportedApi;
115
+ api: UnsupportedApiName;
116
+ member?: string;
6
117
  file: string;
7
118
  emitted: boolean;
8
119
  }
9
- export declare function geckoUnsupportedApis(manifestVersion: unknown): GeckoUnsupportedApi[];
10
- export declare function usesGeckoUnsupportedApi(source: string, api: GeckoUnsupportedApi): boolean;
120
+ export declare function geckoUnsupportedApis(manifestVersion: unknown, engine?: UnsupportedApiEngine): GeckoUnsupportedApi[];
121
+ export declare function usesGeckoUnsupportedApi(source: string, api: GeckoUnsupportedApi, engine?: UnsupportedApiEngine): boolean;
122
+ export declare function usesWebkitUnsupportedMember(source: string, entry: WebkitUnsupportedMember): boolean;
11
123
  interface ScannableModule {
12
124
  resource?: string;
13
125
  modules?: Iterable<ScannableModule>;
14
126
  rootModule?: ScannableModule;
15
127
  }
16
- interface ScannableChunk {
17
- files?: Iterable<string>;
18
- }
19
- export interface ScannableCompilation {
128
+ export interface ScannableCompilation extends EmittedCompilation {
20
129
  modules: Iterable<ScannableModule>;
21
- getAssets?: () => readonly {
22
- name: string;
23
- source: {
24
- source(): string | Buffer;
25
- };
26
- }[];
27
- chunkGraph?: {
28
- getModuleChunksIterable(module: ScannableModule): Iterable<ScannableChunk>;
29
- };
30
130
  }
31
- /**
32
- * Finds project source that reads a Chromium-only API and still ships in the
33
- * built Gecko bundle. The source scan names the file, the emitted-asset check
34
- * clears a call the bundler compiled out behind a build-time browser branch,
35
- * and an emitted script nobody explains is reported under its own name so
36
- * nothing addons-linter would flag goes unmentioned.
37
- */
38
- export declare function findGeckoUnsupportedApiUses(compilation: ScannableCompilation, manifestVersion: unknown): GeckoUnsupportedApiUse[];
39
- export declare function reportGeckoUnsupportedApis(compilation: Compilation, compiler: Compiler, browser: DevOptions['browser'], manifest: Manifest, projectPath: string): void;
131
+ export declare function findGeckoUnsupportedApiUses(compilation: ScannableCompilation, manifestVersion: unknown, engine?: UnsupportedApiEngine, requireEmittedEvidence?: boolean): GeckoUnsupportedApiUse[];
132
+ export declare function reportGeckoUnsupportedApis(compilation: Compilation, compiler: Compiler, browser: DevOptions['browser'], manifest: Manifest, projectPath: string, reported?: Set<string>): void;
40
133
  export {};
@@ -1,15 +1,5 @@
1
1
  import type { Compiler } from '@rspack/core';
2
2
  import type { DevOptions, FilepathList, PluginInterface } from '../../types.js';
3
- /**
4
- * Feature-scripts is the official scripts pipeline:
5
- * - content scripts use the inline lifecycle runtime only
6
- * - targeted reinjection stays browser-owned
7
- * - background/manifest changes stay on the full-reload path
8
- *
9
- * The dev-only reload/HMR strategy is NOT part of this feature. It lives
10
- * in plugin-reload, which registers after this plugin and decorates the
11
- * entries AddScripts declares here.
12
- */
13
3
  export declare class ScriptsPlugin {
14
4
  readonly manifestPath: string;
15
5
  readonly includeList?: FilepathList;
@@ -20,6 +20,11 @@ declare const SPLIT_ENTRY_SURFACES: {
20
20
  };
21
21
  };
22
22
  export declare function entrySplitAcrossInitialFiles(entryName: string, surface: keyof typeof SPLIT_ENTRY_SURFACES, ownFile: string, extraFiles: string[]): string;
23
+ declare const PAGE_CONTEXT_SURFACES: {
24
+ readonly content_script: 'a content script';
25
+ readonly script: 'an injected script';
26
+ };
27
+ export declare function workerStartedFromPageContext(assetName: string, surface: keyof typeof PAGE_CONTEXT_SURFACES): string;
23
28
  export declare function fetchedFileDependencyMissing(assetName: string, literal: string, expectedPath: string): string;
24
29
  export declare function getURLDependencyMissing(assetName: string, literal: string, expectedPath: string): string;
25
30
  export declare function runtimeSetSurfaceDependencyMissing(assetName: string, literal: string, expectedPath: string): string;
@@ -1,7 +1,4 @@
1
1
  export declare function annotateGetURLDynamicImports(source: string): string;
2
- /** Loader entry: source-to-source, before the swc transform. The map that
3
- * arrived travels on: the annotation adds a comment inside a line, never a
4
- * line, so the line map of the loader before this one still holds. */
5
2
  export default function nativeGetURLImportLoader(this: {
6
3
  callback?: (error: Error | null, content: string, map?: unknown) => void;
7
4
  resourcePath?: string;
@@ -0,0 +1,5 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ export declare function startsWorkerFromExtensionUrl(source: string): boolean;
3
+ export declare class WarnPageContextWorker {
4
+ apply(compiler: Compiler): void;
5
+ }
@@ -6,4 +6,5 @@ export declare const EMITTED_ASSET_REF_PATTERN: RegExp;
6
6
  export declare function listEmittedAssetNames(compilation: Compilation): string[];
7
7
  export declare function collectReferencedRuntimePayloads(source: string, emittedAssetNames: string[]): string[];
8
8
  export declare function collectContentScriptAsyncChunkFiles(compilation: Compilation): Record<string, string[]>;
9
+ export declare function collectPageContextEntryFiles(compilation: Compilation): Record<string, string[]>;
9
10
  export declare function collectContentScriptEntryImports(compilation: Compilation, includeList?: FilepathList): Record<string, string[]>;
@@ -1,15 +1,5 @@
1
1
  import type { Compiler } from '@rspack/core';
2
2
  import type { FilepathList, PluginInterface } from '../../types.js';
3
- /**
4
- * ResourcesPlugin collects content script imports for manifest WAR patching.
5
- * Actual manifest patching is done by ManifestPlugin (PatchWAR step) so all
6
- * manifest writes stay consolidated in feature-manifest.
7
- *
8
- * Feature supported:
9
- *
10
- * - Collects assets imported from content_scripts files.
11
- * - WAR patching uses this data (via getSharedFor) in manifest:patch-war.
12
- */
13
3
  export declare class WebResourcesPlugin {
14
4
  readonly manifestPath: string;
15
5
  readonly includeList?: FilepathList;
@@ -1,7 +1 @@
1
- /**
2
- * From the docs at https://developer.chrome.com/docs/extensions/reference/manifest/web-accessible-resources#manifest_declaration
3
- * > Google Chrome emits an "Invalid match pattern" error if the pattern has a path other than '/*'.
4
- *
5
- * We need to ensure that paths are cleaned up from the matches to avoid this error.
6
- */
7
1
  export declare function cleanMatches(matches: string[]): string[];
@@ -6,5 +6,6 @@ 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 warUnreachableResource(resource: string, entryName: string): string;
9
10
  export declare function entryImportsSummary(entryCount: number, totalResources: number): string;
10
11
  export declare function warPatchedSummary(v3Groups: number, v3ResourcesTotal: number, v2Resources: number): string;
@@ -0,0 +1,9 @@
1
+ export declare function normalizeResourcePath(value: string): string;
2
+ export declare function isResourceCovered(declared: readonly string[], candidate: string): boolean;
3
+ export declare const GET_URL_LITERAL_PATTERN: RegExp;
4
+ export declare function collectGetUrlLiterals(source: string): string[];
5
+ export declare function findUnreachableRuntimeResources(options: {
6
+ source: string;
7
+ emittedAssetNames: readonly string[];
8
+ declaredResources: readonly string[];
9
+ }): string[];
@@ -1,8 +1,2 @@
1
1
  import type { DevOptions, FilepathList } from '../../types.js';
2
- /**
3
- * Statically discovers HTML pages referenced only through
4
- * chrome.devtools.panels.create in the devtools page's scripts, and returns
5
- * them as extra HTML entries keyed by their extension-root-relative path so
6
- * the emitted dist serves the exact URL Chrome will request.
7
- */
8
2
  export declare function discoverDevtoolsPanelPages(manifestPath: string, browser?: DevOptions['browser']): FilepathList;
@@ -3,6 +3,5 @@ export declare function isFromFilepathList(filePath: string, filepathList?: File
3
3
  export declare function getFilename(feature: string, filePath: string): string;
4
4
  export declare function unixify(filePath: string): string;
5
5
  export declare function resolveRootAbsoluteRef(ref: string, projectRoot: string, publicRoot?: string): string | undefined;
6
- /** Root-absolute refs in HTML (`src`/`href`) and CSS (`url(...)`). */
7
6
  export declare function collectRootAbsoluteRefs(source: string): Set<string>;
8
7
  export declare function isManifestAddress(value: unknown): boolean;
@@ -1,4 +1,4 @@
1
- import type { Configuration } from '@rspack/core';
1
+ import { type Configuration } from '@rspack/core';
2
2
  import type { ProjectStructure } from './lib/project.js';
3
3
  import type { WebpackConfigOptions } from './types.js';
4
4
  export default function webpackConfig(projectStructure: ProjectStructure, devOptions: WebpackConfigOptions): Configuration;