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
@@ -1,10 +1,3 @@
1
1
  import { type AbsolutePath } from './paths.js';
2
- /**
3
- * Install the user's project dependencies if node_modules is missing or stale.
4
- * This runs `npm install` (or pnpm/yarn/bun) in the project directory so that
5
- * user-declared dependencies (sass, vue, react, etc.) are available to the
6
- * bundler. Without this, `pnpm dlx extension build` in a clean directory would
7
- * fail to resolve project dependencies.
8
- */
9
2
  export declare function ensureUserProjectDependencies(packageJsonDir: AbsolutePath): Promise<void>;
10
3
  export declare function ensureDevelopArtifacts(): Promise<void>;
@@ -1,6 +1 @@
1
- /**
2
- * True when `packageName` is declared by the project's manifest: package.json
3
- * dependency fields (dependencies, devDependencies, optionalDependencies,
4
- * peerDependencies) or a deno.json(c) `npm:` import.
5
- */
6
1
  export declare function hasDependency(projectPath: string, packageName: string): boolean;
@@ -8,5 +8,7 @@ export interface DroppedVendorKey {
8
8
  appliedBefore: boolean;
9
9
  }
10
10
  export declare function findDroppedVendorKeys(manifest: Manifest, browser: DevOptions['browser']): DroppedVendorKey[];
11
+ export declare function isValidManifestVersion(value: unknown): value is 2 | 3;
12
+ export declare function findPrefixedManifestVersionKeys(manifest: Manifest): string[];
11
13
  export declare function isStaticTheme(manifest: Manifest | undefined | null): boolean;
12
14
  export declare function isStaticThemeSource(manifestPath: string | undefined, browser: DevOptions['browser'] | string | undefined): boolean;
