extension-develop 4.1.12 → 4.1.14
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 +147 -81
- package/dist/0~rspack-config.mjs +1098 -694
- package/dist/0~zip.mjs +1 -1
- package/dist/101.mjs +190 -900
- package/dist/129.mjs +89 -0
- package/dist/278.mjs +52 -0
- package/dist/292.mjs +61 -0
- package/dist/372.mjs +87 -0
- package/dist/518.mjs +434 -0
- package/dist/77.mjs +933 -0
- package/dist/80.mjs +6 -4
- package/dist/839.mjs +176 -39
- package/dist/845.mjs +10 -1
- package/dist/887.mjs +1 -1
- package/dist/bridge-entry.d.ts +2 -1
- package/dist/bridge.mjs +56 -7
- package/dist/css-parse-guard-loader.mjs +3 -0
- package/dist/dead-css-url-loader.mjs +51 -24
- package/dist/dev-server/cleanup.d.ts +2 -1
- package/dist/dev-server/control-bridge/broker.d.ts +1 -0
- package/dist/dev-server/control-bridge/contracts.d.ts +2 -0
- package/dist/dev-server/control-bridge/logs-query.d.ts +12 -1
- package/dist/dev-server/control-bridge/producer-runtime.d.ts +1 -1
- package/dist/dev-server/messages.d.ts +8 -0
- package/dist/dev-server/session-restart.d.ts +29 -0
- package/dist/ensure-hmr-for-scripts.js +37 -20
- package/dist/ensure-hmr-for-scripts.mjs +37 -20
- package/dist/extension-js-devtools/chrome/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/chrome/scripts/logger-client.js +1 -1
- package/dist/extension-js-devtools/chromium/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/chromium/scripts/logger-client.js +1 -1
- package/dist/extension-js-devtools/edge/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/edge/scripts/logger-client.js +1 -1
- package/dist/extension-js-devtools/firefox/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/firefox/scripts/logger-client.js +1 -1
- package/dist/feature-scripts-classic-concat-loader.js +58 -5
- package/dist/feature-scripts-classic-concat-loader.mjs +58 -5
- package/dist/feature-scripts-content-script-wrapper.js +14 -17
- package/dist/feature-scripts-content-script-wrapper.mjs +14 -17
- package/dist/feature-scripts-native-geturl-import-loader.mjs +10 -3
- package/dist/lib/asset-source-maps.d.ts +7 -0
- package/dist/lib/config-loader.d.ts +7 -34
- package/dist/lib/loader-source-maps.d.ts +17 -0
- package/dist/lib/messages.d.ts +1 -0
- package/dist/lib/msg-placeholders.d.ts +2 -0
- package/dist/lib/paths.d.ts +2 -0
- package/dist/lib/project.d.ts +3 -0
- package/dist/lib/session-project-root.d.ts +1 -0
- package/dist/minimum-script-file.js +41 -1
- package/dist/minimum-script-file.mjs +41 -1
- package/dist/module.d.ts +1 -1
- package/dist/module.mjs +1 -1
- package/dist/plugin-css/css-lib/dead-url-refs.d.ts +5 -0
- package/dist/plugin-css/css-lib/inline-content-script-css.d.ts +32 -0
- package/dist/plugin-css/css-lib/messages.d.ts +3 -0
- package/dist/plugin-css/css-lib/verbatim-css.d.ts +9 -0
- package/dist/plugin-css/css-parse-guard-loader.d.ts +3 -0
- package/dist/plugin-css/css-tools/postcss.d.ts +1 -0
- package/dist/plugin-css/dead-css-url-loader.d.ts +8 -4
- package/dist/plugin-css/index.d.ts +1 -0
- package/dist/plugin-js-frameworks/js-frameworks-lib/jsx-transform.d.ts +10 -0
- package/dist/plugin-js-frameworks/js-tools/solid-jsx-runtime.d.ts +8 -0
- package/dist/plugin-js-frameworks/js-tools/solid.d.ts +3 -0
- package/dist/plugin-js-frameworks/swc-targets.d.ts +3 -0
- package/dist/plugin-reload/classify-reload.d.ts +6 -0
- package/dist/plugin-reload/index.d.ts +2 -1
- package/dist/plugin-reload/reload-dispatch.d.ts +1 -0
- package/dist/plugin-special-folders/folder-extensions/resolve-dirs.d.ts +1 -0
- package/dist/plugin-special-folders/folder-extensions/utils.d.ts +3 -0
- package/dist/plugin-special-folders/messages.d.ts +2 -0
- package/dist/plugin-special-folders/resolve-public-folder.d.ts +13 -0
- package/dist/plugin-web-extension/feature-html/html-lib/assets.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/html-lib/base-href.d.ts +11 -0
- package/dist/plugin-web-extension/feature-html/html-lib/patch-html.d.ts +2 -2
- package/dist/plugin-web-extension/feature-html/html-lib/utils.d.ts +13 -0
- package/dist/plugin-web-extension/feature-html/index.d.ts +1 -0
- package/dist/plugin-web-extension/feature-html/steps/ensure-hmr-for-scripts.d.ts +1 -1
- package/dist/plugin-web-extension/feature-icons/extract-action-theme-icons.d.ts +2 -0
- package/dist/plugin-web-extension/feature-icons/omnibox-fields.d.ts +2 -0
- package/dist/plugin-web-extension/feature-icons/theme-image-fields.d.ts +2 -0
- package/dist/plugin-web-extension/feature-json/json-validation.d.ts +1 -0
- package/dist/plugin-web-extension/feature-manifest/index.d.ts +1 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/manifest.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/sandbox.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/storage.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/theme.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/chrome_settings_overrides.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/theme_experiment.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/action.d.ts +2 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/declarative_net_request.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/messages.d.ts +2 -0
- package/dist/plugin-web-extension/feature-manifest/normalize-manifest-path.d.ts +4 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-csp.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults.d.ts +1 -0
- package/dist/plugin-web-extension/feature-scripts/steps/native-geturl-import-loader.d.ts +7 -2
- package/dist/plugin-web-extension/feature-web-resources/collect-entry-imports.d.ts +1 -0
- package/dist/plugin-web-extension/index.d.ts +1 -0
- package/dist/plugin-web-extension/shared/html-surfaces.d.ts +19 -0
- package/dist/plugin-web-extension/shared/manifest-fields-change-detector.d.ts +1 -0
- package/dist/plugin-web-extension/shared/manifest-fields.d.ts +18 -0
- package/dist/plugin-web-extension/shared/manifest-path-assets.d.ts +4 -0
- package/dist/plugin-web-extension/shared/paths.d.ts +1 -0
- package/dist/solid-jsx-runtime.mjs +15 -0
- package/dist/types.d.ts +20 -7
- package/package.json +1 -1
- package/dist/494.mjs +0 -89
- package/dist/86.mjs +0 -36
|
@@ -1,39 +1,12 @@
|
|
|
1
1
|
import type { Configuration } from '@rspack/core';
|
|
2
|
-
import type { BrowserConfig, DevOptions } from '../types';
|
|
2
|
+
import type { BrowserConfig, DevOptions, FileConfig } from '../types';
|
|
3
3
|
export declare function getPreloadedEnvKeys(): ReadonlySet<string>;
|
|
4
4
|
export declare function loadCustomConfig(projectPath: string): Promise<(config: Configuration) => Configuration>;
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
extensions: import("../module").CompanionExtensionsConfig;
|
|
11
|
-
transpilePackages: string[];
|
|
12
|
-
perfBudgets?: undefined;
|
|
13
|
-
} | {
|
|
14
|
-
extensions: import("../module").CompanionExtensionsConfig;
|
|
15
|
-
transpilePackages?: undefined;
|
|
16
|
-
perfBudgets: Partial<Record<import("../plugin-perf-budgets").AssetCategory, number>>;
|
|
17
|
-
} | {
|
|
18
|
-
extensions: import("../module").CompanionExtensionsConfig;
|
|
19
|
-
transpilePackages?: undefined;
|
|
20
|
-
perfBudgets?: undefined;
|
|
21
|
-
} | {
|
|
22
|
-
extensions?: undefined;
|
|
23
|
-
transpilePackages: string[];
|
|
24
|
-
perfBudgets: Partial<Record<import("../plugin-perf-budgets").AssetCategory, number>>;
|
|
25
|
-
} | {
|
|
26
|
-
extensions?: undefined;
|
|
27
|
-
transpilePackages: string[];
|
|
28
|
-
perfBudgets?: undefined;
|
|
29
|
-
} | {
|
|
30
|
-
extensions?: undefined;
|
|
31
|
-
transpilePackages?: undefined;
|
|
32
|
-
perfBudgets: Partial<Record<import("../plugin-perf-budgets").AssetCategory, number>>;
|
|
33
|
-
} | {
|
|
34
|
-
extensions?: undefined;
|
|
35
|
-
transpilePackages?: undefined;
|
|
36
|
-
perfBudgets?: undefined;
|
|
37
|
-
}>;
|
|
5
|
+
export type ProjectConfigDefaults = Pick<FileConfig, 'extensions' | 'transpilePackages' | 'perfBudgets'>;
|
|
6
|
+
export declare function loadProjectConfigDefaults(projectPath: string): Promise<ProjectConfigDefaults>;
|
|
7
|
+
type CommandConfigs = NonNullable<FileConfig['commands']>;
|
|
8
|
+
export type CommandLayerConfig = Partial<CommandConfigs['dev'] & CommandConfigs['build'] & CommandConfigs['start'] & CommandConfigs['preview']> & ProjectConfigDefaults;
|
|
9
|
+
export declare function loadCommandConfig(projectPath: string, command: 'dev' | 'build' | 'start' | 'preview'): Promise<CommandLayerConfig>;
|
|
38
10
|
export declare function loadBrowserConfig(projectPath: string, browser?: DevOptions['browser']): Promise<BrowserConfig>;
|
|
39
11
|
export declare function isUsingExperimentalConfig(projectPath: string): Promise<boolean>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface LoaderSourceMap {
|
|
2
|
+
version: 3;
|
|
3
|
+
file: string;
|
|
4
|
+
sources: string[];
|
|
5
|
+
sourcesContent?: string[];
|
|
6
|
+
names: string[];
|
|
7
|
+
mappings: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function identityLineMap(resourcePath: string, source: string): LoaderSourceMap;
|
|
10
|
+
export declare function isLoaderSourceMap(value: unknown): value is LoaderSourceMap;
|
|
11
|
+
export declare function inputOrIdentityMap(inputSourceMap: unknown, resourcePath: string, source: string): LoaderSourceMap;
|
|
12
|
+
export declare function adjustLoaderSourceMap(map: LoaderSourceMap, options: {
|
|
13
|
+
prefix?: string;
|
|
14
|
+
before: string;
|
|
15
|
+
after: string;
|
|
16
|
+
}): LoaderSourceMap;
|
|
17
|
+
export declare function returnWithMap(context: unknown, text: string, map: LoaderSourceMap): string | undefined;
|
package/dist/lib/messages.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export declare function isUsingExperimentalConfig(integration: unknown): string;
|
|
|
58
58
|
export declare function debugDirs(manifestDir: string, packageJsonDir: string): string;
|
|
59
59
|
export declare function debugBrowser(browser: DevOptions['browser'], chromiumBinary?: string, geckoBinary?: string): string;
|
|
60
60
|
export declare function debugOutputPath(pathValue: string): string;
|
|
61
|
+
export declare function previewingCustomOutput(browser: DevOptions['browser'], outputPath: string, distPath: string): string;
|
|
61
62
|
export declare function debugPreviewOutput(outputPath: string, distPath: string): string;
|
|
62
63
|
export declare function debugContextPath(packageJsonDir: string): string;
|
|
63
64
|
export declare function debugExtensionsToLoad(extensions: string[]): string;
|
package/dist/lib/paths.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export declare function getDirs(struct: ProjectStructure): {
|
|
|
12
12
|
};
|
|
13
13
|
export declare function getNodeModulesDir(packageJsonDir: AbsolutePath): AbsolutePath;
|
|
14
14
|
export declare function needsInstall(packageJsonDir: AbsolutePath): boolean;
|
|
15
|
+
export declare function isKnownBrowserName(name: unknown): boolean;
|
|
16
|
+
export declare function configBrowserOrThrow(configBrowser: unknown, command: string): BrowserInput | undefined;
|
|
15
17
|
export declare function normalizeBrowser(browser: BrowserInput, chromiumBinary?: string, geckoBinary?: string, safariBinary?: string): NormalizedBrowser;
|
|
16
18
|
export declare function getDistPath(packageJsonDir: AbsolutePath, browser: string): AbsolutePath;
|
|
17
19
|
export declare function computePreviewOutputPath(struct: ProjectStructure, browser: string, explicitOutputPath?: string): AbsolutePath;
|
package/dist/lib/project.d.ts
CHANGED
|
@@ -5,3 +5,6 @@ export interface ProjectStructure {
|
|
|
5
5
|
}
|
|
6
6
|
export declare function getProjectPath(pathOrRemoteUrl: string | undefined): Promise<string>;
|
|
7
7
|
export declare function getProjectStructure(pathOrRemoteUrl: string | undefined): Promise<ProjectStructure>;
|
|
8
|
+
export declare function resolveProjectStructureSync(projectPath: string, options?: {
|
|
9
|
+
quiet?: boolean;
|
|
10
|
+
}): ProjectStructure;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resolveSessionProjectRoot(pathArg?: string): string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
const safeLocation = "u" > typeof globalThis ? globalThis.location : void 0;
|
|
2
2
|
const safeHistory = "u" > typeof globalThis ? globalThis.history : void 0;
|
|
3
|
+
const isExtensionPage = 'object' == typeof safeLocation && !!safeLocation && String(safeLocation.protocol || '').includes('-extension:');
|
|
3
4
|
try {
|
|
4
|
-
if (
|
|
5
|
+
if (isExtensionPage && safeLocation) {
|
|
5
6
|
const q = String(safeLocation.search || '').toLowerCase();
|
|
6
7
|
const hasStaleGuards = q.includes('rspack-dev-server-hot=false') || q.includes('webpack-dev-server-hot=false');
|
|
7
8
|
if (hasStaleGuards && 'function' == typeof URL && 'object' == typeof safeHistory && safeHistory && 'function' == typeof safeHistory.replaceState) {
|
|
@@ -12,3 +13,42 @@ try {
|
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
} catch {}
|
|
16
|
+
async function ownMarkup() {
|
|
17
|
+
try {
|
|
18
|
+
const href = String(safeLocation?.href || '').split('#')[0];
|
|
19
|
+
if (!href) return null;
|
|
20
|
+
const response = await fetch(href, {
|
|
21
|
+
cache: 'no-store'
|
|
22
|
+
});
|
|
23
|
+
return response.ok ? await response.text() : null;
|
|
24
|
+
} catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
const scope = globalThis;
|
|
30
|
+
if (isExtensionPage && safeLocation && 'function' == typeof fetch && 'function' == typeof scope.addEventListener) {
|
|
31
|
+
let loadedMarkup = null;
|
|
32
|
+
let comparing = false;
|
|
33
|
+
ownMarkup().then((markup)=>{
|
|
34
|
+
loadedMarkup = markup;
|
|
35
|
+
});
|
|
36
|
+
scope.addEventListener('message', (event)=>{
|
|
37
|
+
const data = event?.data;
|
|
38
|
+
if ('string' != typeof data || !data.startsWith('webpackHotUpdate')) return;
|
|
39
|
+
if (comparing || null == loadedMarkup) return;
|
|
40
|
+
comparing = true;
|
|
41
|
+
const compare = async (attempt)=>{
|
|
42
|
+
const markup = await ownMarkup();
|
|
43
|
+
if (null != markup && markup !== loadedMarkup) {
|
|
44
|
+
comparing = false;
|
|
45
|
+
if ('function' == typeof safeLocation.reload) safeLocation.reload();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (attempt < 1) return void setTimeout(()=>void compare(attempt + 1), 500);
|
|
49
|
+
comparing = false;
|
|
50
|
+
};
|
|
51
|
+
compare(0);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
} catch {}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
const safeLocation = "u" > typeof globalThis ? globalThis.location : void 0;
|
|
2
2
|
const safeHistory = "u" > typeof globalThis ? globalThis.history : void 0;
|
|
3
|
+
const isExtensionPage = 'object' == typeof safeLocation && !!safeLocation && String(safeLocation.protocol || '').includes('-extension:');
|
|
3
4
|
try {
|
|
4
|
-
if (
|
|
5
|
+
if (isExtensionPage && safeLocation) {
|
|
5
6
|
const q = String(safeLocation.search || '').toLowerCase();
|
|
6
7
|
const hasStaleGuards = q.includes('rspack-dev-server-hot=false') || q.includes('webpack-dev-server-hot=false');
|
|
7
8
|
if (hasStaleGuards && 'function' == typeof URL && 'object' == typeof safeHistory && safeHistory && 'function' == typeof safeHistory.replaceState) {
|
|
@@ -12,3 +13,42 @@ try {
|
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
} catch {}
|
|
16
|
+
async function ownMarkup() {
|
|
17
|
+
try {
|
|
18
|
+
const href = String(safeLocation?.href || '').split('#')[0];
|
|
19
|
+
if (!href) return null;
|
|
20
|
+
const response = await fetch(href, {
|
|
21
|
+
cache: 'no-store'
|
|
22
|
+
});
|
|
23
|
+
return response.ok ? await response.text() : null;
|
|
24
|
+
} catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
const scope = globalThis;
|
|
30
|
+
if (isExtensionPage && safeLocation && 'function' == typeof fetch && 'function' == typeof scope.addEventListener) {
|
|
31
|
+
let loadedMarkup = null;
|
|
32
|
+
let comparing = false;
|
|
33
|
+
ownMarkup().then((markup)=>{
|
|
34
|
+
loadedMarkup = markup;
|
|
35
|
+
});
|
|
36
|
+
scope.addEventListener('message', (event)=>{
|
|
37
|
+
const data = event?.data;
|
|
38
|
+
if ('string' != typeof data || !data.startsWith('webpackHotUpdate')) return;
|
|
39
|
+
if (comparing || null == loadedMarkup) return;
|
|
40
|
+
comparing = true;
|
|
41
|
+
const compare = async (attempt)=>{
|
|
42
|
+
const markup = await ownMarkup();
|
|
43
|
+
if (null != markup && markup !== loadedMarkup) {
|
|
44
|
+
comparing = false;
|
|
45
|
+
if ('function' == typeof safeLocation.reload) safeLocation.reload();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (attempt < 1) return void setTimeout(()=>void compare(attempt + 1), 500);
|
|
49
|
+
comparing = false;
|
|
50
|
+
};
|
|
51
|
+
compare(0);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
} catch {}
|
package/dist/module.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ import { type BrowserController, type BrowserLauncherFn, type BrowserLaunchOptio
|
|
|
7
7
|
import type { ReloadInstruction, ReloadType } from './plugin-reload';
|
|
8
8
|
import type { CompanionExtensionsConfig } from './plugin-special-folders/folder-extensions/types';
|
|
9
9
|
import type { BrowserConfig, BrowserType, BuildOptions, DevOptions, FileConfig, Manifest, PreviewOptions, SafariPackagerFn, SafariPackagerOverrides, StartOptions } from './types';
|
|
10
|
-
export { loadCommandConfig } from './lib/config-loader';
|
|
10
|
+
export { loadCommandConfig, loadProjectConfigDefaults } from './lib/config-loader';
|
|
11
11
|
export { extensionBuild, type BuildOptions, extensionDev, type DevOptions, extensionPreview, type PreviewOptions, type StartOptions, type FileConfig, type BrowserConfig, type BrowserType, type CompanionExtensionsConfig, type Manifest, type BuildSummary, type SafariPackageSummary, type SafariPackagerFn, type SafariPackagerOverrides, BuildEmitter, type CompiledEvent, type BuildErrorEvent, type ReloadType, type ReloadInstruction, type BrowserLauncherFn, type BrowserLaunchOptions, type BrowserController };
|
package/dist/module.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
2
|
export { BuildEmitter, extensionBuild, extensionDev } from "./839.mjs";
|
|
3
|
-
export { extensionPreview, loadCommandConfig } from "./101.mjs";
|
|
3
|
+
export { extensionPreview, loadCommandConfig, loadProjectConfigDefaults } from "./101.mjs";
|
|
@@ -5,5 +5,10 @@ export interface DeadUrlRefContext {
|
|
|
5
5
|
}
|
|
6
6
|
/** True when the reference names no file under the issuer or any project root. */
|
|
7
7
|
export declare function isDeadCssUrlRef(rawRequest: string, { issuerDir, roots }: DeadUrlRefContext): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Rewrites url() targets in place. The replacer returns the new target, or
|
|
10
|
+
* undefined to keep the reference exactly as authored.
|
|
11
|
+
*/
|
|
12
|
+
export declare function replaceCssUrlRefs(source: string, replacer: (request: string) => string | undefined): string;
|
|
8
13
|
/** Every url() target in a stylesheet, in source order, duplicates collapsed. */
|
|
9
14
|
export declare function extractCssUrlRefs(source: string): string[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const EXTENSION_ROOT_PLACEHOLDER = "__EXTENSIONJS_EXTENSION_ROOT__/";
|
|
2
|
+
export interface InlinedCssUrlTarget {
|
|
3
|
+
request: string;
|
|
4
|
+
absolutePath: string;
|
|
5
|
+
outputName: string;
|
|
6
|
+
publicOwned: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface RewriteInlinedCssUrlsContext {
|
|
9
|
+
resourcePath: string;
|
|
10
|
+
manifestDir: string;
|
|
11
|
+
publicRoot: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Every relative or root-absolute url() that names a real file is rewritten
|
|
15
|
+
* to `<placeholder><output name><query/hash>` and reported so the caller can
|
|
16
|
+
* emit it. A file public/ owns keeps the name the public copier gives it at
|
|
17
|
+
* the dist root. Remote, data:, fragment-only, protocol-relative and already
|
|
18
|
+
* absolute references stay as authored, and so does a reference to a file
|
|
19
|
+
* that does not exist (the dead-reference scan reports those).
|
|
20
|
+
*/
|
|
21
|
+
export declare function rewriteInlinedCssUrls(source: string, context: RewriteInlinedCssUrlsContext): {
|
|
22
|
+
css: string;
|
|
23
|
+
targets: InlinedCssUrlTarget[];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The JavaScript module a content script gets for an inlined stylesheet: a
|
|
27
|
+
* CommonJS export of a data: URL, so `import sheet from './x.css'` and
|
|
28
|
+
* `new URL('./x.css', import.meta.url)` both keep working as they did when
|
|
29
|
+
* rspack inlined the file itself. The placeholder becomes the extension root
|
|
30
|
+
* when the module evaluates, which is after the runtime API exists.
|
|
31
|
+
*/
|
|
32
|
+
export declare function toRuntimeStylesheetModule(css: string): string;
|
|
@@ -8,3 +8,6 @@ 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 postCssConfigUnreadable(configPath: string, error: unknown): string;
|
|
12
|
+
export declare function postCssConfigPluginsShape(configPath: string, found: string): string;
|
|
13
|
+
export declare function cssMinifierDroppedRules(assetName: string, tokens: string[]): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Compilation } from '@rspack/core';
|
|
2
|
+
export declare const VERBATIM_CSS_MARKER: RegExp;
|
|
3
|
+
export declare function registerVerbatimCss(raw: string, resourcePath?: string): string;
|
|
4
|
+
export declare function verbatimCssPlaceholder(id: string): string;
|
|
5
|
+
export declare function takeVerbatimCss(id: string): string | undefined;
|
|
6
|
+
export declare function cssRelativeRefs(text: string): string[];
|
|
7
|
+
export declare function restoreVerbatimCssAssets(compilation: Pick<Compilation, 'getAssets' | 'updateAsset'> & Partial<Pick<Compilation, 'emitAsset' | 'getAsset'>>): string[];
|
|
8
|
+
export declare function cssSelectorTokens(text: string): Set<string>;
|
|
9
|
+
export declare function minifierDroppedTokens(before: string, after: string): string[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AnyModule } from '../../lib/optional-deps-resolver';
|
|
2
2
|
import type { StyleLoaderOptions } from '../common-style-loaders';
|
|
3
3
|
export declare function findPostCssConfig(projectPath: string): string | undefined;
|
|
4
|
+
export declare function loadUserPostCssConfigObject(configPath: string, projectPath: string, mode: string): Promise<AnyModule | undefined>;
|
|
4
5
|
export declare function isUsingPostCss(projectPath: string): boolean;
|
|
5
6
|
export declare function maybeUsePostCss(projectPath: string, opts: StyleLoaderOptions): Promise<Record<string, AnyModule>>;
|
|
@@ -2,14 +2,18 @@ interface CompilationLike {
|
|
|
2
2
|
warnings?: Error[];
|
|
3
3
|
errors?: Error[];
|
|
4
4
|
}
|
|
5
|
+
export interface DeadCssUrlLoaderOptions {
|
|
6
|
+
manifestPath?: string;
|
|
7
|
+
projectPath?: string;
|
|
8
|
+
sheet?: 'inline' | 'chunk';
|
|
9
|
+
}
|
|
5
10
|
interface DeadCssUrlLoaderContext {
|
|
6
11
|
resourcePath: string;
|
|
7
|
-
getOptions():
|
|
8
|
-
manifestPath?: string;
|
|
9
|
-
projectPath?: string;
|
|
10
|
-
};
|
|
12
|
+
getOptions(): DeadCssUrlLoaderOptions;
|
|
11
13
|
emitWarning(warning: Error): void;
|
|
12
14
|
emitError(error: Error): void;
|
|
15
|
+
emitFile?(name: string, content: string | Buffer): void;
|
|
16
|
+
addDependency?(file: string): void;
|
|
13
17
|
_compilation?: CompilationLike;
|
|
14
18
|
}
|
|
15
19
|
export default function deadCssUrlLoader(this: DeadCssUrlLoaderContext, source: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type JsxImportSource = 'react' | 'preact' | 'solid-js' | 'vue';
|
|
2
|
+
export declare function isUsingJsxFramework(projectPath: string): boolean;
|
|
3
|
+
export declare function getJsxImportSource(projectPath: string): JsxImportSource;
|
|
4
|
+
export interface SwcParserOptions {
|
|
5
|
+
syntax: 'typescript' | 'ecmascript';
|
|
6
|
+
tsx?: boolean;
|
|
7
|
+
jsx?: boolean;
|
|
8
|
+
dynamicImport: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function swcParserForFile(resourcePath: string, jsxInPlainJs: boolean): SwcParserOptions;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type Props = Record<string, unknown> & {
|
|
2
|
+
children?: unknown;
|
|
3
|
+
};
|
|
4
|
+
export declare function Fragment(props: Props): unknown;
|
|
5
|
+
export declare function jsx(type: unknown, props?: Props, key?: unknown): unknown;
|
|
6
|
+
export declare const jsxs: typeof jsx;
|
|
7
|
+
export declare function jsxDEV(type: unknown, props?: Props, key?: unknown): unknown;
|
|
8
|
+
export {};
|
|
@@ -3,6 +3,7 @@ export interface ReloadInstruction {
|
|
|
3
3
|
type: ReloadType | 'page';
|
|
4
4
|
changedContentScriptEntries?: string[];
|
|
5
5
|
changedAssets?: string[];
|
|
6
|
+
changedScriptFiles?: string[];
|
|
6
7
|
label?: string;
|
|
7
8
|
}
|
|
8
9
|
/** "context (fileA, fileB +2 more)", the one label every reload surface shows. */
|
|
@@ -13,7 +14,12 @@ export interface SourceFeatureIndex {
|
|
|
13
14
|
/** Source → canonical content_scripts entry names whose chunks contain it. */
|
|
14
15
|
contentEntriesBySource: Map<string, Set<string>>;
|
|
15
16
|
pageSources: Set<string>;
|
|
17
|
+
/** Source → emitted scripts/ bundle names whose chunks contain it. */
|
|
18
|
+
scriptFilesBySource?: Map<string, Set<string>>;
|
|
19
|
+
/** Project-relative public/ roots the copier ships at the dist root. */
|
|
20
|
+
publicRoots?: string[];
|
|
16
21
|
}
|
|
22
|
+
export declare function publicOutputPath(rel: string, publicRoots: string[] | undefined): string | undefined;
|
|
17
23
|
export declare function buildSourceFeatureIndex(compilation: import('@rspack/core').Compilation, contextDir: string): SourceFeatureIndex;
|
|
18
24
|
export declare function classifyReloadFromSources(opts: {
|
|
19
25
|
changedSources: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Compiler } from '@rspack/core';
|
|
2
2
|
import type { DevOptions, PluginInterface } from '../types';
|
|
3
|
-
export { buildSourceFeatureIndex, classifyReloadFromSources, formatReloadContextLabel, pageContextFromSources, type ReloadInstruction, type ReloadType, readContentScriptCount, type SourceFeatureIndex } from './classify-reload';
|
|
3
|
+
export { buildSourceFeatureIndex, classifyReloadFromSources, formatReloadContextLabel, pageContextFromSources, publicOutputPath, type ReloadInstruction, type ReloadType, readContentScriptCount, type SourceFeatureIndex } from './classify-reload';
|
|
4
4
|
export { type ChangedSourcesSnapshot, type ChangedSourcesTracker, createChangedSourcesTracker, dispatchReload, type ReloadBroker, type ReloadExecutor } from './reload-dispatch';
|
|
5
5
|
export { SetupChunkLoadingTarget } from './steps/setup-chunk-loading-target';
|
|
6
6
|
/**
|
|
@@ -25,6 +25,7 @@ export declare class ReloadPlugin {
|
|
|
25
25
|
static readonly name = "plugin-reload";
|
|
26
26
|
readonly manifestPath: string;
|
|
27
27
|
readonly browser?: DevOptions['browser'];
|
|
28
|
+
private readonly devSession?;
|
|
28
29
|
constructor(options: PluginInterface);
|
|
29
30
|
apply(compiler: Compiler): void;
|
|
30
31
|
}
|
|
@@ -7,3 +7,6 @@ export declare function normalizeCompanionConfig(config?: CompanionExtensionsCon
|
|
|
7
7
|
dir?: string;
|
|
8
8
|
paths: string[];
|
|
9
9
|
};
|
|
10
|
+
export declare function isBrowserNamedCompanionFolder(name: string): boolean;
|
|
11
|
+
export declare function companionFolderForBrowser(browser: string | undefined): string;
|
|
12
|
+
export declare function companionFolderMatchesBrowser(name: string, browser: string | undefined): boolean;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare function serverRestartRequiredFromSpecialFolderMessageOnly(addingOrRemoving: string, folder: string, typeOfAsset: string): string;
|
|
2
|
+
export declare function publicMustBeAtProjectRoot(foundAt: string, expectedAt: string): string;
|
|
3
|
+
export declare function publicFolderShadowed(usedAt: string, ignoredAt: string): string;
|
|
2
4
|
export declare function specialFoldersSetupSummary(hasPublic: boolean, copyEnabled: boolean, ignoredCount: number): string;
|
|
3
5
|
export declare function specialFolderChangeDetected(action: 'add' | 'remove', folder: 'pages' | 'scripts', relativePath: string): string;
|
|
4
6
|
export declare function unreferencedScriptDropped(relativePaths: string[]): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PublicFolderInspection {
|
|
2
|
+
publicDir?: string;
|
|
3
|
+
fromRoot: string;
|
|
4
|
+
fromManifest: string;
|
|
5
|
+
usedFallback: boolean;
|
|
6
|
+
bothExist: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function inspectPublicFolders(manifestPath: string, projectRoot?: string): PublicFolderInspection;
|
|
9
|
+
export declare function resolvePublicFolder(manifestPath: string, projectRoot?: string): string | undefined;
|
|
10
|
+
export declare function publicFolderOrDefault(manifestPath: string, projectRoot: string): string;
|
|
11
|
+
export declare function publicResolveRoots(projectRoot: string, manifestPath: string): string[];
|
|
12
|
+
export declare function rememberPublicRoots(compiler: object, roots: string[]): void;
|
|
13
|
+
export declare function publicRootsFor(compiler: object | undefined | null): string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type * as parse5utilities from 'parse5-utilities';
|
|
2
2
|
import type { FilepathList } from '../../../types';
|
|
3
3
|
import type { HtmlStaticAttribute } from './parse-html';
|
|
4
|
-
export declare function handleStaticAsset(compilation: unknown, htmlEntry: string, htmlDir: string, absolutePath: string, assetType: 'staticSrc' | 'staticHref', cleanPath: string, search: string | undefined, hash: string | undefined,
|
|
4
|
+
export declare function handleStaticAsset(compilation: unknown, htmlEntry: string, htmlDir: string, absolutePath: string, assetType: 'staticSrc' | 'staticHref', cleanPath: string, search: string | undefined, hash: string | undefined, includeList: FilepathList, extname: string, childNode: parse5utilities.ParsedNode, attributeName?: HtmlStaticAttribute, manifestDir?: string): parse5utilities.ParsedNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type HtmlNode = {
|
|
2
|
+
nodeName?: string;
|
|
3
|
+
attrs?: Array<{
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}>;
|
|
7
|
+
childNodes?: HtmlNode[];
|
|
8
|
+
};
|
|
9
|
+
export declare function resolveLinkThroughBase(baseHref: string, value: string): string;
|
|
10
|
+
export declare function bakeBaseHref(htmlDocument: HtmlNode): void;
|
|
11
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Compilation } from '@rspack/core';
|
|
2
2
|
import type { FilepathList } from '../../../types';
|
|
3
|
-
export declare function patchHtml(compilation: Compilation, feature: string, htmlEntry: string, includeList: FilepathList): string;
|
|
4
|
-
export declare function patchHtmlNested(compilation: Compilation, htmlEntry: string): string;
|
|
3
|
+
export declare function patchHtml(compilation: Compilation, feature: string, htmlEntry: string, includeList: FilepathList, manifestDir?: string): string;
|
|
4
|
+
export declare function patchHtmlNested(compilation: Compilation, htmlEntry: string, manifestDir?: string): string;
|
|
@@ -27,6 +27,7 @@ export declare function isHttpLike(inputUrl: string): boolean;
|
|
|
27
27
|
export declare function isSpecialScheme(u: string): boolean;
|
|
28
28
|
export declare function cleanLeading(s: string): string;
|
|
29
29
|
export declare function joinEmittedAssetName(prefix: string, rel: string): string;
|
|
30
|
+
export declare function htmlStaticAssetOutputName(manifestDir: string | undefined, htmlEntry: string, absolutePath: string): string;
|
|
30
31
|
export declare function computePosixRelative(fromPath: string, toPath: string): string;
|
|
31
32
|
export declare function resolveAbsoluteFsPath(params: {
|
|
32
33
|
asset: string;
|
|
@@ -40,6 +41,18 @@ export declare function resolveAbsoluteFsPath(params: {
|
|
|
40
41
|
isUnderPublicRoot: boolean;
|
|
41
42
|
isRootUrl: boolean;
|
|
42
43
|
};
|
|
44
|
+
interface BaseHrefNode {
|
|
45
|
+
nodeName?: string;
|
|
46
|
+
attrs?: Array<{
|
|
47
|
+
name: string;
|
|
48
|
+
value?: string;
|
|
49
|
+
}>;
|
|
50
|
+
childNodes?: BaseHrefNode[];
|
|
51
|
+
}
|
|
52
|
+
export declare function resolveHtmlRefPath(htmlFilePath: string, baseHref: string | undefined, cleanPath: string): string;
|
|
43
53
|
export declare function getBaseHref(htmlDocument: {
|
|
44
54
|
childNodes?: unknown;
|
|
45
55
|
}): string | undefined;
|
|
56
|
+
export declare function getBaseNode(htmlDocument: {
|
|
57
|
+
childNodes?: unknown;
|
|
58
|
+
}): BaseHrefNode | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { LoaderInterface } from '../../../types';
|
|
2
|
-
export default function ensureHMRForScripts(this: LoaderInterface, source: string): string | undefined;
|
|
2
|
+
export default function ensureHMRForScripts(this: LoaderInterface, source: string, inputSourceMap?: unknown): string | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { type Compilation } from '@rspack/core';
|
|
2
|
+
export declare function isManagedSchemaFeature(feature: string): boolean;
|
|
2
3
|
export declare function isCriticalJsonFeature(feature: string): boolean;
|
|
3
4
|
export declare function validateJsonAsset(compilation: Compilation, feature: string, filePath: string, buf: Buffer): boolean;
|
|
@@ -14,6 +14,7 @@ export declare class ManifestPlugin {
|
|
|
14
14
|
readonly manifestPath: string;
|
|
15
15
|
readonly browser: DevOptions['browser'];
|
|
16
16
|
readonly includeList?: FilepathList;
|
|
17
|
+
private readonly devSession?;
|
|
17
18
|
constructor(options: PluginInterface & {
|
|
18
19
|
browser: DevOptions['browser'];
|
|
19
20
|
});
|
|
@@ -7,4 +7,4 @@ export declare function setCurrentManifestContent(compilation: Compilation, sour
|
|
|
7
7
|
export declare function getCurrentManifestContent(compilation: Compilation): string | undefined;
|
|
8
8
|
export declare function getManifestContent(compilation: Compilation, manifestPath: string): Manifest;
|
|
9
9
|
export { filterKeysForThisBrowser };
|
|
10
|
-
export declare function buildCanonicalManifest(manifestPath: string, manifest: Manifest, browser: DevOptions['browser']): Manifest;
|
|
10
|
+
export declare function buildCanonicalManifest(manifestPath: string, manifest: Manifest, browser: DevOptions['browser'], projectPath?: string): Manifest;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Manifest } from '../../../../types';
|
|
2
|
-
export declare function manifestCommon(manifest: Manifest, manifestPath?: string): any;
|
|
2
|
+
export declare function manifestCommon(manifest: Manifest, manifestPath?: string, projectPath?: string): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Manifest } from '../../../../types';
|
|
2
|
-
export declare function storage(manifest: Manifest, manifestPath?: string): {
|
|
2
|
+
export declare function storage(manifest: Manifest, manifestPath?: string, projectPath?: string): {
|
|
3
3
|
storage: {
|
|
4
4
|
managed_schema?: string | undefined;
|
|
5
5
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Manifest } from '../../../../types';
|
|
2
|
-
export declare function theme(manifest: Manifest): any;
|
|
2
|
+
export declare function theme(manifest: Manifest, manifestPath?: string): any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Manifest } from '../../../types';
|
|
2
|
-
export declare function getManifestOverrides(manifestPath: string, manifest: Manifest): string;
|
|
2
|
+
export declare function getManifestOverrides(manifestPath: string, manifest: Manifest, projectPath?: string): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Manifest } from '../../../../types';
|
|
2
|
-
export declare function chromeSettingsOverrides(manifest: Manifest): {
|
|
2
|
+
export declare function chromeSettingsOverrides(manifest: Manifest, manifestPath?: string): {
|
|
3
3
|
chrome_settings_overrides: {
|
|
4
4
|
homepage?: string | undefined;
|
|
5
5
|
search_provider?: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Manifest } from '../../../../types';
|
|
2
|
-
export declare function manifestV2(manifest: Manifest): any;
|
|
2
|
+
export declare function manifestV2(manifest: Manifest, manifestPath?: string): any;
|
package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/theme_experiment.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Manifest } from '../../../../types';
|
|
2
|
-
export declare function themeExperiment(manifest: Manifest): {
|
|
2
|
+
export declare function themeExperiment(manifest: Manifest, manifestPath?: string): {
|
|
3
3
|
theme_experiment: {
|
|
4
4
|
stylesheet?: string;
|
|
5
5
|
stylesheets?: string[];
|