extension-develop 4.1.39 → 4.1.40-canary.458.001a6a0
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/README.md +7 -4
- package/dist/{771~0.mjs → 5h~0.mjs} +13 -3
- package/dist/{273~0.mjs → 6l~0.mjs} +1 -1
- package/dist/{524~0.mjs → 9~0.mjs} +18 -2
- package/dist/{640~0.mjs → bh~0.mjs} +6 -1
- package/dist/bridge.mjs +14 -8
- package/dist/b~0.mjs +8568 -0
- package/dist/command-dev.d.ts +2 -0
- package/dist/command-preview.d.ts +2 -0
- package/dist/contracts.mjs +2 -1
- package/dist/{469~0.mjs → cp~0.mjs} +30 -18
- package/dist/css-parse-guard-loader.mjs +2 -2
- package/dist/c~0.mjs +56 -0
- package/dist/dead-css-url-loader.mjs +20 -119
- package/dist/dev-server/control-bridge/actions-file.d.ts +7 -0
- package/dist/dev-server/control-bridge/broker.d.ts +42 -2
- package/dist/dev-server/control-bridge/consumer-client.d.ts +7 -0
- package/dist/dev-server/control-bridge/contracts.d.ts +29 -1
- package/dist/dev-server/control-bridge/logs-file.d.ts +6 -0
- package/dist/dev-server/control-bridge/loopback.d.ts +1 -0
- package/dist/dev-server/control-bridge/producer-runtime.d.ts +5 -2
- package/dist/dev-server/control-bridge/production-control.d.ts +1 -0
- package/dist/dev-server/control-bridge/session-token.d.ts +5 -2
- package/dist/dev-server/cors.d.ts +4 -2
- package/dist/dev-server/messages.d.ts +6 -0
- package/dist/dev-server/session-restart.d.ts +3 -1
- package/dist/dev-server~0.mjs +71 -129
- package/dist/df~0.mjs +197 -0
- package/dist/{846~0.mjs → d~0.mjs} +4 -3
- package/dist/ensure-hmr-for-scripts.js +3 -3
- package/dist/ensure-hmr-for-scripts.mjs +3 -3
- package/dist/extension-js-devtools/build-stamp.json +2 -2
- package/dist/extension-js-devtools/chrome/background/service_worker.js +2 -2
- package/dist/extension-js-devtools/chrome/pages/welcome.js +2 -2
- package/dist/extension-js-devtools/chromium/background/service_worker.js +2 -2
- package/dist/extension-js-devtools/chromium/pages/welcome.js +2 -2
- package/dist/extension-js-devtools/edge/background/service_worker.js +2 -2
- package/dist/extension-js-devtools/edge/pages/welcome.js +2 -2
- package/dist/extension-js-devtools/firefox/background/scripts.js +2 -2
- package/dist/extension-js-devtools/firefox/pages/welcome.js +2 -2
- package/dist/extension-js-theme/build-stamp.json +2 -2
- package/dist/{143~0.mjs → ey~0.mjs} +2 -2
- package/dist/e~0.mjs +33 -0
- package/dist/feature-scripts-classic-traced-globals-loader.mjs +7 -2
- package/dist/feature-scripts-content-script-wrapper.js +55 -17
- package/dist/feature-scripts-content-script-wrapper.mjs +55 -17
- package/dist/feature-scripts-native-geturl-import-loader.mjs +1 -1
- package/dist/{105~0.mjs → g0~0.mjs} +1 -1
- package/dist/{88~0.mjs → j6~0.mjs} +9 -1
- package/dist/{731~0.mjs → j~0.mjs} +2 -2
- package/dist/{712~0.mjs → ka~0.mjs} +18 -2
- package/dist/{852~0.mjs → k~0.mjs} +4 -2
- package/dist/late-css-import-loader.mjs +1 -1
- package/dist/lib/addon-lint.d.ts +6 -0
- package/dist/lib/build-summary.d.ts +6 -0
- package/dist/lib/dev-additions.d.ts +12 -0
- package/dist/lib/extension-base-from-stack.d.ts +16 -0
- package/dist/lib/localized-manifest-name.d.ts +9 -0
- package/dist/lib/messages.d.ts +5 -2
- package/dist/lib/process-started-at.d.ts +1 -0
- package/dist/lib/real-path.d.ts +8 -0
- package/dist/lib/resource-path.d.ts +1 -0
- package/dist/lib/session-paths.d.ts +2 -0
- package/dist/lib/split-chunks.d.ts +2 -1
- package/dist/lib/stats-handler.d.ts +1 -0
- package/dist/lib/tsconfig-includes-file.d.ts +1 -0
- package/dist/l~0.mjs +2290 -0
- package/dist/main-world-bridge.js +92 -23
- package/dist/main-world-bridge.mjs +92 -23
- package/dist/manifest-entry.d.ts +2 -0
- package/dist/manifest.mjs +3 -1
- package/dist/module.mjs +3 -3
- package/dist/{832~0.mjs → m~0.mjs} +2242 -286
- package/dist/o~0.mjs +47 -0
- package/dist/plugin-browsers/index.d.ts +7 -0
- package/dist/plugin-browsers/safari-dev-plugin.d.ts +2 -0
- package/dist/plugin-compatibility/compatibility-lib/messages.d.ts +1 -1
- package/dist/plugin-compatibility/compatibility-lib/native-browser-namespace.d.ts +5 -0
- package/dist/plugin-compatibility/feature-browser-global.d.ts +4 -0
- package/dist/plugin-compilation/compilation-lib/messages.d.ts +4 -1
- package/dist/plugin-compilation/env.d.ts +1 -0
- package/dist/plugin-compilation/index.d.ts +2 -0
- package/dist/plugin-compilation/node-builtins.d.ts +5 -0
- package/dist/plugin-compilation/one-diagnostic-per-location.d.ts +13 -0
- package/dist/plugin-compilation/resolve-file-requests.d.ts +16 -0
- package/dist/plugin-compilation/warm-ancestor-watchers.d.ts +19 -0
- package/dist/plugin-compilation/watch-real-project-path.d.ts +27 -0
- package/dist/plugin-compilation/zip.d.ts +2 -0
- package/dist/plugin-css/css-in-content-script-loader.d.ts +1 -1
- package/dist/plugin-css/css-lib/build-css-rules.d.ts +3 -0
- package/dist/plugin-css/css-lib/inline-content-script-css.d.ts +3 -1
- package/dist/plugin-css/css-lib/messages.d.ts +4 -0
- package/dist/plugin-css/css-lib/sfc-style-block.d.ts +26 -0
- package/dist/plugin-css/css-lib/unplaced-style-imports.d.ts +7 -0
- package/dist/plugin-css/css-lib/verbatim-css.d.ts +1 -0
- package/dist/plugin-css/dead-css-url-loader.d.ts +9 -1
- package/dist/plugin-css/index.d.ts +1 -0
- package/dist/plugin-css/sfc-style-block-loader.d.ts +18 -0
- package/dist/plugin-css/unplaced-style-import-loader.d.ts +16 -0
- package/dist/plugin-playwright/index.d.ts +22 -0
- package/dist/plugin-reload/classify-reload.d.ts +20 -0
- package/dist/plugin-reload/index.d.ts +4 -2
- package/dist/plugin-reload/messages.d.ts +1 -0
- package/dist/plugin-reload/reload-dispatch.d.ts +21 -2
- package/dist/plugin-reload/reload-lib/dev-content-scripts.d.ts +6 -0
- package/dist/plugin-reload/reload-lib/scripts-replay-shim.d.ts +1 -1
- package/dist/plugin-reload/steps/inject-bridge-producer.d.ts +6 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/ChunkLoader.d.ts +3 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/AutoPublicPath.d.ts +1 -1
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/BaseUri.d.ts +1 -1
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/LoadScript.d.ts +1 -1
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/PublicPath.d.ts +1 -1
- package/dist/plugin-special-folders/get-data.d.ts +2 -0
- package/dist/plugin-special-folders/hint-import-only-scripts.d.ts +4 -0
- package/dist/plugin-special-folders/include-files.d.ts +2 -0
- package/dist/plugin-special-folders/messages.d.ts +1 -0
- package/dist/plugin-web-extension/feature-html/html-lib/inject.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/html-lib/patch-html.d.ts +1 -0
- package/dist/plugin-web-extension/feature-html/steps/update-html-file.d.ts +1 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/filter-keys-gecko.d.ts +21 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/filter-keys-safari.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/webkit-unsupported-keys.d.ts +15 -0
- package/dist/plugin-web-extension/feature-manifest/messages.d.ts +7 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-additions.d.ts +8 -0
- package/dist/plugin-web-extension/feature-manifest/steps/warn-description-length.d.ts +25 -0
- package/dist/plugin-web-extension/feature-manifest/steps/warn-gecko-unsupported-apis.d.ts +2 -2
- package/dist/plugin-web-extension/feature-scripts/contracts.d.ts +3 -0
- package/dist/plugin-web-extension/feature-scripts/index.d.ts +1 -0
- package/dist/plugin-web-extension/feature-scripts/messages.d.ts +9 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/completion-value.d.ts +13 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/injected-sheet-urls.d.ts +5 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/main-world-bridge-pairing.d.ts +5 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/main-world-copy-routing.d.ts +2 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/registration-worlds.d.ts +10 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/runtime-main-world-scripts.d.ts +25 -2
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/runtime-script-sheet.d.ts +14 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/taken-extension-base.d.ts +10 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-base-uri-runtime-module.d.ts +7 -1
- package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/content-script-wrapper.d.ts +2 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/index.d.ts +2 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-public-path-runtime-module.d.ts +6 -0
- package/dist/plugin-web-extension/feature-scripts/steps/classic-traced-globals-loader.d.ts +1 -0
- package/dist/plugin-web-extension/feature-scripts/steps/compile-main-world-scripts.d.ts +4 -0
- package/dist/plugin-web-extension/feature-scripts/steps/keep-completion-value.d.ts +6 -0
- package/dist/plugin-web-extension/feature-scripts/steps/pair-runtime-main-world-bridges.d.ts +12 -0
- package/dist/plugin-web-extension/feature-scripts/steps/place-runtime-script-sheets.d.ts +12 -0
- package/dist/plugin-web-extension/feature-scripts/steps/prune-main-world-bridges.d.ts +1 -0
- package/dist/plugin-web-extension/feature-scripts/steps/root-injected-sheet-urls.d.ts +9 -0
- package/dist/plugin-web-extension/feature-scripts/steps/route-main-world-copies.d.ts +10 -0
- package/dist/plugin-web-extension/feature-scripts/steps/source-literals.d.ts +24 -0
- package/dist/plugin-web-extension/feature-scripts/steps/take-extension-base.d.ts +11 -0
- package/dist/plugin-web-extension/feature-scripts/steps/trace-runtime-loaded-files.d.ts +18 -3
- package/dist/plugin-web-extension/feature-scripts/steps/warn-main-world-registration-changed.d.ts +12 -0
- package/dist/plugin-web-extension/feature-scripts/steps/warn-moved-page-relative-urls.d.ts +30 -0
- package/dist/plugin-web-extension/feature-scripts/steps/warn-page-relative-script-path.d.ts +10 -0
- package/dist/plugin-web-extension/feature-scripts/steps/warn-unknown-registration-world.d.ts +10 -0
- package/dist/plugin-web-extension/feature-web-resources/collect-entry-imports.d.ts +1 -0
- package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/messages.d.ts +1 -0
- package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/page-requests.d.ts +5 -0
- package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/resolve-war.d.ts +1 -0
- package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/unreachable-resources.d.ts +1 -0
- package/dist/plugin-web-extension/shared/script-graph.d.ts +12 -0
- package/dist/preprocessor-passthrough-loader.mjs +1 -1
- package/dist/preview.mjs +1 -1
- package/dist/public-css-url-loader.mjs +1 -1
- package/dist/{331~0.mjs → q~0.mjs} +2 -2
- package/dist/rj~0.mjs +125 -0
- package/dist/{519~0.mjs → rl~0.mjs} +53 -3
- package/dist/rspack-config~0.mjs +2768 -3256
- package/dist/{177~0.mjs → r~0.mjs} +2 -2
- package/dist/sfc-style-block-loader.mjs +49 -0
- package/dist/stats-handler~0.mjs +15 -7
- package/dist/tm~0.mjs +71 -0
- package/dist/types.d.ts +43 -3
- package/dist/{285~0.mjs → t~0.mjs} +41 -26
- package/dist/unplaced-style-import-loader.mjs +131 -0
- package/dist/x~0.mjs +3 -0
- package/dist/y~0.mjs +234 -0
- package/dist/zip~0.mjs +5 -4
- package/dist/{363~0.mjs → z~0.mjs} +360 -267
- package/package.json +5 -5
- package/dist/527~0.mjs +0 -3
- package/dist/840~0.mjs +0 -5635
- /package/dist/{895~0.mjs → 3~0.mjs} +0 -0
- /package/dist/{374~0.mjs → 5~0.mjs} +0 -0
- /package/dist/{206~0.mjs → 6~0.mjs} +0 -0
- /package/dist/{471~0.mjs → g~0.mjs} +0 -0
- /package/dist/{117~0.mjs → w~0.mjs} +0 -0
package/dist/o~0.mjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
|
+
import { extensionBaseGlobal, takeBlockOpen, readTakeBlock, EXTENSION_BASE_GLOBAL, EXTENSION_BASE_ATTRIBUTE, extensionBaseAttribute } from "./c~0.mjs";
|
|
3
|
+
import { filterKeysForThisBrowser } from "./ey~0.mjs";
|
|
4
|
+
import { stripBom } from "./5~0.mjs";
|
|
5
|
+
import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
6
|
+
const TAKE_BLOCK_CLOSE = '\n}';
|
|
7
|
+
takeBlockOpen(extensionBaseGlobal('')).length;
|
|
8
|
+
const globals = new Map();
|
|
9
|
+
function extensionBaseGlobalFor(manifestPath, browser = 'firefox') {
|
|
10
|
+
const key = `${manifestPath}::${String(browser)}`;
|
|
11
|
+
const known = globals.get(key);
|
|
12
|
+
if (known) return known;
|
|
13
|
+
let global = extensionBaseGlobal(manifestPath);
|
|
14
|
+
try {
|
|
15
|
+
const manifest = filterKeysForThisBrowser(JSON.parse(stripBom(__rspack_external_node_fs_1b05aee1.readFileSync(manifestPath, 'utf8'))), browser);
|
|
16
|
+
const id = manifest.browser_specific_settings?.gecko?.id;
|
|
17
|
+
const named = [
|
|
18
|
+
id,
|
|
19
|
+
manifest.name,
|
|
20
|
+
manifest.description
|
|
21
|
+
].map((part)=>'string' == typeof part ? part : '').join('\n');
|
|
22
|
+
global = extensionBaseGlobal('string' == typeof id && id ? named : `${named}\n${JSON.stringify(manifest)}`);
|
|
23
|
+
} catch {}
|
|
24
|
+
globals.set(key, global);
|
|
25
|
+
return global;
|
|
26
|
+
}
|
|
27
|
+
function extensionBaseAttributeFor(manifestPath, browser = 'firefox') {
|
|
28
|
+
if (!manifestPath) return EXTENSION_BASE_ATTRIBUTE;
|
|
29
|
+
return extensionBaseAttribute(extensionBaseGlobalFor(manifestPath, browser));
|
|
30
|
+
}
|
|
31
|
+
function takesExtensionBase(text) {
|
|
32
|
+
return null !== readTakeBlock(text);
|
|
33
|
+
}
|
|
34
|
+
function closeTakeBlock(text, global = EXTENSION_BASE_GLOBAL) {
|
|
35
|
+
const trailer = /\n\/\/# sourceMappingURL=[^\n]*\s*$/.exec(text);
|
|
36
|
+
const body = trailer ? text.slice(0, trailer.index) : text;
|
|
37
|
+
return {
|
|
38
|
+
open: takeBlockOpen(global),
|
|
39
|
+
closed: `${body}${TAKE_BLOCK_CLOSE}${trailer ? trailer[0] : ''}`
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function isEntryFile(assetName, entryName) {
|
|
43
|
+
if (!assetName.startsWith(`${entryName}.`) || !assetName.endsWith('.js')) return false;
|
|
44
|
+
const middle = assetName.slice(entryName.length + 1, -2);
|
|
45
|
+
return '' === middle || /^[0-9a-f]{8}\.$/.test(middle);
|
|
46
|
+
}
|
|
47
|
+
export { closeTakeBlock, extensionBaseAttributeFor, extensionBaseGlobalFor, isEntryFile, takesExtensionBase };
|
|
@@ -50,6 +50,7 @@ export interface BrowserLaunchOptions {
|
|
|
50
50
|
logTab?: number | string;
|
|
51
51
|
emulatorViewerUrl?: string;
|
|
52
52
|
logSink?: BrowserLogSink;
|
|
53
|
+
awaitBootRegistrations?: (timeoutMs: number) => Promise<'settled' | 'timeout'>;
|
|
53
54
|
}
|
|
54
55
|
/** Browser-generated log entry normalized by the launcher's CDP controller. */
|
|
55
56
|
export interface BrowserLogSinkEvent {
|
|
@@ -124,8 +125,11 @@ export declare class BrowsersPlugin implements RunnerPlugin {
|
|
|
124
125
|
private logSink;
|
|
125
126
|
private emulatorViewerUrl;
|
|
126
127
|
private instanceId;
|
|
128
|
+
private readyListener;
|
|
127
129
|
private lastReportedRefusal;
|
|
128
130
|
private loadedContentScriptFiles;
|
|
131
|
+
private loadedContentScriptDigests;
|
|
132
|
+
private loadedWebResources;
|
|
129
133
|
constructor(options: BrowsersPluginOptions);
|
|
130
134
|
/**
|
|
131
135
|
* The dev server injects the control-bridge broker so a launched
|
|
@@ -134,8 +138,11 @@ export declare class BrowsersPlugin implements RunnerPlugin {
|
|
|
134
138
|
*/
|
|
135
139
|
setReloadBroker(broker: ReloadBroker): void;
|
|
136
140
|
setLogSink(sink: BrowserLogSink): void;
|
|
141
|
+
private bootRegistrationsHold;
|
|
137
142
|
setEmulatorViewerUrl(url: string): void;
|
|
138
143
|
setInstanceId(instanceId: string): void;
|
|
144
|
+
setReadyListener(listener: () => void): void;
|
|
145
|
+
private announceReady;
|
|
139
146
|
wakeBackground(): Promise<boolean>;
|
|
140
147
|
private retryRefusedExtensionLoad;
|
|
141
148
|
apply(compiler: Compiler): void;
|
|
@@ -13,8 +13,10 @@ export declare class SafariDevPlugin implements RunnerPlugin {
|
|
|
13
13
|
private pending;
|
|
14
14
|
private idleWaiters;
|
|
15
15
|
private reloadBroker;
|
|
16
|
+
private readyListener;
|
|
16
17
|
constructor(packager: SafariPackagerFn);
|
|
17
18
|
setReloadBroker(broker: ReloadBroker): void;
|
|
19
|
+
setReadyListener(listener: () => void): void;
|
|
18
20
|
apply(compiler: Compiler): void;
|
|
19
21
|
idle(): Promise<void>;
|
|
20
22
|
private drain;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DevOptions } from '../../types.js';
|
|
2
2
|
export declare function webextensionPolyfillNotFound(): string;
|
|
3
|
-
export declare function browserGlobalWithoutPolyfill(browser: DevOptions['browser'], files: string[]): string;
|
|
3
|
+
export declare function browserGlobalWithoutPolyfill(browser: DevOptions['browser'], files: string[], floor?: number): string;
|
|
4
4
|
export declare function compatibilityPolyfillEnabled(browser: DevOptions['browser'], polyfillPath: string): string;
|
|
5
5
|
export declare function compatibilityPolyfillSkipped(reason: string, browser: DevOptions['browser']): string;
|
|
6
6
|
export declare function compatibilityPolyfillDisabled(browser: DevOptions['browser']): string;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type Compiler } from '@rspack/core';
|
|
2
2
|
import type { DevOptions, PluginInterface } from '../types.js';
|
|
3
3
|
export declare function browserReadLine(text: string): number | undefined;
|
|
4
|
+
export declare function declaresNativeBrowserNamespace(manifest: {
|
|
5
|
+
minimum_chrome_version?: unknown;
|
|
6
|
+
devtools_page?: unknown;
|
|
7
|
+
}): boolean;
|
|
4
8
|
export declare class WarnBrowserGlobalWithoutPolyfill {
|
|
5
9
|
readonly manifestPath: string;
|
|
6
10
|
readonly browser: DevOptions['browser'];
|
|
@@ -10,4 +10,7 @@ export declare function envValueBreaksJsonAsset(asset: string, names: string[]):
|
|
|
10
10
|
export declare function projectConfigChangedRestartRequired(configPath: string): string;
|
|
11
11
|
export declare function envChangedRestartRequired(envPath: string): string;
|
|
12
12
|
export declare function envPublicSecretName(names: string[]): string;
|
|
13
|
-
export declare function
|
|
13
|
+
export declare function envIgnoredFiles(files: string[], mode: string): string;
|
|
14
|
+
export declare function envNoMatchingFile(browser: string, mode: string, presentFiles: string[], expectedCandidates: string[], publicValuesDefined?: boolean): string;
|
|
15
|
+
export declare function nodeBuiltinStandInHint(builtin: string): string;
|
|
16
|
+
export declare function nodeBuiltinHasNoStandIn(builtin: string, issuer: string, stubbed: readonly string[], upstream: string): string;
|
|
@@ -8,6 +8,7 @@ export declare function isInsideJsonString(content: string, offset: number): boo
|
|
|
8
8
|
export declare function substituteForJsonAsset(content: string, offset: number, value: string): string;
|
|
9
9
|
export declare function escapeForHtmlAsset(content: string, offset: number, value: string): string;
|
|
10
10
|
export declare function getEnvFileCandidates(browser: DevOptions['browser'], mode: string): string[];
|
|
11
|
+
export declare function isEnvFileForAnotherTarget(file: string): boolean;
|
|
11
12
|
export declare function looksLikeSecretName(name: string): boolean;
|
|
12
13
|
export declare class EnvPlugin {
|
|
13
14
|
readonly browser: DevOptions['browser'];
|
|
@@ -8,6 +8,7 @@ export declare class CompilationPlugin {
|
|
|
8
8
|
readonly zip?: boolean;
|
|
9
9
|
readonly zipSource?: boolean;
|
|
10
10
|
readonly zipFilename?: string;
|
|
11
|
+
readonly zipDir?: string;
|
|
11
12
|
readonly port?: number;
|
|
12
13
|
readonly command?: 'dev' | 'start' | 'preview' | 'build';
|
|
13
14
|
readonly define?: Record<string, unknown>;
|
|
@@ -17,6 +18,7 @@ export declare class CompilationPlugin {
|
|
|
17
18
|
zip?: boolean;
|
|
18
19
|
zipSource?: boolean;
|
|
19
20
|
zipFilename?: string;
|
|
21
|
+
zipDir?: string;
|
|
20
22
|
port?: number;
|
|
21
23
|
command?: 'dev' | 'start' | 'preview' | 'build';
|
|
22
24
|
define?: Record<string, unknown>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Compiler } from '@rspack/core';
|
|
2
|
+
type Diagnostic = {
|
|
3
|
+
message?: unknown;
|
|
4
|
+
module?: {
|
|
5
|
+
resource?: unknown;
|
|
6
|
+
} | null;
|
|
7
|
+
loc?: unknown;
|
|
8
|
+
};
|
|
9
|
+
export declare function dropRepeatedDiagnostics(diagnostics: Diagnostic[]): number;
|
|
10
|
+
export declare class OneDiagnosticPerLocationPlugin {
|
|
11
|
+
apply(compiler: Compiler): void;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Compiler } from '@rspack/core';
|
|
2
|
+
export interface FileRequestsOptions {
|
|
3
|
+
isFile?: (target: string) => boolean;
|
|
4
|
+
platform?: NodeJS.Platform;
|
|
5
|
+
}
|
|
6
|
+
export declare class FileRequestsPlugin {
|
|
7
|
+
static readonly name: string;
|
|
8
|
+
private readonly isFile;
|
|
9
|
+
private readonly platform;
|
|
10
|
+
constructor(options?: FileRequestsOptions);
|
|
11
|
+
rewrite(request: string): {
|
|
12
|
+
context: string;
|
|
13
|
+
request: string;
|
|
14
|
+
} | undefined;
|
|
15
|
+
apply(compiler: Compiler): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Compiler } from '@rspack/core';
|
|
2
|
+
export interface WarmAncestorWatchersOptions {
|
|
3
|
+
platform?: NodeJS.Platform;
|
|
4
|
+
realpath?: (target: string) => string;
|
|
5
|
+
pollMs?: number;
|
|
6
|
+
waitCapMs?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class WarmAncestorWatchersPlugin {
|
|
9
|
+
static readonly name: string;
|
|
10
|
+
private readonly platform;
|
|
11
|
+
private readonly realpath;
|
|
12
|
+
private readonly pollMs;
|
|
13
|
+
private readonly waitCapMs;
|
|
14
|
+
constructor(options?: WarmAncestorWatchersOptions);
|
|
15
|
+
private ancestorTargets;
|
|
16
|
+
private whenScanned;
|
|
17
|
+
private startScan;
|
|
18
|
+
apply(compiler: Compiler): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Compiler } from '@rspack/core';
|
|
2
|
+
type Paths = Iterable<string>;
|
|
3
|
+
type Times = Map<string, unknown> | undefined;
|
|
4
|
+
type Changes = Set<string> | undefined;
|
|
5
|
+
export interface WatchRealProjectPathOptions {
|
|
6
|
+
realpath?: (target: string) => string;
|
|
7
|
+
}
|
|
8
|
+
export declare class LinkedFolder {
|
|
9
|
+
private readonly linked;
|
|
10
|
+
private readonly real;
|
|
11
|
+
private readonly asked;
|
|
12
|
+
constructor(linked: string, real: string);
|
|
13
|
+
toReal(target: string): string;
|
|
14
|
+
realPaths(targets: Paths): string[];
|
|
15
|
+
askedPaths(real: string): string[];
|
|
16
|
+
askedSet(reals: Changes): Changes;
|
|
17
|
+
askedTimes(times: Times): Times;
|
|
18
|
+
}
|
|
19
|
+
export declare class WatchRealProjectPathPlugin {
|
|
20
|
+
static readonly name: string;
|
|
21
|
+
private readonly realpath;
|
|
22
|
+
constructor(options?: WatchRealProjectPathOptions);
|
|
23
|
+
private linkedFolder;
|
|
24
|
+
private wrap;
|
|
25
|
+
apply(compiler: Compiler): void;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -7,6 +7,7 @@ export interface ZipPluginOptions {
|
|
|
7
7
|
zip?: boolean;
|
|
8
8
|
zipSource?: boolean;
|
|
9
9
|
zipFilename?: string;
|
|
10
|
+
zipDir?: string;
|
|
10
11
|
};
|
|
11
12
|
}
|
|
12
13
|
export declare function sanitize(input: string): string;
|
|
@@ -14,6 +15,7 @@ export declare function isDeniedFromSourceZip(file: string): boolean;
|
|
|
14
15
|
export interface BuildOutput {
|
|
15
16
|
outPath: string;
|
|
16
17
|
archives: string[];
|
|
18
|
+
archiveDir?: string;
|
|
17
19
|
}
|
|
18
20
|
export declare function isBuildOutput(file: string, projectDir: string, output: BuildOutput): boolean;
|
|
19
21
|
export declare function getFilesToZip(projectDir: string, output?: BuildOutput): Promise<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { RuleSetRule } from '@rspack/core';
|
|
2
2
|
import type { DevOptions } from '../types.js';
|
|
3
3
|
import { type PreprocessorUsage } from './css-lib/build-css-rules.js';
|
|
4
|
-
export declare function cssInContentScriptLoader(projectPath: string, manifestPath: string, mode: DevOptions['mode'], usage?: PreprocessorUsage): Promise<RuleSetRule[]>;
|
|
4
|
+
export declare function cssInContentScriptLoader(projectPath: string, manifestPath: string, mode: DevOptions['mode'], usage?: PreprocessorUsage, browser?: DevOptions['browser']): Promise<RuleSetRule[]>;
|
|
@@ -9,6 +9,9 @@ interface BuildCssRulesOptions {
|
|
|
9
9
|
issuer?: RuleSetRule['issuer'];
|
|
10
10
|
issuerLayer?: RuleSetRule['issuerLayer'];
|
|
11
11
|
manifestPath?: string;
|
|
12
|
+
gecko?: boolean;
|
|
13
|
+
baseAttribute?: string;
|
|
14
|
+
baseScheme?: string;
|
|
12
15
|
}
|
|
13
16
|
export declare function buildCssRules(projectPath: string, mode: DevOptions['mode'], usage: PreprocessorUsage, opts: BuildCssRulesOptions): Promise<RuleSetRule[]>;
|
|
14
17
|
export {};
|
|
@@ -16,4 +16,6 @@ export declare function rewriteInlinedCssUrls(source: string, context: RewriteIn
|
|
|
16
16
|
css: string;
|
|
17
17
|
targets: InlinedCssUrlTarget[];
|
|
18
18
|
};
|
|
19
|
-
export declare
|
|
19
|
+
export declare const SFC_STYLE_ATTRIBUTE = "data-extjs-sfc-style";
|
|
20
|
+
export declare const SFC_SHEET_PROPERTY = "__extjsSfcSheet";
|
|
21
|
+
export declare function toRuntimeStylesheetModule(css: string, bundledRequests?: string[], styleId?: string, gecko?: boolean, baseAttribute?: string, baseScheme?: string): string;
|
|
@@ -8,6 +8,10 @@ export declare function cssParseErrorShippedVerbatim(resourcePath: string, error
|
|
|
8
8
|
export declare function preprocessorShippedUncompiled(resourcePath: string, tool: 'sass' | 'less'): string;
|
|
9
9
|
export declare function deadCssUrlRef(issuerPath: string, request: string): string;
|
|
10
10
|
export declare function lateCssImportIgnored(issuerPath: string, line?: number): string;
|
|
11
|
+
export declare function unplacedStyleImport(issuerPath: string, imports: Array<{
|
|
12
|
+
request: string;
|
|
13
|
+
line: number;
|
|
14
|
+
}>, declared: boolean): string;
|
|
11
15
|
export declare function postCssConfigUnreadable(configPath: string, error: unknown): string;
|
|
12
16
|
export declare function postCssConfigPluginsShape(configPath: string, found: string): string;
|
|
13
17
|
export declare function cssMinifierDroppedRules(assetName: string, tokens: string[]): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const SFC_STYLE_BLOCK_QUERY: RegExp;
|
|
2
|
+
export declare function isSfcStyleBlockQuery(query: string | undefined): boolean;
|
|
3
|
+
export declare const SFC_INLINE_STYLE_BLOCK_QUERY: RegExp;
|
|
4
|
+
export declare function isSfcInlineStyleBlockQuery(query: string | undefined): boolean;
|
|
5
|
+
export declare const SFC_MODULE_STYLE_BLOCK_QUERY: RegExp;
|
|
6
|
+
export declare function isSfcModuleStyleBlockQuery(query: string | undefined): boolean;
|
|
7
|
+
interface StyleBlockLoader {
|
|
8
|
+
path?: string;
|
|
9
|
+
request?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function moduleStyleBlockRequest(input: {
|
|
12
|
+
resourcePath: string;
|
|
13
|
+
resourceQuery: string;
|
|
14
|
+
loaders: StyleBlockLoader[];
|
|
15
|
+
ownPath: string | undefined;
|
|
16
|
+
}): string | undefined;
|
|
17
|
+
export declare const SVELTE_STYLE_BLOCK_TEST: RegExp;
|
|
18
|
+
export declare function isSvelteStyleBlockPath(resourcePath: string | undefined): boolean;
|
|
19
|
+
export declare function isSfcStyleBlock(module: {
|
|
20
|
+
resourcePath?: string;
|
|
21
|
+
resourceQuery?: string;
|
|
22
|
+
}): boolean;
|
|
23
|
+
export declare function readStyleBlockProxyRequest(source: string): string | undefined;
|
|
24
|
+
export declare function sfcStyleBlockId(relativePath: string, query: string, devSalt: string): string;
|
|
25
|
+
export declare function dropSourceMapComment(css: string): string;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface UnplacedStyleImport {
|
|
2
|
+
request: string;
|
|
3
|
+
line: number;
|
|
4
|
+
}
|
|
5
|
+
export declare function blankComments(source: string): string;
|
|
6
|
+
export declare function findUnplacedStyleImports(source: string): UnplacedStyleImport[];
|
|
7
|
+
export declare function namesShadowHost(source: string): boolean;
|
|
@@ -7,4 +7,5 @@ export declare function takeVerbatimCss(id: string): string | undefined;
|
|
|
7
7
|
export declare function cssRelativeRefs(text: string): string[];
|
|
8
8
|
export declare function restoreVerbatimCssAssets(compilation: Pick<Compilation, 'getAssets' | 'updateAsset'> & Partial<Pick<Compilation, 'emitAsset' | 'getAsset'>>): string[];
|
|
9
9
|
export declare function cssSelectorTokens(text: string): Set<string>;
|
|
10
|
+
export declare function withoutEmptyCssRules(text: string): string;
|
|
10
11
|
export declare function minifierDroppedTokens(before: string, after: string): string[];
|
|
@@ -5,14 +5,22 @@ interface CompilationLike {
|
|
|
5
5
|
export interface DeadCssUrlLoaderOptions {
|
|
6
6
|
manifestPath?: string;
|
|
7
7
|
projectPath?: string;
|
|
8
|
+
gecko?: boolean;
|
|
9
|
+
baseAttribute?: string;
|
|
10
|
+
baseScheme?: string;
|
|
8
11
|
}
|
|
9
|
-
interface DeadCssUrlLoaderContext {
|
|
12
|
+
export interface DeadCssUrlLoaderContext {
|
|
10
13
|
resourcePath: string;
|
|
14
|
+
resourceQuery?: string;
|
|
11
15
|
getOptions(): DeadCssUrlLoaderOptions;
|
|
12
16
|
emitWarning(warning: Error): void;
|
|
13
17
|
emitError(error: Error): void;
|
|
14
18
|
addDependency?(file: string): void;
|
|
15
19
|
_compilation?: CompilationLike;
|
|
16
20
|
}
|
|
21
|
+
export declare function inlineStylesheetUrls(loader: DeadCssUrlLoaderContext, source: string): {
|
|
22
|
+
css: string;
|
|
23
|
+
bundledRequests: string[];
|
|
24
|
+
};
|
|
17
25
|
export default function deadCssUrlLoader(this: DeadCssUrlLoaderContext, source: string): string;
|
|
18
26
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type DeadCssUrlLoaderContext } from './dead-css-url-loader.js';
|
|
2
|
+
interface SfcStyleBlockLoaderContext extends DeadCssUrlLoaderContext {
|
|
3
|
+
mode?: string;
|
|
4
|
+
loaderIndex?: number;
|
|
5
|
+
loaders?: Array<{
|
|
6
|
+
path?: string;
|
|
7
|
+
request?: string;
|
|
8
|
+
}>;
|
|
9
|
+
context?: string;
|
|
10
|
+
utils?: {
|
|
11
|
+
contextify?(context: string, request: string): string;
|
|
12
|
+
};
|
|
13
|
+
async(): (error: Error | null, content?: string) => void;
|
|
14
|
+
importModule(request: string, options: Record<string, unknown>, callback: (error: Error | null | undefined, exports: unknown) => void): void;
|
|
15
|
+
}
|
|
16
|
+
export default function sfcStyleBlockLoader(this: SfcStyleBlockLoaderContext, source: string): string | undefined;
|
|
17
|
+
export declare function pitch(this: SfcStyleBlockLoaderContext): string | undefined;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface UnplacedStyleImportLoaderContext {
|
|
2
|
+
resourcePath: string;
|
|
3
|
+
rootContext?: string;
|
|
4
|
+
getOptions?: () => {
|
|
5
|
+
projectPath?: string;
|
|
6
|
+
declaredEntries?: string[];
|
|
7
|
+
};
|
|
8
|
+
emitWarning(warning: Error): void;
|
|
9
|
+
_compilation?: {
|
|
10
|
+
warnings?: Error[];
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare function comparablePathKey(file: string, platform?: string): string;
|
|
14
|
+
export declare function isDeclaredEntry(resource: string, declaredEntries: string[], platform?: string): boolean;
|
|
15
|
+
export default function unplacedStyleImportLoader(this: UnplacedStyleImportLoaderContext, source: string): string;
|
|
16
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Compiler } from '@rspack/core';
|
|
2
|
+
import { type DevAddition } from '../lib/dev-additions.js';
|
|
2
3
|
import { type ManagedExtensionRecord } from '../lib/extension-id.js';
|
|
3
4
|
import { type AbsolutePath } from '../lib/paths.js';
|
|
4
5
|
export type PlaywrightAutomationCommand = 'dev' | 'start' | 'preview' | 'build';
|
|
@@ -16,6 +17,7 @@ export type ReadyMetadata = {
|
|
|
16
17
|
port: number | null;
|
|
17
18
|
host?: string;
|
|
18
19
|
pid: number;
|
|
20
|
+
pidStartedAt: string;
|
|
19
21
|
ts: string;
|
|
20
22
|
compiledAt: string | null;
|
|
21
23
|
errors: string[];
|
|
@@ -34,13 +36,28 @@ export type ReadyMetadata = {
|
|
|
34
36
|
webdriverSessionId?: string;
|
|
35
37
|
webdriverUnavailableReason?: string;
|
|
36
38
|
webdriverRequestPath?: string;
|
|
39
|
+
safari?: {
|
|
40
|
+
bundleId: string;
|
|
41
|
+
extensionId: string;
|
|
42
|
+
team: string;
|
|
43
|
+
switchId: string;
|
|
44
|
+
enableAttempted: boolean;
|
|
45
|
+
step: string;
|
|
46
|
+
enabled: boolean | null;
|
|
47
|
+
listed: boolean | null;
|
|
48
|
+
otherWebsites: string | null;
|
|
49
|
+
reason?: string;
|
|
50
|
+
earlierExtensionIds?: string[];
|
|
51
|
+
};
|
|
37
52
|
reloadedAt?: string;
|
|
38
53
|
reloadKind?: string;
|
|
39
54
|
reloadLabel?: string;
|
|
40
55
|
profilePath?: string;
|
|
41
56
|
browserPid?: number | null;
|
|
57
|
+
browserStartedAt?: string;
|
|
42
58
|
engine?: 'emulator';
|
|
43
59
|
launcherPid?: number;
|
|
60
|
+
launcherStartedAt?: string;
|
|
44
61
|
toolchainVersion: string;
|
|
45
62
|
extensionName?: string;
|
|
46
63
|
extensionVersion?: string;
|
|
@@ -58,6 +75,7 @@ export type ReadyMetadata = {
|
|
|
58
75
|
executorAttachedAt?: string;
|
|
59
76
|
extensionBaseUrl?: string;
|
|
60
77
|
managedExtensions?: ManagedExtensionRecord[];
|
|
78
|
+
devAdditions?: DevAddition[];
|
|
61
79
|
};
|
|
62
80
|
export type PlaywrightAutomationEvent = {
|
|
63
81
|
type: 'compile_start' | 'compile_success' | 'compile_error' | 'shutdown' | 'browser_exited' | 'browser_launch_failed';
|
|
@@ -91,6 +109,7 @@ type WriterOptions = {
|
|
|
91
109
|
logsPath?: string;
|
|
92
110
|
managedExtensionDirs?: string[];
|
|
93
111
|
readyAwaitsRdpPort?: boolean;
|
|
112
|
+
readyAwaitsExecutor?: boolean;
|
|
94
113
|
};
|
|
95
114
|
type PluginOptions = {
|
|
96
115
|
packageJsonDir: string;
|
|
@@ -110,7 +129,9 @@ type PluginOptions = {
|
|
|
110
129
|
managedExtensionDirs?: string[];
|
|
111
130
|
launchFollows?: boolean;
|
|
112
131
|
readyAwaitsRdpPort?: boolean;
|
|
132
|
+
readyAwaitsExecutor?: boolean;
|
|
113
133
|
};
|
|
134
|
+
export declare const READY_EXECUTOR_WAIT_MS = 10000;
|
|
114
135
|
export declare function formatStatsErrors(errors: unknown): string[];
|
|
115
136
|
export declare function getSessionRunId(packageJsonDir: string, browser: string): string;
|
|
116
137
|
export type ExtensionIdSource = 'browser' | 'derived' | 'packager';
|
|
@@ -132,6 +153,7 @@ export declare function createPlaywrightMetadataWriter(options: WriterOptions):
|
|
|
132
153
|
readyPath: AbsolutePath;
|
|
133
154
|
eventsPath: AbsolutePath;
|
|
134
155
|
setManagedExtensionDirs(dirs: string[]): void;
|
|
156
|
+
setDevAdditions(additions: DevAddition[]): void;
|
|
135
157
|
isSuperseded: () => boolean;
|
|
136
158
|
writeStarting(): void;
|
|
137
159
|
writeCompiled(compiledAt: string): void;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
export type ReloadType = 'full' | 'service-worker' | 'content-scripts';
|
|
2
|
+
export interface RefreshedStylesheet {
|
|
3
|
+
file: string;
|
|
4
|
+
digest: string;
|
|
5
|
+
}
|
|
2
6
|
export interface ReloadInstruction {
|
|
3
7
|
type: ReloadType | 'page';
|
|
4
8
|
changedContentScriptEntries?: string[];
|
|
5
9
|
staticContentScriptEntries?: string[];
|
|
6
10
|
changedAssets?: string[];
|
|
7
11
|
changedScriptFiles?: string[];
|
|
12
|
+
refreshedStylesheets?: RefreshedStylesheet[];
|
|
13
|
+
standalonePages?: string[];
|
|
8
14
|
label?: string;
|
|
9
15
|
}
|
|
10
16
|
/** "context (fileA, fileB +2 more)", the one label every reload surface shows. */
|
|
@@ -29,8 +35,22 @@ export declare function classifyReloadFromSources(opts: {
|
|
|
29
35
|
getContentScriptCount: () => number;
|
|
30
36
|
getSourceFeatureIndex?: () => SourceFeatureIndex | null;
|
|
31
37
|
outputPath?: string;
|
|
38
|
+
contextDir?: string;
|
|
32
39
|
}): ReloadInstruction | undefined;
|
|
33
40
|
export declare function readStaticContentScriptEntries(outputPath?: string): string[];
|
|
34
41
|
export declare function readContentScriptFiles(compilation: import('@rspack/core').Compilation): string[];
|
|
42
|
+
export declare function readContentScriptDigests(compilation: import('@rspack/core').Compilation, files: string[]): Record<string, string>;
|
|
43
|
+
export declare function reloadForRewrittenContentScripts(instruction: ReloadInstruction | undefined, loadedDigests: Record<string, string>, emittedDigests: Record<string, string>, options?: {
|
|
44
|
+
refreshInPlace?: boolean;
|
|
45
|
+
}): ReloadInstruction | undefined;
|
|
35
46
|
export declare function reloadForRenamedContentScripts(instruction: ReloadInstruction | undefined, loadedFiles: string[], emittedFiles: string[]): ReloadInstruction | undefined;
|
|
47
|
+
export declare function readWebAccessibleResources(compilation: import('@rspack/core').Compilation): string[];
|
|
48
|
+
export declare function reloadForNewWebResources(instruction: ReloadInstruction | undefined, loadedResources: string[], emittedResources: string[]): ReloadInstruction | undefined;
|
|
49
|
+
export declare function createLoadedContentScripts(options: {
|
|
50
|
+
refreshInPlace: boolean;
|
|
51
|
+
}): {
|
|
52
|
+
noteLoaded(compilation: import('@rspack/core').Compilation): void;
|
|
53
|
+
resolve(compilation: import('@rspack/core').Compilation, classified: ReloadInstruction | undefined): ReloadInstruction | undefined;
|
|
54
|
+
settle(delivered: boolean): void;
|
|
55
|
+
};
|
|
36
56
|
export declare function readContentScriptCount(compilation: import('@rspack/core').Compilation, outputPath: string): number;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Compiler } from '@rspack/core';
|
|
2
2
|
import type { DevOptions, PluginInterface } from '../types.js';
|
|
3
|
-
|
|
4
|
-
export {
|
|
3
|
+
import { readBootRegistrations, readDevBuild } from './steps/inject-bridge-producer.js';
|
|
4
|
+
export { buildSourceFeatureIndex, classifyReloadFromSources, createLoadedContentScripts, formatReloadContextLabel, pageContextFromSources, publicOutputPath, type ReloadInstruction, type ReloadType, readContentScriptCount, readContentScriptDigests, readContentScriptFiles, readWebAccessibleResources, reloadForNewWebResources, reloadForRenamedContentScripts, reloadForRewrittenContentScripts, type SourceFeatureIndex } from './classify-reload.js';
|
|
5
|
+
export { type ChangedSourcesSnapshot, type ChangedSourcesTracker, createChangedSourcesTracker, dispatchReload, dispatchRestartReload, fullReloadsDeliveredTo, type ReloadBroker, type ReloadExecutor, type ReloadKind, reloadKindFor, type UndeliveredReloadContext } from './reload-dispatch.js';
|
|
6
|
+
export { readBootRegistrations, readDevBuild };
|
|
5
7
|
export { SetupChunkLoadingTarget } from './steps/setup-chunk-loading-target.js';
|
|
6
8
|
/**
|
|
7
9
|
* ReloadPlugin owns the dev-only reload/HMR strategy end to end:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Compiler } from '@rspack/core';
|
|
2
|
-
import type { ReloadAckOutcome } from '../dev-server/control-bridge/contracts.js';
|
|
2
|
+
import type { BootRegistrationsOutcome, LateReloadRestart, ReloadAckOutcome, ReloadRestartOutcome } from '../dev-server/control-bridge/contracts.js';
|
|
3
3
|
import type { ReloadInstruction } from './classify-reload.js';
|
|
4
4
|
export interface UndeliveredReloadContext {
|
|
5
5
|
producerRestartExpected?: boolean;
|
|
@@ -11,9 +11,21 @@ export interface ReloadBroker {
|
|
|
11
11
|
label?: string;
|
|
12
12
|
changedFiles?: string[];
|
|
13
13
|
changedScriptFiles?: string[];
|
|
14
|
+
refreshedStylesheets?: {
|
|
15
|
+
file: string;
|
|
16
|
+
digest: string;
|
|
17
|
+
}[];
|
|
18
|
+
standalonePages?: string[];
|
|
19
|
+
build?: string;
|
|
14
20
|
}): number;
|
|
21
|
+
runsBuild?(build: string): boolean;
|
|
15
22
|
undeliveredReloadWarning?(context?: UndeliveredReloadContext): string | null;
|
|
23
|
+
deliverLatchedReload?(): Promise<boolean>;
|
|
16
24
|
awaitReloadAck?(): Promise<ReloadAckOutcome>;
|
|
25
|
+
reloadReplayedTabs?(): number;
|
|
26
|
+
awaitReloadRestart?(): Promise<ReloadRestartOutcome>;
|
|
27
|
+
awaitLateReloadRestart?(): Promise<LateReloadRestart | null>;
|
|
28
|
+
awaitBootRegistrations?(timeoutMs: number): Promise<BootRegistrationsOutcome>;
|
|
17
29
|
noteReloadApplied?(kind: ReloadKind, label?: string): void;
|
|
18
30
|
}
|
|
19
31
|
export type ReloadKind = 'full' | 'background' | 'content' | 'page' | 'safari-resync';
|
|
@@ -21,11 +33,18 @@ export declare function reloadKindFor(type: ReloadInstruction['type']): ReloadKi
|
|
|
21
33
|
export interface ReloadExecutor {
|
|
22
34
|
broker?: ReloadBroker;
|
|
23
35
|
producerRestartExpected?: boolean;
|
|
36
|
+
build?: string;
|
|
24
37
|
}
|
|
38
|
+
export declare const DEV_BUILD_GLOBAL = "__extjsDevBuild";
|
|
25
39
|
export declare function formatReloadingLine(label: string): string;
|
|
40
|
+
export declare function appliedReloadLine(instruction: ReloadInstruction, broker: ReloadBroker): string;
|
|
26
41
|
export declare function formatUnappliedReloadLine(label: string): string;
|
|
42
|
+
export declare function formatNotRestartedLine(label: string): string;
|
|
43
|
+
export declare function formatLateRestartLine(label: string, late: LateReloadRestart): string;
|
|
27
44
|
export declare function formatQueuedReloadLine(label: string): string;
|
|
28
|
-
export declare function
|
|
45
|
+
export declare function fullReloadsDeliveredTo(broker: ReloadBroker | undefined): number;
|
|
46
|
+
export declare function dispatchRestartReload(executor: ReloadExecutor, fullReloadsBefore: number): Promise<boolean>;
|
|
47
|
+
export declare function dispatchReload(instruction: ReloadInstruction | undefined, executor: ReloadExecutor): Promise<boolean>;
|
|
29
48
|
export interface ChangedSourcesSnapshot {
|
|
30
49
|
forcedFull: boolean;
|
|
31
50
|
changedSources: string[];
|
|
@@ -18,6 +18,10 @@ export interface DevContentScriptRegistryEntry {
|
|
|
18
18
|
matchOriginAsFallback?: boolean;
|
|
19
19
|
stubOnly: boolean;
|
|
20
20
|
static?: true;
|
|
21
|
+
sheetProbe?: {
|
|
22
|
+
file: string;
|
|
23
|
+
property: string;
|
|
24
|
+
};
|
|
21
25
|
}
|
|
22
26
|
export interface DevContentScriptRegistry {
|
|
23
27
|
version: 1;
|
|
@@ -30,6 +34,8 @@ export interface DevContentScriptPlan {
|
|
|
30
34
|
}
|
|
31
35
|
export declare function devContentScriptStubAssetName(index: number): string;
|
|
32
36
|
export declare function devContentScriptCssMarkerAssetName(index: number): string;
|
|
37
|
+
export declare function devContentScriptSheetProbeAssetName(index: number): string;
|
|
38
|
+
export declare function devContentScriptSheetProbeProperty(index: number): string;
|
|
33
39
|
export declare function isDevContentScriptStandInAsset(assetName: string): boolean;
|
|
34
40
|
export declare function contentScriptEntryForAsset(assetName: string): string | undefined;
|
|
35
41
|
export declare function planDevContentScripts(manifest: Manifest): DevContentScriptPlan | undefined;
|