@@ -1,7 +1,3 @@
1
- /**
2
- * Stock defaults for `extension dev`. Applied only when neither
3
- * extension.config.js nor an explicit CLI flag set the option.
4
- */
5
1
  export declare const DEV_COMMAND_DEFAULTS: {
6
2
  polyfill: boolean;
7
3
  logFormat: 'pretty';
@@ -10,9 +6,6 @@ export declare const DEV_COMMAND_DEFAULTS: {
10
6
  logLevel: 'off';
11
7
  noOpen: boolean;
12
8
  };
13
- /**
14
- * Stock defaults for `extension build`. Zip and silent stay off unless set.
15
- */
16
9
  export declare const BUILD_COMMAND_DEFAULTS: {
17
10
  polyfill: boolean;
18
11
  zip: boolean;
@@ -20,50 +13,17 @@ export declare const BUILD_COMMAND_DEFAULTS: {
20
13
  silent: boolean;
21
14
  addonLint: boolean;
22
15
  };
23
- /**
24
- * Stock defaults for the `extension start` / `extension preview` browser
25
- * phase. Same logger defaults dev uses.
26
- */
27
16
  export declare const SERVE_COMMAND_DEFAULTS: {
28
17
  logFormat: 'pretty';
29
18
  logTimestamps: boolean;
30
19
  logColor: boolean;
31
20
  logLevel: 'off';
32
21
  };
33
- /**
34
- * Stock defaults for the silent production build `extension start` runs
35
- * before its preview phase. Polyfill defaults on, matching start's
36
- * historical behavior.
37
- */
38
22
  export declare const START_BUILD_DEFAULTS: {
39
23
  polyfill: boolean;
40
24
  silent: boolean;
41
25
  addonLint: boolean;
42
26
  };
43
- /**
44
- * Array-valued option keys that concatenate across layers (browser config,
45
- * then command config, then CLI). Order is preserved and duplicates are
46
- * dropped, keeping the first occurrence, so repeating a flag in a later
47
- * layer never doubles it on the browser command line.
48
- */
49
27
  export declare const CONCAT_ARRAY_KEYS: Set<string>;
50
- /**
51
- * Plain-object option keys that deep-merge across layers. Later layers win
52
- * on key conflict and nested plain objects recurse.
53
- */
54
28
  export declare const DEEP_MERGE_OBJECT_KEYS: Set<string>;
55
- /**
56
- * Layered option merge with one predictable precedence for every command:
57
- * stock defaults, then browser config, then command config, then CLI.
58
- *
59
- * Per-value strategy:
60
- * - Scalars (and most keys): the last defined layer wins, including `false`.
61
- * - List keys (`browserFlags`, `excludeBrowserFlags`): concatenate in layer
62
- * order and dedupe, so CLI adds to config rather than replacing it.
63
- * - Object keys (`preferences`): deep-merge, later layers win on conflict.
64
- *
65
- * `undefined` values are stripped per layer (via {@link sanitize}) so an
66
- * unset CLI flag never clobbers extension.config.js, and config never
67
- * clobbers a flag the user actually typed (including `false`).
68
- */
69
29
  export declare function mergeOptionLayers<T extends object>(defaults: Partial<T>, ...layers: Array<object | null | undefined>): T;
@@ -19,9 +19,10 @@ export declare function projectInstallFallbackToNpm(pmName: string): string;
19
19
  export declare function projectInstallScriptsDisabled(pmName: string): string;
20
20
  export declare function anotherDevSessionActive(browser: string, pid: number, runId: string): string;
21
21
  export declare function buildAssetsTree(stats: Stats | undefined): string;
22
- export declare function buildComplete(browser: DevOptions['browser'], distDisplayPath: string, totalBytes?: number): string;
22
+ export declare function buildComplete(browser: DevOptions['browser'], distDisplayPath: string, totalBytes?: number, mode?: 'development' | 'production' | 'none'): string;
23
23
  export declare function addonLintSummary(errorCount: number, warningCount: number, distDisplay: string): string;
24
- export declare function addonLintFinding(level: 'error' | 'warning', code: string, message: string, location: string): string;
24
+ export declare function addonLintFinding(level: 'error' | 'warning', code: string, message: string, location: string, attribution?: string): string;
25
+ export declare function addonLintDependencyAttribution(packages: string[], onlyDependencies: boolean): string;
25
26
  export declare function addonLintMore(hiddenCount: number, distDisplay: string): string;
26
27
  export declare function addonLintNotInstalled(installHint: string): string;
27
28
  export declare function addonLintFailed(reason: string): string;
@@ -41,8 +42,7 @@ type LooseBuildWarning = string | null | undefined | {
41
42
  chunkName?: unknown;
42
43
  };
43
44
  export declare function buildWarningsDetails(warnings: LooseBuildWarning[]): string;
44
- export declare function fetchingProjectPath(owner: string, project: string): string;
45
- export declare function downloadingProjectPath(projectName: string): string;
45
+ export declare function downloadingProjectPath(projectName: string, url: string): string;
46
46
  export declare function creatingProjectPath(): string;
47
47
  export declare function downloadedProjectFolderNotFound(cwd: string, candidates: string[]): string;
48
48
  export declare function packagingSourceFiles(zipPath: string): string;
@@ -1,3 +1,4 @@
1
+ import { type ChildProcess } from 'node:child_process';
1
2
  import { buildExecEnv } from 'prefers-yarn';
2
3
  export { buildExecEnv };
3
4
  import type { SUPPORTED_PACKAGE_MANAGERS } from './constants.js';
@@ -43,4 +44,5 @@ export declare function buildSpawnInvocation(command: string, args: string[]): {
43
44
  command: string;
44
45
  args: string[];
45
46
  };
47
+ export declare function spawnInstallCommand(command: string, args: string[], options?: ExecOptions): ChildProcess;
46
48
  export declare function execInstallCommand(command: string, args: string[], options?: ExecOptions): Promise<void>;
@@ -14,5 +14,4 @@ export declare function hasProjectDependency(projectDir: string, packageName: st
14
14
  export declare function findNearestProjectManifestDirSync(startPath: string, maxDepth?: number): string | undefined;
15
15
  export declare function findNearestProjectManifestSync(manifestPath: string): string | null;
16
16
  export declare function findNearestDenoConfigSync(manifestPath: string): string | null;
17
- /** True when the file exists and parses as JSONC. */
18
17
  export declare function validateDenoConfig(denoConfigPath: string): boolean;
@@ -1,29 +1,7 @@
1
- /**
2
- * THE owner of every on-disk session-state path. Dev sessions are
3
- * per project+browser, so every artifact here must embed the browser key,
4
- * a per-project single slot gets clobbered the moment a second browser
5
- * session starts on the same project (the control.token defect: session B's
6
- * start overwrote session A's eval token, and either shutdown deleted it
7
- * for both). New artifacts MUST be registered in SESSION_ARTIFACTS; the
8
- * layout spec fails any per-project shape that isn't an explicitly
9
- * allowlisted legacy slot, and a repo-scan spec fails path joins that
10
- * bypass this module.
11
- *
12
- * Two roots with different lifetimes:
13
- * - `<project>/.extension-js/` survives dist wipes. Anything a browser
14
- * profile may have baked in (ports, tokens) lives here. A profile can
15
- * outlive dist/, and state that dies with dist strands the profile's
16
- * cached service worker (issue #484).
17
- * - `<project>/dist/extension-js/<browser>/` dies with dist. Machine
18
- * contracts and logs that describe the CURRENT session only.
19
- */
20
1
  export declare function sessionStateDir(projectPath: string): string;
21
2
  export declare function controlPortFilePath(projectPath: string, browser: string): string;
22
- /** Pre-#484 location: died with dist/ while profiles outlived it. Read-only
23
- * fallback so a 4.0.6-era profile's cached SW can still resync. */
24
3
  export declare function legacyControlPortFilePath(projectPath: string, browser: string): string;
25
4
  export declare function controlTokenPath(projectPath: string, browser: string): string;
26
- /** Pre-fix single-slot token shared by every browser session of a project. */
27
5
  export declare function legacyControlTokenPath(projectPath: string): string;
28
6
  export declare function sessionArtifactsRootDir(projectPath: string): string;
29
7
  export declare const SESSION_ARTIFACTS_IGNORE_CONTENT: string;
@@ -127,13 +127,6 @@ export declare class BrowsersPlugin implements RunnerPlugin {
127
127
  */
128
128
  setReloadBroker(broker: ReloadBroker): void;
129
129
  setLogSink(sink: BrowserLogSink): void;
130
- /**
131
- * Re-offer the dist to a browser that refused it at launch. Returns true
132
- * when the browser has now accepted it, so the caller skips the reload.
133
- *
134
- * Only ever runs while the session is refused: re-asking a healthy browser
135
- * would restart the guest and destroy its HMR state.
136
- */
137
130
  private retryRefusedExtensionLoad;
138
131
  apply(compiler: Compiler): void;
139
132
  }
@@ -1,6 +1,8 @@
1
1
  import type { Compiler } from '@rspack/core';
2
+ import { type ReloadBroker, type ReloadInstruction } from '../plugin-reload/index.js';
2
3
  import { BuildEmitter, type RunnerPlugin } from './index.js';
3
4
  export type SafariPackagerFn = (distPath: string, mode: 'full' | 'resync') => Promise<unknown>;
5
+ export declare function reloadSurvivingPackage(instruction: ReloadInstruction | undefined): ReloadInstruction | undefined;
4
6
  export declare class SafariDevPlugin implements RunnerPlugin {
5
7
  private readonly packager;
6
8
  static readonly name = "safari-dev";
@@ -10,7 +12,9 @@ export declare class SafariDevPlugin implements RunnerPlugin {
10
12
  private active;
11
13
  private pending;
12
14
  private idleWaiters;
15
+ private reloadBroker;
13
16
  constructor(packager: SafariPackagerFn);
17
+ setReloadBroker(broker: ReloadBroker): void;
14
18
  apply(compiler: Compiler): void;
15
19
  idle(): Promise<void>;
16
20
  private drain;
@@ -1,9 +1,5 @@
1
1
  import { type Compiler } from '@rspack/core';
2
2
  import type { DevOptions, PluginInterface } from '../types.js';
3
- /**
4
- * PolyfillPlugin is responsible for providing the `browser`
5
- * global variable to the extension's codebase.
6
- */
7
3
  export declare class PolyfillPlugin {
8
4
  readonly browser: DevOptions['browser'];
9
5
  constructor(options: PluginInterface);
@@ -1,6 +1,8 @@
1
1
  import { type Compiler } from '@rspack/core';
2
2
  import type { DevOptions, PluginInterface } from '../types.js';
3
3
  export declare const IMPORT_META_URL_RUNTIME = "(function(){var h=typeof document!==\"undefined\"&&document.baseURI||self.location.href;try{var g=globalThis,r=(g.browser||g.chrome).runtime.getURL(\"/\");return h.indexOf(r)===0?h:r}catch(_){return h}})()";
4
+ export declare function importMetaUrlForEmitPath(emitPath: string): string;
5
+ export declare function toJsStringLiteral(value: string): string;
4
6
  export declare function getEnvFileCandidates(browser: DevOptions['browser'], mode: string): string[];
5
7
  export declare class EnvPlugin {
6
8
  readonly browser: DevOptions['browser'];
@@ -8,9 +10,4 @@ export declare class EnvPlugin {
8
10
  constructor(options: Partial<PluginInterface>);
9
11
  apply(compiler: Compiler): void;
10
12
  }
11
- /**
12
- * Env values available to `$EXTENSION_*` placeholders in emitted .json/.html.
13
- * Mirrors DefinePlugin: dotenv/process values plus the per-build-target
14
- * browser and mode synthetics JS already reads via import.meta.env.
15
- */
16
13
  export declare function buildTemplateVars(combinedVars: Record<string, unknown>, browser: DevOptions['browser'], mode: string): Record<string, string>;
@@ -3,12 +3,6 @@ export interface DeadUrlRefContext {
3
3
  issuerDir: string;
4
4
  roots: string[];
5
5
  }
6
- /** True when the reference names no file under the issuer or any project root. */
7
6
  export declare function isDeadCssUrlRef(rawRequest: string, { issuerDir, roots }: DeadUrlRefContext): boolean;
8
- /**
9
- * Rewrites url() targets in place. The replacer returns the new target, or
10
- * undefined to keep the reference exactly as authored.
11
- */
12
7
  export declare function replaceCssUrlRefs(source: string, replacer: (request: string) => string | undefined): string;
13
- /** Every url() target in a stylesheet, in source order, duplicates collapsed. */
14
8
  export declare function extractCssUrlRefs(source: string): string[];
@@ -10,23 +10,8 @@ export interface RewriteInlinedCssUrlsContext {
10
10
  manifestDir: string;
11
11
  publicRoot: string;
12
12
  }
13
- /**
14
- * Every relative or root-absolute url() that names a real file is rewritten
15
- * to `<placeholder><output name><query/hash>` and reported so the caller can
16
- * emit it. A file public/ owns keeps the name the public copier gives it at
17
- * the dist root. Remote, data:, fragment-only, protocol-relative and already
18
- * absolute references stay as authored, and so does a reference to a file
19
- * that does not exist (the dead-reference scan reports those).
20
- */
21
13
  export declare function rewriteInlinedCssUrls(source: string, context: RewriteInlinedCssUrlsContext): {
22
14
  css: string;
23
15
  targets: InlinedCssUrlTarget[];
24
16
  };
25
- /**
26
- * The JavaScript module a content script gets for an inlined stylesheet: a
27
- * CommonJS export of a data: URL, so `import sheet from './x.css'` and
28
- * `new URL('./x.css', import.meta.url)` both keep working as they did when
29
- * rspack inlined the file itself. The placeholder becomes the extension root
30
- * when the module evaluates, which is after the runtime API exists.
31
- */
32
17
  export declare function toRuntimeStylesheetModule(css: string): string;
@@ -3,12 +3,4 @@ export interface CssAssetResult {
3
3
  found: boolean;
4
4
  href: string | undefined;
5
5
  }
6
- /**
7
- * Resolves the CSS asset emitted for a given entry feature.
8
- *
9
- * First tries the canonical name (`<feature>.css`). If that misses,
10
- * which can happen when rspack's native CSS (`experiments.css`) splits
11
- * the stylesheet into a chunk whose name differs from the entry, it
12
- * falls back to inspecting the entrypoint's actual chunk files.
13
- */
14
6
  export declare function resolveCssAsset(compilation: Compilation, feature: string): CssAssetResult;
@@ -1,6 +1,7 @@
1
1
  export declare function installingRootDependencies(integration: string): string;
2
2
  export declare function integrationInstalledSuccessfully(integration: string): string;
3
3
  export declare function isUsingIntegration(name: string): string;
4
+ export declare function solidIsNotSupported(): string;
4
5
  export declare function youAreAllSet(name: string): string;
5
6
  export declare function creatingTSConfig(): string;
6
7
  export declare function failedToInstallIntegration(integration: string, error: unknown): string;
@@ -1,3 +1,6 @@
1
1
  import type { JsFramework } from '../../types.js';
2
2
  export declare function isUsingSolid(projectPath: string): boolean;
3
+ type ResolveFromProject = (id: string) => string | undefined;
4
+ export declare function resolveSolidHyperscript(resolveFromProject: ResolveFromProject): string | undefined;
3
5
  export declare function maybeUseSolid(projectPath: string): Promise<JsFramework | undefined>;
6
+ export {};
@@ -3,6 +3,22 @@ export declare function isUsingTypeScript(projectPath: string): boolean;
3
3
  export declare function ensureTypeScriptConfig(projectPath: string): void;
4
4
  export declare function defaultTypeScriptConfig(projectPath: string, _opts?: unknown): {
5
5
  compilerOptions: {
6
+ jsxImportSource: import("../js-frameworks-lib/jsx-transform.js").JsxImportSource;
7
+ allowJs: boolean;
8
+ allowSyntheticDefaultImports: boolean;
9
+ esModuleInterop: boolean;
10
+ forceConsistentCasingInFileNames: boolean;
11
+ jsx: string;
12
+ lib: string[];
13
+ moduleResolution: string;
14
+ module: string;
15
+ resolveJsonModule: boolean;
16
+ strict: boolean;
17
+ target: string;
18
+ isolatedModules: boolean;
19
+ skipLibCheck: boolean;
20
+ } | {
21
+ jsxImportSource?: undefined;
6
22
  allowJs: boolean;
7
23
  allowSyntheticDefaultImports: boolean;
8
24
  esModuleInterop: boolean;
@@ -1,3 +1,4 @@
1
- export type AssetCategory = 'content-script' | 'service-worker' | 'page' | 'runtime' | 'ignored';
1
+ export declare const ASSET_CATEGORIES: readonly ['content-script', 'service-worker', 'page', 'runtime', 'ignored'];
2
+ export type AssetCategory = (typeof ASSET_CATEGORIES)[number];
2
3
  export declare function categorizeAsset(rawName: string): AssetCategory;
3
4
  export declare const BUDGET_BYTES: Record<AssetCategory, number>;
@@ -4,27 +4,6 @@ interface PerfBudgetsPluginOptions {
4
4
  enabled?: boolean;
5
5
  budgets?: Partial<Record<AssetCategory, number>>;
6
6
  }
7
- /**
8
- * PerfBudgetsPlugin, extension-aware performance budgets.
9
- *
10
- * Replaces rspack's stock single-threshold `performance.hints` with a
11
- * per-asset-category budget tuned to how browser extensions actually
12
- * load code:
13
- *
14
- * content_scripts/* → 512 KiB (injected on every navigation)
15
- * background / SW → 512 KiB (wakes from cold each session)
16
- * pages / sidebar / … → 1 MiB (opened on demand)
17
- * runtime / wasm cores → 1 MiB (hashed payloads at the output root)
18
- * images, fonts, etc. → silenced (not a code-splitting concern)
19
- *
20
- * Numbers are sized to clear realistic framework templates (React/Vue/
21
- * Preact/Svelte + a design system) and still flag genuine outliers
22
- * (multi-MiB AI sidebars, heavyweight WASM service workers). Override
23
- * per-category via `perfBudgets` in `extension.config.{js,ts}`.
24
- *
25
- * Set `compiler.options.performance.hints = false` when this plugin is
26
- * registered to avoid double-warnings.
27
- */
28
7
  export declare class PerfBudgetsPlugin {
29
8
  static readonly name = "plugin-perf-budgets";
30
9
  private readonly options;
@@ -32,4 +11,4 @@ export declare class PerfBudgetsPlugin {
32
11
  apply(compiler: Compiler): void;
33
12
  }
34
13
  export type { AssetCategory } from './categorize.js';
35
- export { BUDGET_BYTES, categorizeAsset } from './categorize.js';
14
+ export { ASSET_CATEGORIES, BUDGET_BYTES, categorizeAsset } from './categorize.js';
@@ -36,7 +36,7 @@ export type ReadyMetadata = {
36
36
  extensionId?: string;
37
37
  browserExitedAt?: string;
38
38
  browserExitCode?: number | null;
39
- runtime?: 'attached';
39
+ runtime?: 'attached' | 'detached';
40
40
  executorAttachedAt?: string;
41
41
  managedExtensions?: ManagedExtensionRecord[];
42
42
  };
@@ -105,7 +105,8 @@ export declare function createPlaywrightMetadataWriter(options: WriterOptions):
105
105
  writeStarting(): void;
106
106
  writeReady(compiledAt?: string | null): void;
107
107
  writeError(code: string, message: string, errors?: string[]): void;
108
- writeShutdown(): void;
108
+ writeShutdown(message?: string): void;
109
+ stampExecutorDetached(): void;
109
110
  stampExecutorAttached(): void;
110
111
  appendEvent: (event: PlaywrightAutomationEvent) => void;
111
112
  };
@@ -1,7 +1,7 @@
1
1
  import type { Compiler } from '@rspack/core';
2
2
  import type { DevOptions, PluginInterface } from '../types.js';
3
3
  export { buildSourceFeatureIndex, classifyReloadFromSources, formatReloadContextLabel, pageContextFromSources, publicOutputPath, type ReloadInstruction, type ReloadType, readContentScriptCount, type SourceFeatureIndex } from './classify-reload.js';
4
- export { type ChangedSourcesSnapshot, type ChangedSourcesTracker, createChangedSourcesTracker, dispatchReload, type ReloadBroker, type ReloadExecutor } from './reload-dispatch.js';
4
+ export { type ChangedSourcesSnapshot, type ChangedSourcesTracker, createChangedSourcesTracker, dispatchReload, type ReloadBroker, type ReloadExecutor, type UndeliveredReloadContext } from './reload-dispatch.js';
5
5
  export { SetupChunkLoadingTarget } from './steps/setup-chunk-loading-target.js';
6
6
  /**
7
7
  * ReloadPlugin owns the dev-only reload/HMR strategy end to end:
@@ -1,5 +1,8 @@
1
1
  import type { Compiler } from '@rspack/core';
2
2
  import type { ReloadInstruction } from './classify-reload.js';
3
+ export interface UndeliveredReloadContext {
4
+ producerRestartExpected?: boolean;
5
+ }
3
6
  export interface ReloadBroker {
4
7
  broadcastReload(instruction: {
5
8
  type: ReloadInstruction['type'];
@@ -8,17 +11,17 @@ export interface ReloadBroker {
8
11
  changedFiles?: string[];
9
12
  changedScriptFiles?: string[];
10
13
  }): number;
11
- undeliveredReloadWarning?(): string | null;
14
+ undeliveredReloadWarning?(context?: UndeliveredReloadContext): string | null;
12
15
  }
13
16
  export interface ReloadExecutor {
14
17
  broker?: ReloadBroker;
18
+ producerRestartExpected?: boolean;
15
19
  }
16
20
  export declare function formatReloadingLine(label: string): string;
21
+ export declare function formatQueuedReloadLine(label: string): string;
17
22
  export declare function dispatchReload(instruction: ReloadInstruction | undefined, executor: ReloadExecutor): Promise<void>;
18
23
  export interface ChangedSourcesSnapshot {
19
- /** A manifest.json / _locales change, forces a full reload regardless of which other files changed. */
20
24
  forcedFull: boolean;
21
- /** Project-relative, forward-slashed paths of every file changed since the last successful compile. */
22
25
  changedSources: string[];
23
26
  }
24
27
  export interface ChangedSourcesTracker {
@@ -1,18 +1,5 @@
1
1
  import type { Compiler } from '@rspack/core';
2
2
  import type { PluginInterface } from '../../types.js';
3
- /**
4
- * How a chunk gets loaded is a property of the extension platform, not of dev
5
- * mode. Without this, a production build falls back to rspack's web target,
6
- * whose loader appends a `<script>` to the host document: that runs in the MAIN
7
- * world while the content script lives in the isolated world, so the chunk never
8
- * reaches the requester and a dynamic `import()` dies with ChunkLoadError. Dev
9
- * looked fine only because the target rode along inside the reload plugin
10
- * (issue #507).
11
- *
12
- * This is the target ALONE. Everything reload-specific, including the
13
- * synthesized background entry, stays in SetupReloadStrategy: production must
14
- * never gain a background script the author did not write.
15
- */
16
3
  export declare class SetupChunkLoadingTarget {
17
4
  private readonly manifestPath;
18
5
  private readonly browser;
@@ -2,15 +2,6 @@ import { type Compiler } from '@rspack/core';
2
2
  interface SpecialFoldersPluginOptions {
3
3
  manifestPath: string;
4
4
  }
5
- /**
6
- * SpecialFoldersPlugin is responsible for handling the
7
- * special folders in the extension:
8
- *
9
- * - /pages - HTML pages not included in the manifest
10
- * - /scripts - Script files not included in the manifest
11
- * - /public - Static files not included in the manifest
12
- * - /extensions - Load-only companion extensions (unpacked)
13
- */
14
5
  export declare class SpecialFoldersPlugin {
15
6
  static readonly name: string;
16
7
  private readonly options;
@@ -34,7 +34,6 @@ export declare function resolveAbsoluteFsPath(params: {
34
34
  projectRoot: string;
35
35
  publicRootForResource: string;
36
36
  outputRoot: string;
37
- /** Manifest dir: Chrome resolves root URLs (/pages/x.html) against it. */
38
37
  manifestRoot?: string;
39
38
  }): {
40
39
  absoluteFsPath: string;
@@ -1,32 +1,5 @@
1
1
  import type { Compiler } from '@rspack/core';
2
2
  import type { FilepathList, PluginInterface } from '../../types.js';
3
- /**
4
- * HtmlPlugin is responsible for handling the HTML file
5
- * defined in the manifest.json. Static assets and CSS files
6
- * within the HTML file are added to the compilation. JS files
7
- * are added as webpack entrypoints. It also supports ecxtra
8
- * html files defined via this.include option. These extra
9
- * html files are added to the compilation and are also HMR
10
- * enabled. They are useful for adding extra pages to the
11
- * extension runtime that are not defined in manifest.
12
- *
13
- * The plugin also has a guard against recompiling entrypoints
14
- * at runtime, throwing an error if any of those files change.
15
- *
16
- * Features supported:
17
- * action.default_popup - HMR enabled
18
- * background.page - HMR enabled
19
- * chrome_settings_overrides.homepage - HMR enabled
20
- * chrome_url_overrides.newtab - HMR enabled
21
- * chrome_url_overrides.history - HMR enabled
22
- * chrome_url_overrides.bookmarks - HMR enabled
23
- * devtools_page - HMR enabled
24
- * options_ui.page - HMR enabled
25
- * page_action.default_popup - HMR enabled
26
- * sandbox.page - HMR enabled
27
- * side_panel.default_panel - HMR enabled
28
- * sidebar_action.default_panel - HMR enabled
29
- */
30
3
  export declare class HtmlPlugin {
31
4
  readonly manifestPath: string;
32
5
  readonly includeList?: FilepathList;
@@ -1,17 +1,5 @@
1
1
  import type { Compiler } from '@rspack/core';
2
2
  import type { DevOptions, FilepathList, PluginInterface, ThemeIcon } from '../../types.js';
3
- /**
4
- * IconsPlugin is responsible for handling the icon files defined
5
- * in the manifest.json. It emits the icon files to the output
6
- * directory and adds them to the file dependencies of the compilation.
7
- *
8
- * Features supported:
9
- * action.default_icon
10
- * browser_action.default_icon
11
- * icons
12
- * page_action.default_icon
13
- * sidebar_action.default_icon
14
- */
15
3
  export declare class IconsPlugin {
16
4
  readonly manifestPath: string;
17
5
  readonly includeList?: FilepathList | {
@@ -1,14 +1,5 @@
1
1
  import { type Compiler } from '@rspack/core';
2
2
  import type { DevOptions, FilepathList, PluginInterface } from '../../types.js';
3
- /**
4
- * JsonPlugin is responsible for handling the JSON files defined
5
- * in the manifest.json. It emits the JSON files to the output
6
- * directory and adds them to the file dependencies of the compilation.
7
- *
8
- * Features supported:
9
- * - declarative_net_request.ruleset
10
- * - storage.managed_schema
11
- */
12
3
  export declare class JsonPlugin {
13
4
  readonly manifestPath: string;
14
5
  readonly includeList?: FilepathList;
@@ -1,9 +1,5 @@
1
1
  import { type Compiler } from '@rspack/core';
2
2
  import type { FilepathList, PluginInterface } from '../../types.js';
3
- /**
4
- * LocalesPlugin is responsible for emitting the locales files
5
- * to the output directory.
6
- */
7
3
  export declare class LocalesPlugin {
8
4
  readonly manifestPath: string;
9
5
  readonly includeList?: FilepathList;
@@ -1,15 +1,5 @@
1
1
  import type { Compiler } from '@rspack/core';
2
2
  import type { DevOptions, FilepathList, PluginInterface } from '../../types.js';
3
- /**
4
- * ManifestPlugin is responsible for handling the manifest.json file.
5
- * It ensures that the files defined in the manifest have valid paths,
6
- * throwing errors if they don't. It also ensures the manifest is emitted
7
- * to the assets bundle, so other plugins can modify it, and stored
8
- * as file dependency so webpack can watch and trigger changes.
9
- *
10
- * The plugin also has a guard against recompiling entrypoints
11
- * at runtime, throwing an error if any of those files change.
12
- */
13
3
  export declare class ManifestPlugin {
14
4
  readonly manifestPath: string;
15
5
  readonly browser: DevOptions['browser'];
@@ -0,0 +1,5 @@
1
+ import type { DevOptions, Manifest } from '../../../types.js';
2
+ export declare function dropEdgeStoreKey(manifest: Manifest, browser: DevOptions['browser']): {
3
+ manifest: Manifest;
4
+ dropped: boolean;
5
+ };
@@ -0,0 +1,11 @@
1
+ import type { DevOptions, Manifest } from '../../../types.js';
2
+ export interface WebkitDroppedKey {
3
+ path: string;
4
+ reason: string;
5
+ }
6
+ export declare function dropWebkitUnsupportedKeys(manifest: Manifest, browser: DevOptions['browser']): {
7
+ manifest: Manifest;
8
+ dropped: WebkitDroppedKey[];
9
+ };
10
+ export declare function reportWebkitDroppedKeys(dropped: WebkitDroppedKey[], browser: DevOptions['browser']): void;
11
+ export declare function resetWebkitDropNotices(): void;
@@ -1,14 +1,2 @@
1
1
  import type { Manifest } from '../../../types.js';
2
- /**
3
- * AMO rejects every new add-on submitted since 2025-11-03 whose manifest
4
- * lacks `browser_specific_settings.gecko.data_collection_permissions`
5
- * (add-ons that transmit nothing must declare `{"required": ["none"]}`),
6
- * and Mozilla has announced the key becomes mandatory for ALL add-ons
7
- * during 2026. Firefox parses the key from 140 (desktop) / 142 (Android)
8
- * on both MV2 and MV3, so declaring it is safe everywhere.
9
- *
10
- * Returns true when the resolved Gecko manifest carries no such
11
- * declaration, so the build can surface a store-readiness warning instead
12
- * of letting the author discover the rejection at submission time.
13
- */
14
2
  export declare function missingGeckoDataCollectionPermissions(manifest: Manifest): boolean;
@@ -1,14 +1,6 @@
1
- /**
2
- * Old Extension.js scaffold layout → current standardized HTML destinations.
3
- * Detection is field-scoped on purpose: a string that merely looks like an old
4
- * path in description, web_accessible_resources, or any other field is not a hit.
5
- */
6
1
  export interface LegacyManifestPathRule {
7
- /** Dot-path into the author manifest (e.g. `options_ui.page`). */
8
2
  field: string;
9
- /** Exact path the old scaffold wrote into that field. */
10
3
  legacyPath: string;
11
- /** Canonical emit destination Extension.js rewrites the field to. */
12
4
  modernPath: string;
13
5
  }
14
6
  export interface LegacyManifestPathHit {
@@ -17,10 +9,5 @@ export interface LegacyManifestPathHit {
17
9
  modernPath: string;
18
10
  }
19
11
  export declare const LEGACY_MANIFEST_PATH_RULES: readonly LegacyManifestPathRule[];
20
- /** Collapse author path noise so `./x` and `/x` match the scaffold form. */
21
12
  export declare function normalizeLegacyPathRef(raw: string): string;
22
- /**
23
- * Field-by-field scan of the *author* manifest for old scaffold HTML paths.
24
- * Call this on the pre-rewrite source; the emitted asset already has modern paths.
25
- */
26
13
  export declare function findLegacyManifestPathHits(manifest: unknown): LegacyManifestPathHit[];