extension-develop 4.0.11 → 4.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/0~dev-server.mjs +1 -1
- package/dist/0~rspack-config.mjs +107 -3154
- package/dist/101.mjs +32 -4
- package/dist/266.mjs +1 -4
- package/dist/839.mjs +3156 -59
- package/dist/bridge-entry.d.ts +5 -0
- package/dist/command-build.d.ts +3 -0
- package/dist/command-dev.d.ts +5 -0
- package/dist/command-preview.d.ts +30 -0
- package/dist/dev-server/auto-exit.d.ts +1 -0
- package/dist/dev-server/cleanup.d.ts +11 -0
- package/dist/dev-server/compiler-hooks.d.ts +9 -0
- package/dist/dev-server/connectable-host.d.ts +2 -0
- package/dist/dev-server/control-bridge/actions-file.d.ts +38 -0
- package/dist/dev-server/control-bridge/broker.d.ts +122 -0
- package/dist/dev-server/control-bridge/consumer-client.d.ts +43 -0
- package/dist/dev-server/control-bridge/contracts.d.ts +164 -0
- package/dist/dev-server/control-bridge/control-port-store.d.ts +25 -0
- package/dist/dev-server/control-bridge/controller-client.d.ts +30 -0
- package/dist/dev-server/control-bridge/logs-file.d.ts +30 -0
- package/dist/dev-server/control-bridge/producer-runtime.d.ts +30 -0
- package/dist/dev-server/control-bridge/ring-buffer.d.ts +21 -0
- package/dist/dev-server/control-bridge/session-token.d.ts +18 -0
- package/dist/dev-server/control-bridge/ws-control-server.d.ts +13 -0
- package/dist/dev-server/frameworks.d.ts +2 -0
- package/dist/dev-server/index.d.ts +3 -0
- package/dist/dev-server/messages.d.ts +17 -0
- package/dist/dev-server/port-manager.d.ts +17 -0
- package/dist/extension-js-devtools/extension-js/chrome/events.ndjson +2 -6
- package/dist/extension-js-devtools/extension-js/chrome/ready.json +9 -6
- package/dist/extension-js-devtools/extension-js/chromium/events.ndjson +2 -6
- package/dist/extension-js-devtools/extension-js/chromium/ready.json +9 -6
- package/dist/extension-js-devtools/extension-js/edge/events.ndjson +2 -6
- package/dist/extension-js-devtools/extension-js/edge/ready.json +9 -6
- package/dist/extension-js-devtools/extension-js/firefox/events.ndjson +2 -6
- package/dist/extension-js-devtools/extension-js/firefox/ready.json +9 -6
- package/dist/extension-js-theme/extension-js/chrome/events.ndjson +2 -6
- package/dist/extension-js-theme/extension-js/chrome/ready.json +9 -6
- package/dist/extension-js-theme/extension-js/chromium/events.ndjson +2 -6
- package/dist/extension-js-theme/extension-js/chromium/ready.json +9 -6
- package/dist/extension-js-theme/extension-js/edge/events.ndjson +2 -6
- package/dist/extension-js-theme/extension-js/edge/ready.json +9 -6
- package/dist/extension-js-theme/extension-js/firefox/events.ndjson +2 -8
- package/dist/extension-js-theme/extension-js/firefox/ready.json +9 -6
- package/dist/lib/branding.d.ts +7 -0
- package/dist/lib/build-summary.d.ts +9 -0
- package/dist/lib/config-loader.d.ts +38 -0
- package/dist/lib/constants.d.ts +11 -0
- package/dist/lib/dark-mode.d.ts +9 -0
- package/dist/lib/dev-server-client-import.d.ts +4 -0
- package/dist/lib/develop-context.d.ts +3 -0
- package/dist/lib/ensure-develop-artifacts.d.ts +10 -0
- package/dist/lib/extensions-to-load.d.ts +1 -0
- package/dist/lib/generate-extension-types.d.ts +1 -0
- package/dist/lib/has-dependency.d.ts +6 -0
- package/dist/lib/manifest-utils.d.ts +2 -0
- package/dist/lib/messages.d.ts +55 -0
- package/dist/lib/optional-dependency-types.d.ts +14 -0
- package/dist/lib/optional-deps-contracts.d.ts +13 -0
- package/dist/lib/optional-deps-resolver.d.ts +41 -0
- package/dist/lib/package-json.d.ts +3 -0
- package/dist/lib/package-manager.d.ts +61 -0
- package/dist/lib/parse-json-safe.d.ts +13 -0
- package/dist/lib/paths.d.ts +19 -0
- package/dist/lib/project-manifest.d.ts +60 -0
- package/dist/lib/project.d.ts +7 -0
- package/dist/lib/resource-path.d.ts +4 -0
- package/dist/lib/rust-min-stack.d.ts +2 -0
- package/dist/lib/sanitize.d.ts +1 -0
- package/dist/lib/session-paths.d.ts +39 -0
- package/dist/lib/stats-handler.d.ts +1 -0
- package/dist/lib/transpile-packages.d.ts +7 -0
- package/dist/lib/validate-user-dependencies.d.ts +1 -0
- package/dist/lib/zip.d.ts +2 -0
- package/dist/module.d.ts +8 -0
- package/dist/plugin-browsers/index.d.ts +108 -0
- package/dist/plugin-browsers/safari-dev-plugin.d.ts +19 -0
- package/dist/plugin-compatibility/compatibility-lib/messages.d.ts +5 -0
- package/dist/plugin-compatibility/feature-polyfill.d.ts +11 -0
- package/dist/plugin-compatibility/index.d.ts +12 -0
- package/dist/plugin-compilation/boring.d.ts +11 -0
- package/dist/plugin-compilation/clean-dist.d.ts +8 -0
- package/dist/plugin-compilation/compilation-lib/messages.d.ts +11 -0
- package/dist/plugin-compilation/compilation-lib/shared-state.d.ts +7 -0
- package/dist/plugin-compilation/env.d.ts +17 -0
- package/dist/plugin-compilation/index.d.ts +22 -0
- package/dist/plugin-compilation/zip.d.ts +18 -0
- package/dist/plugin-css/common-style-loaders.d.ts +8 -0
- package/dist/plugin-css/css-in-content-script-loader.d.ts +4 -0
- package/dist/plugin-css/css-in-html-loader.d.ts +4 -0
- package/dist/plugin-css/css-lib/build-css-rules.d.ts +12 -0
- package/dist/plugin-css/css-lib/inject-css-link.d.ts +16 -0
- package/dist/plugin-css/css-lib/is-content-script.d.ts +1 -0
- package/dist/plugin-css/css-lib/messages.d.ts +9 -0
- package/dist/plugin-css/css-lib/resolve-css-asset.d.ts +21 -0
- package/dist/plugin-css/css-parse-guard-loader.d.ts +8 -0
- package/dist/plugin-css/css-tools/less.d.ts +7 -0
- package/dist/plugin-css/css-tools/postcss.d.ts +4 -0
- package/dist/plugin-css/css-tools/sass.d.ts +10 -0
- package/dist/plugin-css/css-tools/tailwind.d.ts +2 -0
- package/dist/plugin-css/index.d.ts +26 -0
- package/dist/plugin-css/preprocessor-passthrough-loader.d.ts +6 -0
- package/dist/plugin-js-frameworks/frameworks-lib/integrations.d.ts +4 -0
- package/dist/plugin-js-frameworks/index.d.ts +18 -0
- package/dist/plugin-js-frameworks/js-frameworks-lib/load-loader-options.d.ts +2 -0
- package/dist/plugin-js-frameworks/js-frameworks-lib/messages.d.ts +10 -0
- package/dist/plugin-js-frameworks/js-tools/preact.d.ts +3 -0
- package/dist/plugin-js-frameworks/js-tools/react.d.ts +8 -0
- package/dist/plugin-js-frameworks/js-tools/svelte.d.ts +4 -0
- package/dist/plugin-js-frameworks/js-tools/typescript.d.ts +37 -0
- package/dist/plugin-js-frameworks/js-tools/vue.d.ts +3 -0
- package/dist/plugin-perf-budgets/categorize.d.ts +3 -0
- package/dist/plugin-perf-budgets/index.d.ts +34 -0
- package/dist/plugin-perf-budgets/messages.d.ts +8 -0
- package/dist/plugin-playwright/index.d.ts +89 -0
- package/dist/plugin-reload/classify-reload.d.ts +86 -0
- package/dist/plugin-reload/index.d.ts +29 -0
- package/dist/plugin-reload/messages.d.ts +1 -0
- package/dist/plugin-reload/reload-dispatch.d.ts +46 -0
- package/dist/plugin-reload/reload-lib/minimum-files/minimum-background-file-chromium.d.ts +0 -0
- package/dist/plugin-reload/reload-lib/minimum-files/minimum-background-file-firefox.d.ts +0 -0
- package/dist/plugin-reload/reload-lib/scripts-replay-shim.d.ts +19 -0
- package/dist/plugin-reload/steps/inject-bridge-producer.d.ts +14 -0
- package/dist/plugin-reload/steps/inject-bridge-relay.d.ts +4 -0
- package/dist/plugin-reload/steps/inject-scripts-replay-shim.d.ts +10 -0
- package/dist/plugin-reload/steps/prune-stale-hot-updates.d.ts +20 -0
- package/dist/plugin-reload/steps/remove-content-script-dev-server-runtime.d.ts +2 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/index.d.ts +9 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/setup-background-entry.d.ts +13 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/index.d.ts +2 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/ChunkLoader.d.ts +9 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/HMRDevServer.d.ts +3 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/InitialChunkFile.d.ts +5 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/NoDangerNamePlugin.d.ts +3 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/AutoPublicPath.d.ts +2 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/BaseUri.d.ts +2 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/BrowserRuntime.d.ts +8 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/ChunkLoaderFallback.d.ts +1 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/EagerlyLoadChunks.d.ts +1 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/LoadScript.d.ts +4 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/PublicPath.d.ts +2 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/ServiceWorkerPlugin.d.ts +6 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/helper.d.ts +12 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/index.d.ts +5 -0
- package/dist/plugin-reload/steps/strip-content-script-dev-server-runtime.d.ts +4 -0
- package/dist/plugin-special-folders/check-manifest-in-public.d.ts +2 -0
- package/dist/plugin-special-folders/emit-root-absolute-refs.d.ts +2 -0
- package/dist/plugin-special-folders/folder-extensions/resolve-config.d.ts +6 -0
- package/dist/plugin-special-folders/folder-extensions/resolve-dirs.d.ts +5 -0
- package/dist/plugin-special-folders/folder-extensions/types.d.ts +17 -0
- package/dist/plugin-special-folders/folder-extensions/utils.d.ts +9 -0
- package/dist/plugin-special-folders/get-data.d.ts +12 -0
- package/dist/plugin-special-folders/index.d.ts +20 -0
- package/dist/plugin-special-folders/messages.d.ts +3 -0
- package/dist/plugin-special-folders/warn-upon-folder-changes.d.ts +13 -0
- package/dist/plugin-static-assets/index.d.ts +10 -0
- package/dist/plugin-static-assets/static-assets-lib/messages.d.ts +8 -0
- package/dist/plugin-wasm/index.d.ts +15 -0
- package/dist/plugin-web-extension/feature-html/html-lib/assets.d.ts +2 -0
- package/dist/plugin-web-extension/feature-html/html-lib/inject.d.ts +4 -0
- package/dist/plugin-web-extension/feature-html/html-lib/messages.d.ts +24 -0
- package/dist/plugin-web-extension/feature-html/html-lib/parse-html.d.ts +8 -0
- package/dist/plugin-web-extension/feature-html/html-lib/patch-html.d.ts +8 -0
- package/dist/plugin-web-extension/feature-html/html-lib/utils.d.ts +46 -0
- package/dist/plugin-web-extension/feature-html/index.d.ts +36 -0
- package/dist/plugin-web-extension/feature-html/steps/add-assets-to-compilation.d.ts +9 -0
- package/dist/plugin-web-extension/feature-html/steps/add-scripts-and-styles-to-compilation.d.ts +9 -0
- package/dist/plugin-web-extension/feature-html/steps/add-to-file-dependencies.d.ts +9 -0
- package/dist/plugin-web-extension/feature-html/steps/emit-html-file.d.ts +9 -0
- package/dist/plugin-web-extension/feature-html/steps/ensure-hmr-for-scripts.d.ts +2 -0
- package/dist/plugin-web-extension/feature-html/steps/handle-common-errors.d.ts +9 -0
- package/dist/plugin-web-extension/feature-html/steps/minimum-script-file.d.ts +1 -0
- package/dist/plugin-web-extension/feature-html/steps/preact-refresh-shim.d.ts +1 -0
- package/dist/plugin-web-extension/feature-html/steps/throw-if-recompile-is-needed.d.ts +12 -0
- package/dist/plugin-web-extension/feature-html/steps/update-html-file.d.ts +9 -0
- package/dist/plugin-web-extension/feature-icons/index.d.ts +22 -0
- package/dist/plugin-web-extension/feature-icons/messages.d.ts +12 -0
- package/dist/plugin-web-extension/feature-icons/normalize-keys.d.ts +3 -0
- package/dist/plugin-web-extension/feature-icons/steps/add-to-file-dependencies.d.ts +8 -0
- package/dist/plugin-web-extension/feature-icons/steps/emit-file.d.ts +8 -0
- package/dist/plugin-web-extension/feature-json/index.d.ts +18 -0
- package/dist/plugin-web-extension/feature-json/json-validation.d.ts +3 -0
- package/dist/plugin-web-extension/feature-json/messages.d.ts +17 -0
- package/dist/plugin-web-extension/feature-json/process-assets.d.ts +2 -0
- package/dist/plugin-web-extension/feature-json/track-dependencies.d.ts +2 -0
- package/dist/plugin-web-extension/feature-locales/compilation-error.d.ts +2 -0
- package/dist/plugin-web-extension/feature-locales/get-locales.d.ts +2 -0
- package/dist/plugin-web-extension/feature-locales/index.d.ts +12 -0
- package/dist/plugin-web-extension/feature-locales/messages.d.ts +13 -0
- package/dist/plugin-web-extension/feature-locales/process-assets.d.ts +2 -0
- package/dist/plugin-web-extension/feature-locales/track-dependencies.d.ts +2 -0
- package/dist/plugin-web-extension/feature-locales/validation.d.ts +2 -0
- package/dist/plugin-web-extension/feature-manifest/index.d.ts +21 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/manifest.d.ts +10 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/sanitize-fatal-shapes.d.ts +45 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/background.d.ts +6 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/chrome_url_overrides.d.ts +8 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/commands.d.ts +16 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/content_scripts.d.ts +4 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/content_security_policy.d.ts +4 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/devtools_page.d.ts +4 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/icons.d.ts +6 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/index.d.ts +2 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/omnibox.d.ts +9 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/options_page.d.ts +4 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/options_ui.d.ts +8 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/page_action.d.ts +8 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/permissions.d.ts +4 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/sandbox.d.ts +7 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/sidebar_action.d.ts +2 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/storage.d.ts +6 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/theme.d.ts +2 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/user_scripts.d.ts +2 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/web_accessible_resources.d.ts +4 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/index.d.ts +2 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/background.d.ts +6 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/browser_action.d.ts +12 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/chrome_settings_overrides.d.ts +24 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/index.d.ts +2 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/theme_experiment.d.ts +7 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/action.d.ts +8 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/background.d.ts +6 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/declarative_net_request.d.ts +2 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/host_permissions.d.ts +4 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/index.d.ts +2 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/side_panel.d.ts +2 -0
- package/dist/plugin-web-extension/feature-manifest/messages.d.ts +9 -0
- package/dist/plugin-web-extension/feature-manifest/normalize-manifest-path.d.ts +3 -0
- package/dist/plugin-web-extension/feature-manifest/steps/add-dependencies.d.ts +6 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-background.d.ts +10 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-csp.d.ts +5 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-externally-connectable.d.ts +10 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-web-resources.d.ts +19 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults.d.ts +12 -0
- package/dist/plugin-web-extension/feature-manifest/steps/emit-manifest.d.ts +7 -0
- package/dist/plugin-web-extension/feature-manifest/steps/legacy-warnings.d.ts +5 -0
- package/dist/plugin-web-extension/feature-manifest/steps/patch-chromium-background.d.ts +15 -0
- package/dist/plugin-web-extension/feature-manifest/steps/patch-dev-content-script-manifest-paths.d.ts +11 -0
- package/dist/plugin-web-extension/feature-manifest/steps/patch-gecko-background.d.ts +15 -0
- package/dist/plugin-web-extension/feature-manifest/steps/patch-war.d.ts +15 -0
- package/dist/plugin-web-extension/feature-manifest/steps/persist-manifest.d.ts +4 -0
- package/dist/plugin-web-extension/feature-manifest/steps/update-manifest.d.ts +9 -0
- package/dist/plugin-web-extension/feature-scripts/contracts.d.ts +12 -0
- package/dist/plugin-web-extension/feature-scripts/index.d.ts +19 -0
- package/dist/plugin-web-extension/feature-scripts/messages.d.ts +7 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/utils.d.ts +2 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/classic-concat-loader.d.ts +8 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/content-script-wrapper.d.ts +13 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/get-bridge-scripts.d.ts +6 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/index.d.ts +11 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-public-path-runtime-module.d.ts +4 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-scripts.d.ts +9 -0
- package/dist/plugin-web-extension/feature-scripts/steps/keep-geturl-imports-native.d.ts +15 -0
- package/dist/plugin-web-extension/feature-scripts/steps/native-geturl-import-loader.d.ts +3 -0
- package/dist/plugin-web-extension/feature-scripts/steps/trace-runtime-loaded-files.d.ts +41 -0
- package/dist/plugin-web-extension/feature-scripts/steps/validate-content-script-syntax.d.ts +18 -0
- package/dist/plugin-web-extension/feature-web-resources/collect-entry-imports.d.ts +3 -0
- package/dist/plugin-web-extension/feature-web-resources/index.d.ts +19 -0
- package/dist/plugin-web-extension/feature-web-resources/steps/collect-content-entry-imports.d.ts +10 -0
- package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/clean-matches.d.ts +7 -0
- package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/generate-manifest.d.ts +11 -0
- package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/messages.d.ts +10 -0
- package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/resolve-war.d.ts +9 -0
- package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/shared.d.ts +4 -0
- package/dist/plugin-web-extension/index.d.ts +9 -0
- package/dist/plugin-web-extension/shared/classic-concat.d.ts +18 -0
- package/dist/plugin-web-extension/shared/compilation-issues.d.ts +6 -0
- package/dist/plugin-web-extension/shared/manifest-fields-change-detector.d.ts +12 -0
- package/dist/plugin-web-extension/shared/paths.d.ts +26 -0
- package/dist/preview-entry.d.ts +3 -0
- package/dist/rslib.config.d.ts +3 -0
- package/dist/rspack-config.d.ts +4 -0
- package/dist/types.d.ts +406 -0
- package/package.json +3 -3
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Compiler } from '@rspack/core';
|
|
2
|
+
import type { PluginInterface, DevOptions } from '../types';
|
|
3
|
+
export declare class CompatibilityPlugin {
|
|
4
|
+
static readonly name: string;
|
|
5
|
+
readonly manifestPath: string;
|
|
6
|
+
readonly browser: DevOptions['browser'];
|
|
7
|
+
readonly polyfill: DevOptions['polyfill'];
|
|
8
|
+
constructor(options: PluginInterface & {
|
|
9
|
+
polyfill: DevOptions['polyfill'];
|
|
10
|
+
});
|
|
11
|
+
apply(compiler: Compiler): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Compiler } from '@rspack/core';
|
|
2
|
+
import { type PluginInterface } from '../types';
|
|
3
|
+
export declare class BoringPlugin {
|
|
4
|
+
static readonly name: string;
|
|
5
|
+
readonly manifestPath: string;
|
|
6
|
+
readonly browser: PluginInterface['browser'];
|
|
7
|
+
private sawUserInvalidation;
|
|
8
|
+
private printedPostBannerStartupSuccess;
|
|
9
|
+
constructor(options: PluginInterface);
|
|
10
|
+
apply(compiler: Compiler): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Stats } from '@rspack/core';
|
|
2
|
+
export declare function boring(manifestName: string, durationMs: number, stats: Stats): string;
|
|
3
|
+
export declare function portInUse(requestedPort: number, newPort: number): string;
|
|
4
|
+
export declare function extensionJsRunnerError(error: unknown): string;
|
|
5
|
+
export declare function cleanDistStarting(distPath: string): string;
|
|
6
|
+
export declare function cleanDistRemovedSummary(removedCount: number, distPath: string): string;
|
|
7
|
+
export declare function cleanDistSkippedNotFound(distPath: string): string;
|
|
8
|
+
export declare function zipPackagingSkipped(reason: string): string;
|
|
9
|
+
export declare function envSelectedFile(envPath: string): string;
|
|
10
|
+
export declare function envInjectedPublicVars(count: number): string;
|
|
11
|
+
export declare function envNoMatchingFile(browser: string, mode: string, presentFiles: string[], expectedCandidates: string[]): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const sharedState: {
|
|
2
|
+
bannerPrinted: boolean;
|
|
3
|
+
pendingCompilationLine: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function markBannerPrinted(): void;
|
|
6
|
+
export declare function isBannerPrinted(): boolean;
|
|
7
|
+
export declare function setPendingCompilationLine(line: string): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Compiler } from '@rspack/core';
|
|
2
|
+
import type { PluginInterface, DevOptions } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Env files resolve family-wide, mirroring the manifest-prefix contract
|
|
5
|
+
* (lib/manifest-utils.ts): `chrome:`/`chromium:`/`edge:` manifest keys all
|
|
6
|
+
* apply to any chromium-family target, so `.env.chrome` must equally apply
|
|
7
|
+
* when building the default `chromium` target. The exact browser name always
|
|
8
|
+
* wins over family siblings; Safari/webkit inherit the chromium family for
|
|
9
|
+
* the same reason they inherit its manifest keys.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getEnvFileCandidates(browser: DevOptions['browser'], mode: string): string[];
|
|
12
|
+
export declare class EnvPlugin {
|
|
13
|
+
readonly browser: DevOptions['browser'];
|
|
14
|
+
readonly manifestPath?: string;
|
|
15
|
+
constructor(options: Partial<PluginInterface>);
|
|
16
|
+
apply(compiler: Compiler): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Compiler } from '@rspack/core';
|
|
2
|
+
import { type PluginInterface } from '../types';
|
|
3
|
+
export declare class CompilationPlugin {
|
|
4
|
+
static readonly name: string;
|
|
5
|
+
readonly manifestPath: string;
|
|
6
|
+
readonly browser: PluginInterface['browser'];
|
|
7
|
+
readonly clean: boolean;
|
|
8
|
+
readonly zip?: boolean;
|
|
9
|
+
readonly zipSource?: boolean;
|
|
10
|
+
readonly zipFilename?: string;
|
|
11
|
+
readonly port?: number;
|
|
12
|
+
constructor(options: PluginInterface & {
|
|
13
|
+
clean: boolean;
|
|
14
|
+
} & {
|
|
15
|
+
zip?: boolean;
|
|
16
|
+
zipSource?: boolean;
|
|
17
|
+
zipFilename?: string;
|
|
18
|
+
port?: number;
|
|
19
|
+
});
|
|
20
|
+
private applyIgnoreWarnings;
|
|
21
|
+
apply(compiler: Compiler): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Compiler } from '@rspack/core';
|
|
2
|
+
import type { DevOptions } from '../types';
|
|
3
|
+
export interface ZipPluginOptions {
|
|
4
|
+
manifestPath?: string;
|
|
5
|
+
browser: DevOptions['browser'];
|
|
6
|
+
zipData?: {
|
|
7
|
+
zip?: boolean;
|
|
8
|
+
zipSource?: boolean;
|
|
9
|
+
zipFilename?: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare class ZipPlugin {
|
|
13
|
+
private readonly options;
|
|
14
|
+
private readonly browser;
|
|
15
|
+
private readonly zipData;
|
|
16
|
+
constructor(options: ZipPluginOptions);
|
|
17
|
+
apply(compiler: Compiler): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type RuleSetRule } from '@rspack/core';
|
|
2
|
+
import { type DevOptions } from '../types';
|
|
3
|
+
export interface StyleLoaderOptions {
|
|
4
|
+
mode: DevOptions['mode'];
|
|
5
|
+
loader?: string;
|
|
6
|
+
loaderOptions?: Record<string, any>;
|
|
7
|
+
}
|
|
8
|
+
export declare function commonStyleLoaders(projectPath: string, opts: StyleLoaderOptions): Promise<RuleSetRule['use']>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RuleSetRule } from '@rspack/core';
|
|
2
|
+
import { type PreprocessorUsage } from './css-lib/build-css-rules';
|
|
3
|
+
import type { DevOptions } from '../types';
|
|
4
|
+
export declare function cssInContentScriptLoader(projectPath: string, manifestPath: string, mode: DevOptions['mode'], usage?: PreprocessorUsage): Promise<RuleSetRule[]>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RuleSetRule } from '@rspack/core';
|
|
2
|
+
import { type PreprocessorUsage } from './css-lib/build-css-rules';
|
|
3
|
+
import type { DevOptions } from '../types';
|
|
4
|
+
export declare function cssInHtmlLoader(projectPath: string, mode: DevOptions['mode'], manifestPath: string, usage?: PreprocessorUsage): Promise<RuleSetRule[]>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RuleSetRule } from '@rspack/core';
|
|
2
|
+
import type { DevOptions } from '../../types';
|
|
3
|
+
export interface PreprocessorUsage {
|
|
4
|
+
useSass?: boolean;
|
|
5
|
+
useLess?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface BuildCssRulesOptions {
|
|
8
|
+
nonModuleType: 'asset/inline' | 'css';
|
|
9
|
+
issuer: (issuer: string) => boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function buildCssRules(projectPath: string, mode: DevOptions['mode'], usage: PreprocessorUsage, opts: BuildCssRulesOptions): Promise<RuleSetRule[]>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Injects a `<link rel="stylesheet">` tag into the given `<head>` node
|
|
3
|
+
* for the bundled CSS of an entry feature.
|
|
4
|
+
*
|
|
5
|
+
* @param headNode – The parse5 `<head>` node to append to.
|
|
6
|
+
* @param feature – Entry name (e.g. `chrome_url_overrides/newtab`).
|
|
7
|
+
* @param firstLinkAttrs – Attributes captured from the first user-authored
|
|
8
|
+
* `<link>` so that non-default attributes (media, integrity, …) are
|
|
9
|
+
* propagated to the injected tag.
|
|
10
|
+
* @param hrefOverride – When the emitted CSS filename differs from the
|
|
11
|
+
* canonical `/<feature>.css`, pass the actual public href here.
|
|
12
|
+
*/
|
|
13
|
+
export declare function injectCssLink(headNode: any, feature: string, firstLinkAttrs?: Array<{
|
|
14
|
+
name: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}>, hrefOverride?: string): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isContentScriptEntry(absolutePath: string, manifestPath: string, projectPath: string): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function cssIntegrationsEnabled(integrations: string[]): string;
|
|
2
|
+
export declare function cssConfigsDetected(postcssConfig?: string, tailwindConfig?: string, browserslistSource?: string): string;
|
|
3
|
+
export declare function isUsingIntegration(name: string): string;
|
|
4
|
+
export declare function youAreAllSet(name: string): string;
|
|
5
|
+
export declare function missingSassDependency(): string;
|
|
6
|
+
export declare function postCssPluginNotResolved(pluginName: string, projectPath: string): string;
|
|
7
|
+
export declare function cssParseErrorShippedVerbatim(resourcePath: string, error: unknown): string;
|
|
8
|
+
export declare function preprocessorShippedUncompiled(resourcePath: string, tool: 'sass' | 'less'): string;
|
|
9
|
+
export declare function deadCssUrlRef(issuerPath: string, request: string): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Compilation } from '@rspack/core';
|
|
2
|
+
export interface CssAssetResult {
|
|
3
|
+
/** Whether a CSS asset was found for this feature. */
|
|
4
|
+
found: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* When the asset lives under a name that differs from the canonical
|
|
7
|
+
* `<feature>.css` (e.g. a chunk split by rspack's native CSS), this
|
|
8
|
+
* holds the public href to use in the injected `<link>` tag.
|
|
9
|
+
* Undefined when the canonical name matched directly.
|
|
10
|
+
*/
|
|
11
|
+
href: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the CSS asset emitted for a given entry feature.
|
|
15
|
+
*
|
|
16
|
+
* First tries the canonical name (`<feature>.css`). If that misses —
|
|
17
|
+
* which can happen when rspack's native CSS (`experiments.css`) splits
|
|
18
|
+
* the stylesheet into a chunk whose name differs from the entry — it
|
|
19
|
+
* falls back to inspecting the entrypoint's actual chunk files.
|
|
20
|
+
*/
|
|
21
|
+
export declare function resolveCssAsset(compilation: Compilation, feature: string): CssAssetResult;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface CssParseGuardLoaderContext {
|
|
2
|
+
resourcePath: string;
|
|
3
|
+
async(): (err: Error | null, content?: string) => void;
|
|
4
|
+
emitWarning(warning: Error): void;
|
|
5
|
+
}
|
|
6
|
+
export default function cssParseGuardLoader(this: unknown, source: string): string;
|
|
7
|
+
export declare function pitch(this: CssParseGuardLoaderContext): void;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function isUsingLess(projectPath: string): boolean;
|
|
2
|
+
/**
|
|
3
|
+
* Resolve (and install if missing) the less-loader contract. The actual loader
|
|
4
|
+
* rules are emitted by the content-script/HTML CSS loaders — this only ensures
|
|
5
|
+
* the optional dependency is present before that chain runs.
|
|
6
|
+
*/
|
|
7
|
+
export declare function maybeUseLess(projectPath: string): Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { StyleLoaderOptions } from '../common-style-loaders';
|
|
2
|
+
export declare function findPostCssConfig(projectPath: string): string | undefined;
|
|
3
|
+
export declare function isUsingPostCss(projectPath: string): boolean;
|
|
4
|
+
export declare function maybeUsePostCss(projectPath: string, opts: StyleLoaderOptions): Promise<Record<string, any>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function isUsingSass(projectPath: string): boolean;
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the Sass implementation from the user's project first, then fall back
|
|
4
|
+
* to the Extension.js cache/runtime. This mirrors the PostCSS/Tailwind
|
|
5
|
+
* resolution strategy so we don't depend on Node resolving `sass` from the
|
|
6
|
+
* loader path inside the npx cache.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveSassImplementation(projectPath: string): any | undefined;
|
|
9
|
+
export declare function createSassLoaderOptions(projectPath: string, mode: 'development' | 'production'): Record<string, any>;
|
|
10
|
+
export declare function maybeUseSass(projectPath: string): Promise<void>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Compiler } from '@rspack/core';
|
|
2
|
+
import type { PluginInterface } from '../types';
|
|
3
|
+
export { resolveCssAsset } from './css-lib/resolve-css-asset';
|
|
4
|
+
export type { CssAssetResult } from './css-lib/resolve-css-asset';
|
|
5
|
+
export { injectCssLink } from './css-lib/inject-css-link';
|
|
6
|
+
export declare class CssPlugin {
|
|
7
|
+
static readonly name: string;
|
|
8
|
+
readonly manifestPath: string;
|
|
9
|
+
constructor(options: PluginInterface);
|
|
10
|
+
private configureOptions;
|
|
11
|
+
/**
|
|
12
|
+
* A stylesheet url() whose file exists nowhere in the project is a fatal
|
|
13
|
+
* "Module not found" to rspack's CSS parser, but Chrome applies the rest
|
|
14
|
+
* of the stylesheet and 404s the reference silently (wild:
|
|
15
|
+
* mozilla/contain-facebook ships url(/img/login_continue_*.png) with no
|
|
16
|
+
* such files anywhere — the extension is store-published and works).
|
|
17
|
+
* Cancel these requests before resolution and warn instead, mirroring the
|
|
18
|
+
* dead-HTML-ref policy; EXTENSION_STRICT_REFS=true keeps them fatal.
|
|
19
|
+
* Only unambiguous file refs are tolerated — '/x' (extension root),
|
|
20
|
+
* './x'/'../x' (issuer-relative), and bare paths with a non-CSS asset
|
|
21
|
+
* extension. Bare specifiers without one stay with the resolver so
|
|
22
|
+
* node_modules @imports keep failing loudly when genuinely broken.
|
|
23
|
+
*/
|
|
24
|
+
private tolerateDeadUrlRefs;
|
|
25
|
+
apply(compiler: Compiler): Promise<void>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Compiler } from '@rspack/core';
|
|
2
|
+
import type { PluginInterface, DevOptions } from '../types';
|
|
3
|
+
export declare class JsFrameworksPlugin {
|
|
4
|
+
static readonly name: string;
|
|
5
|
+
readonly manifestPath: string;
|
|
6
|
+
readonly browser: DevOptions['browser'];
|
|
7
|
+
readonly mode: DevOptions['mode'];
|
|
8
|
+
readonly transpilePackages: string[];
|
|
9
|
+
constructor(options: PluginInterface & {
|
|
10
|
+
mode: DevOptions['mode'];
|
|
11
|
+
transpilePackages?: string[];
|
|
12
|
+
});
|
|
13
|
+
private findVueLoaderRuleIndices;
|
|
14
|
+
private mergeVueRule;
|
|
15
|
+
private patchReactRefreshRules;
|
|
16
|
+
private configureOptions;
|
|
17
|
+
apply(compiler: Compiler): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function installingRootDependencies(integration: string): string;
|
|
2
|
+
export declare function integrationInstalledSuccessfully(integration: string): string;
|
|
3
|
+
export declare function isUsingIntegration(name: string): string;
|
|
4
|
+
export declare function youAreAllSet(name: string): string;
|
|
5
|
+
export declare function creatingTSConfig(): string;
|
|
6
|
+
export declare function failedToInstallIntegration(integration: string, error: unknown): string;
|
|
7
|
+
export declare function isUsingCustomLoader(loaderPath: string): string;
|
|
8
|
+
export declare function jsFrameworksIntegrationsEnabled(integrations: string[]): string;
|
|
9
|
+
export declare function jsFrameworksConfigsDetected(tsConfigPath?: string, tsRoot?: string, targets?: string[]): string;
|
|
10
|
+
export declare function jsFrameworksHmrSummary(enabled: boolean, frameworks: string[]): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JsFramework } from '../../types';
|
|
2
|
+
type MaybeUseReactOptions = {
|
|
3
|
+
refreshExclude?: unknown;
|
|
4
|
+
disableRefresh?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function isUsingReact(projectPath: string): boolean;
|
|
7
|
+
export declare function maybeUseReact(projectPath: string, options?: MaybeUseReactOptions): Promise<JsFramework | undefined>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { JsFramework } from '../../types';
|
|
2
|
+
import type { DevOptions } from '../../types';
|
|
3
|
+
export declare function isUsingSvelte(projectPath: string): boolean;
|
|
4
|
+
export declare function maybeUseSvelte(projectPath: string, mode: DevOptions['mode']): Promise<JsFramework | undefined>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type DevOptions } from '../../types';
|
|
2
|
+
export declare function isUsingTypeScript(projectPath: string): boolean;
|
|
3
|
+
export declare function ensureTypeScriptConfig(projectPath: string): void;
|
|
4
|
+
export declare function defaultTypeScriptConfig(projectPath: string, _opts?: any): {
|
|
5
|
+
compilerOptions: {
|
|
6
|
+
allowJs: boolean;
|
|
7
|
+
allowSyntheticDefaultImports: boolean;
|
|
8
|
+
esModuleInterop: boolean;
|
|
9
|
+
forceConsistentCasingInFileNames: boolean;
|
|
10
|
+
jsx: string;
|
|
11
|
+
lib: string[];
|
|
12
|
+
moduleResolution: string;
|
|
13
|
+
module: string;
|
|
14
|
+
resolveJsonModule: boolean;
|
|
15
|
+
strict: boolean;
|
|
16
|
+
target: string;
|
|
17
|
+
isolatedModules: boolean;
|
|
18
|
+
skipLibCheck: boolean;
|
|
19
|
+
};
|
|
20
|
+
exclude: string[];
|
|
21
|
+
};
|
|
22
|
+
export declare function getUserTypeScriptConfigFile(projectPath: string): string | undefined;
|
|
23
|
+
export declare function getTypeScriptConfigOverrides(opts: {
|
|
24
|
+
mode: DevOptions['mode'];
|
|
25
|
+
}): {
|
|
26
|
+
compilerOptions: {
|
|
27
|
+
sourceMap: boolean;
|
|
28
|
+
skipLibCheck: boolean;
|
|
29
|
+
inlineSourceMap: boolean;
|
|
30
|
+
declarationMap: boolean;
|
|
31
|
+
noEmit: boolean;
|
|
32
|
+
incremental: boolean;
|
|
33
|
+
tsBuildInfoFile: string;
|
|
34
|
+
};
|
|
35
|
+
exclude: string[];
|
|
36
|
+
};
|
|
37
|
+
export declare function maybeUseTypeScript(projectPath: string): Promise<boolean>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Compiler } from '@rspack/core';
|
|
2
|
+
import { type AssetCategory } from './categorize';
|
|
3
|
+
interface PerfBudgetsPluginOptions {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
budgets?: Partial<Record<AssetCategory, number>>;
|
|
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
|
+
* images, fonts, etc. → silenced (not a code-splitting concern)
|
|
18
|
+
*
|
|
19
|
+
* Numbers are sized to clear realistic framework templates (React/Vue/
|
|
20
|
+
* Preact/Svelte + a design system) and still flag genuine outliers
|
|
21
|
+
* (multi-MiB AI sidebars, heavyweight WASM service workers). Override
|
|
22
|
+
* per-category via `perfBudgets` in `extension.config.{js,ts}`.
|
|
23
|
+
*
|
|
24
|
+
* Set `compiler.options.performance.hints = false` when this plugin is
|
|
25
|
+
* registered to avoid double-warnings.
|
|
26
|
+
*/
|
|
27
|
+
export declare class PerfBudgetsPlugin {
|
|
28
|
+
static readonly name = "plugin-perf-budgets";
|
|
29
|
+
private readonly options;
|
|
30
|
+
constructor(options?: PerfBudgetsPluginOptions);
|
|
31
|
+
apply(compiler: Compiler): void;
|
|
32
|
+
}
|
|
33
|
+
export { BUDGET_BYTES, categorizeAsset } from './categorize';
|
|
34
|
+
export type { AssetCategory } from './categorize';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { type Compiler } from '@rspack/core';
|
|
2
|
+
import { type AbsolutePath } from '../lib/paths';
|
|
3
|
+
export type PlaywrightAutomationCommand = 'dev' | 'start' | 'preview' | 'build';
|
|
4
|
+
export type ReadyStatus = 'starting' | 'ready' | 'error';
|
|
5
|
+
export type ReadyMetadata = {
|
|
6
|
+
schemaVersion: 2;
|
|
7
|
+
status: ReadyStatus;
|
|
8
|
+
command: PlaywrightAutomationCommand;
|
|
9
|
+
browser: string;
|
|
10
|
+
runId: string;
|
|
11
|
+
startedAt: string;
|
|
12
|
+
distPath: string;
|
|
13
|
+
manifestPath: string;
|
|
14
|
+
port: number | null;
|
|
15
|
+
host?: string;
|
|
16
|
+
pid: number;
|
|
17
|
+
ts: string;
|
|
18
|
+
compiledAt: string | null;
|
|
19
|
+
errors: string[];
|
|
20
|
+
code?: string;
|
|
21
|
+
message?: string;
|
|
22
|
+
instanceId?: string;
|
|
23
|
+
controlPort?: number | null;
|
|
24
|
+
controlPath?: string;
|
|
25
|
+
logsPath?: string;
|
|
26
|
+
cdpPort?: number;
|
|
27
|
+
toolchainVersion: string;
|
|
28
|
+
extensionName?: string;
|
|
29
|
+
extensionVersion?: string;
|
|
30
|
+
browserExitedAt?: string;
|
|
31
|
+
browserExitCode?: number | null;
|
|
32
|
+
};
|
|
33
|
+
export type PlaywrightAutomationEvent = {
|
|
34
|
+
type: 'compile_start' | 'compile_success' | 'compile_error' | 'shutdown';
|
|
35
|
+
ts: string;
|
|
36
|
+
command: PlaywrightAutomationCommand;
|
|
37
|
+
browser: string;
|
|
38
|
+
runId?: string;
|
|
39
|
+
durationMs?: number;
|
|
40
|
+
errorCount?: number;
|
|
41
|
+
errors?: string[];
|
|
42
|
+
};
|
|
43
|
+
type WriterOptions = {
|
|
44
|
+
packageJsonDir: string;
|
|
45
|
+
browser: string;
|
|
46
|
+
command: PlaywrightAutomationCommand;
|
|
47
|
+
distPath: string;
|
|
48
|
+
manifestPath: string;
|
|
49
|
+
port?: number | string | null;
|
|
50
|
+
host?: string;
|
|
51
|
+
instanceId?: string;
|
|
52
|
+
controlPort?: number | string | null;
|
|
53
|
+
controlPath?: string;
|
|
54
|
+
logsPath?: string;
|
|
55
|
+
};
|
|
56
|
+
type PluginOptions = {
|
|
57
|
+
packageJsonDir: string;
|
|
58
|
+
browser?: string;
|
|
59
|
+
mode?: 'development' | 'production' | 'none';
|
|
60
|
+
outputPath: string;
|
|
61
|
+
manifestPath: string;
|
|
62
|
+
port?: number | string | null;
|
|
63
|
+
host?: string;
|
|
64
|
+
command?: PlaywrightAutomationCommand;
|
|
65
|
+
instanceId?: string;
|
|
66
|
+
controlPort?: number | string | null;
|
|
67
|
+
controlPath?: string;
|
|
68
|
+
logsPath?: string;
|
|
69
|
+
};
|
|
70
|
+
export declare function formatStatsErrors(errors: unknown): string[];
|
|
71
|
+
export declare function getPlaywrightMetadataDir(packageJsonDir: string, browser: string): AbsolutePath;
|
|
72
|
+
export declare function createPlaywrightMetadataWriter(options: WriterOptions): {
|
|
73
|
+
metadataDir: AbsolutePath;
|
|
74
|
+
readyPath: AbsolutePath;
|
|
75
|
+
eventsPath: AbsolutePath;
|
|
76
|
+
writeStarting(): void;
|
|
77
|
+
writeReady(compiledAt?: string | null): void;
|
|
78
|
+
writeError(code: string, message: string, errors?: string[]): void;
|
|
79
|
+
appendEvent: (event: PlaywrightAutomationEvent) => void;
|
|
80
|
+
};
|
|
81
|
+
export declare class PlaywrightPlugin {
|
|
82
|
+
static readonly name = "plugin-playwright";
|
|
83
|
+
private readonly writer;
|
|
84
|
+
private readonly command;
|
|
85
|
+
private readonly browser;
|
|
86
|
+
constructor(options: PluginOptions);
|
|
87
|
+
apply(compiler: Compiler): void;
|
|
88
|
+
}
|
|
89
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export type ReloadType = 'full' | 'service-worker' | 'content-scripts';
|
|
2
|
+
export interface ReloadInstruction {
|
|
3
|
+
/**
|
|
4
|
+
* 'page' is a notify-only instruction: the extension itself is NOT reloaded
|
|
5
|
+
* (rspack-dev-server's livereload refreshes the open surface), but the
|
|
6
|
+
* signal still travels the bridge so every "Reloading…" surface (stdout,
|
|
7
|
+
* devtools pill) reflects it.
|
|
8
|
+
*/
|
|
9
|
+
type: ReloadType | 'page';
|
|
10
|
+
changedContentScriptEntries?: string[];
|
|
11
|
+
changedAssets?: string[];
|
|
12
|
+
/**
|
|
13
|
+
* Human context label shared VERBATIM by every surface that announces this
|
|
14
|
+
* reload — CLI stdout, the page's devtools console line, and the devtools
|
|
15
|
+
* extension pill — so they can never disagree about what is reloading.
|
|
16
|
+
* e.g. "content_script (content/scripts.tsx)".
|
|
17
|
+
*/
|
|
18
|
+
label?: string;
|
|
19
|
+
}
|
|
20
|
+
/** "context (fileA, fileB +2 more)" — the one label every reload surface shows. */
|
|
21
|
+
export declare function formatReloadContextLabel(context: string, files: string[]): string;
|
|
22
|
+
/**
|
|
23
|
+
* Best-effort page-context name for a page-only edit, mirroring the path
|
|
24
|
+
* heuristics used for the service-worker branch. Only used for the label —
|
|
25
|
+
* never for the reload decision.
|
|
26
|
+
*/
|
|
27
|
+
export declare function pageContextFromSources(changedSources: string[]): string;
|
|
28
|
+
/**
|
|
29
|
+
* Which dev-reload feature owns each project source file, derived from the
|
|
30
|
+
* compilation's chunk graph. Name-pattern heuristics are NOT trustworthy for
|
|
31
|
+
* this decision: a service worker named `background-ultimate.js` fails the
|
|
32
|
+
* `background.`/`service-worker` patterns and would be re-injected as a
|
|
33
|
+
* content script (the SW then never restarts — the wild-corpus anshul bug).
|
|
34
|
+
*/
|
|
35
|
+
export interface SourceFeatureIndex {
|
|
36
|
+
/** Sources bundled into a background/* chunk (SW or MV2 scripts). */
|
|
37
|
+
swSources: Set<string>;
|
|
38
|
+
/** Source → canonical content_scripts entry names whose chunks contain it. */
|
|
39
|
+
contentEntriesBySource: Map<string, Set<string>>;
|
|
40
|
+
/** Sources bundled only into page chunks (popup/options/devtools/…). */
|
|
41
|
+
pageSources: Set<string>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Walk the finished compilation and record, for every bundled source file,
|
|
45
|
+
* which reload feature its chunks belong to. Nameless (async) chunks are
|
|
46
|
+
* skipped — sources reached only through dynamic imports fall back to the
|
|
47
|
+
* name heuristics in {@link classifyReloadFromSources}.
|
|
48
|
+
*/
|
|
49
|
+
export declare function buildSourceFeatureIndex(compilation: any, contextDir: string): SourceFeatureIndex;
|
|
50
|
+
/**
|
|
51
|
+
* Pure reload classifier shared by the launched-browser path (BrowsersPlugin,
|
|
52
|
+
* below) and the controller-less path (the dev server's `--no-browser` reload
|
|
53
|
+
* broadcast). Centralizing the decision keeps both paths converged: the same
|
|
54
|
+
* change always resolves to the same {@link ReloadType}, whether it is handed
|
|
55
|
+
* to the CDP controller or broadcast over the control bridge.
|
|
56
|
+
*
|
|
57
|
+
* Decision order per changed file:
|
|
58
|
+
* 1. manifest/_locales (forcedFull) → full reload.
|
|
59
|
+
* 2. Chunk-graph membership ({@link buildSourceFeatureIndex}): background
|
|
60
|
+
* chunk → service-worker; content chunk → content-scripts (re-injecting
|
|
61
|
+
* ONLY the entries whose chunks contain a changed file); page chunk →
|
|
62
|
+
* notify-only page.
|
|
63
|
+
* 3. Emitted static asset (exists at the same relative path in the output
|
|
64
|
+
* dir: manifest icons, web-accessible resources, DNR rulesets) → full
|
|
65
|
+
* reload — the browser only re-reads those from disk on an extension
|
|
66
|
+
* reload, and re-injecting content scripts for an icon edit is a storm
|
|
67
|
+
* of no-ops (the wild-corpus Sappgulf bug).
|
|
68
|
+
* 4. Name heuristics, as before, for anything the graph can't see.
|
|
69
|
+
*
|
|
70
|
+
* The thunks keep the (cheap) index build and manifest read lazy — they only
|
|
71
|
+
* run when a classification actually needs them.
|
|
72
|
+
*
|
|
73
|
+
* Returns a notify-only `type: 'page'` instruction for page-only edits
|
|
74
|
+
* (popup/options/devtools/newtab HTML/CSS/JS) — those are delivered by
|
|
75
|
+
* rspack-dev-server's livereload broadcast, so firing an extension reload
|
|
76
|
+
* would race it and flash the open surface. The 'page' instruction only
|
|
77
|
+
* carries the announcement label; dispatch never reloads the extension for it.
|
|
78
|
+
*/
|
|
79
|
+
export declare function classifyReloadFromSources(opts: {
|
|
80
|
+
changedSources: string[];
|
|
81
|
+
forcedFull?: boolean;
|
|
82
|
+
getContentScriptCount: () => number;
|
|
83
|
+
getSourceFeatureIndex?: () => SourceFeatureIndex | null;
|
|
84
|
+
outputPath?: string;
|
|
85
|
+
}): ReloadInstruction | undefined;
|
|
86
|
+
export declare function readContentScriptCount(compilation: any, outputPath: string): number;
|