extension-develop 4.1.20 → 4.1.22
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/672~0.mjs +24 -1
- package/dist/747~0.mjs +4 -2
- package/dist/832~0.mjs +8 -19
- package/dist/840~0.mjs +434 -36
- package/dist/852~0.mjs +5 -1
- package/dist/950~0.mjs +45 -28
- package/dist/command-preview.d.ts +8 -0
- package/dist/dev-server/control-bridge/consumer-client.d.ts +10 -0
- package/dist/dev-server/control-bridge/contracts.d.ts +42 -0
- package/dist/dev-server/control-bridge/logs-query.d.ts +16 -0
- package/dist/dev-server~0.mjs +2 -0
- package/dist/lib/addon-lint.d.ts +4 -1
- package/dist/lib/build-summary.d.ts +11 -0
- package/dist/lib/chunk-dependency-provenance.d.ts +14 -0
- package/dist/lib/constants.d.ts +1 -1
- package/dist/lib/manifest-utils.d.ts +2 -0
- package/dist/lib/messages.d.ts +3 -3
- package/dist/lib/messaging.d.ts +1 -0
- package/dist/lib/package-manager.d.ts +2 -0
- package/dist/lib/paths.d.ts +3 -0
- package/dist/plugin-browsers/index.d.ts +28 -0
- package/dist/plugin-compilation/env.d.ts +2 -0
- package/dist/plugin-js-frameworks/js-frameworks-lib/messages.d.ts +1 -0
- package/dist/plugin-js-frameworks/js-tools/solid.d.ts +3 -0
- package/dist/plugin-js-frameworks/js-tools/typescript.d.ts +16 -0
- package/dist/plugin-perf-budgets/categorize.d.ts +2 -1
- package/dist/plugin-perf-budgets/index.d.ts +1 -1
- package/dist/plugin-playwright/index.d.ts +1 -0
- package/dist/plugin-reload/classify-reload.d.ts +4 -0
- package/dist/plugin-reload/index.d.ts +18 -0
- package/dist/plugin-special-folders/folder-extensions/types.d.ts +13 -0
- package/dist/plugin-special-folders/messages.d.ts +2 -2
- package/dist/plugin-web-extension/feature-manifest/messages.d.ts +1 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/emitted-evidence.d.ts +22 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-background.d.ts +9 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-web-resources.d.ts +7 -16
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults.d.ts +6 -2
- package/dist/plugin-web-extension/feature-manifest/steps/warn-gecko-unsupported-apis.d.ts +2 -13
- package/dist/plugin-web-extension/feature-scripts/messages.d.ts +5 -0
- package/dist/plugin-web-extension/feature-scripts/steps/warn-page-context-worker.d.ts +5 -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/unreachable-resources.d.ts +9 -0
- package/dist/rspack-config.d.ts +1 -1
- package/dist/rspack-config~0.mjs +432 -465
- package/dist/types.d.ts +190 -0
- package/package.json +1 -1
|
@@ -3,6 +3,24 @@ import type { DevOptions, PluginInterface } from '../types.js';
|
|
|
3
3
|
export { buildSourceFeatureIndex, classifyReloadFromSources, formatReloadContextLabel, pageContextFromSources, publicOutputPath, type ReloadInstruction, type ReloadType, readContentScriptCount, type SourceFeatureIndex } from './classify-reload.js';
|
|
4
4
|
export { type ChangedSourcesSnapshot, type ChangedSourcesTracker, createChangedSourcesTracker, dispatchReload, type ReloadBroker, type ReloadExecutor, type UndeliveredReloadContext } from './reload-dispatch.js';
|
|
5
5
|
export { SetupChunkLoadingTarget } from './steps/setup-chunk-loading-target.js';
|
|
6
|
+
/**
|
|
7
|
+
* ReloadPlugin owns the dev-only reload/HMR strategy end to end:
|
|
8
|
+
*
|
|
9
|
+
* - build-time injection of the reload runtime (SetupReloadStrategy and the
|
|
10
|
+
* vendored webpack-target-webextension fork), the SW scripts-replay shim,
|
|
11
|
+
* and the control-bridge producer/relay instrumentation
|
|
12
|
+
* - the reload classifier and dispatch seam consumed by plugin-browsers'
|
|
13
|
+
* BrowsersPlugin and the dev server's `--no-browser` broadcast path
|
|
14
|
+
* (re-exported above from classify-reload.ts / reload-dispatch.ts)
|
|
15
|
+
*
|
|
16
|
+
* Registration order matters: this plugin must be applied AFTER
|
|
17
|
+
* plugin-web-extension, SetupReloadStrategy decorates the background and
|
|
18
|
+
* content-script entries that feature-scripts' AddScripts declares.
|
|
19
|
+
*
|
|
20
|
+
* The whole pipeline is dev-only; `EXTENSION_NO_RELOAD=true` opts out. The
|
|
21
|
+
* every-mode content-script wrapper (mount lifecycle) is NOT part of this
|
|
22
|
+
* plugin. It lives in feature-scripts/steps/add-content-script-wrapper.
|
|
23
|
+
*/
|
|
6
24
|
export declare class ReloadPlugin {
|
|
7
25
|
static readonly name = "plugin-reload";
|
|
8
26
|
readonly manifestPath: string;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Companion extensions are "load-only" unpacked extension directories that
|
|
3
|
+
* should be loaded alongside the user extension in dev/preview/start.
|
|
4
|
+
*
|
|
5
|
+
* Each directory MUST be an unpacked extension root containing a manifest.json.
|
|
6
|
+
*/
|
|
1
7
|
export type CompanionExtensionsConfig = string[] | {
|
|
8
|
+
/**
|
|
9
|
+
* Folder to scan for subfolders that contain a manifest.json.
|
|
10
|
+
* Example: "./extensions" -> loads "./extensions/*" (one level deep)
|
|
11
|
+
*/
|
|
2
12
|
dir?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Explicit extension directories to load (absolute or relative to projectRoot).
|
|
15
|
+
*/
|
|
3
16
|
paths?: string[];
|
|
4
17
|
};
|
|
@@ -1,6 +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
|
+
export declare function publicMustBeAtProjectRoot(foundAt: string, expectedAt: string, projectRoot: string): string;
|
|
3
|
+
export declare function publicFolderShadowed(usedAt: string, ignoredAt: string, projectRoot: string): string;
|
|
4
4
|
export declare function specialFoldersSetupSummary(hasPublic: boolean, copyEnabled: boolean, ignoredCount: number): string;
|
|
5
5
|
export declare function specialFolderChangeDetected(action: 'add' | 'remove', folder: 'pages' | 'scripts', relativePath: string): string;
|
|
6
6
|
export declare function unreferencedScriptDropped(relativePaths: string[]): string;
|
|
@@ -13,6 +13,7 @@ export declare function manifestLegacyWarningsSummary(count: number): string;
|
|
|
13
13
|
export declare function pageActionNotSupportedByBrowser(browser: string): string;
|
|
14
14
|
export declare function pageActionDroppedForBrowserAction(browser: string): string;
|
|
15
15
|
export declare function vendorPrefixedKeyDropped(key: string, familyKey: string, vendor: 'chrome' | 'edge', browser: string): string;
|
|
16
|
+
export declare function manifestVersionLostForBrowser(browser: string, prefixedKeys: string[], resolved: unknown): string;
|
|
16
17
|
export declare function edgeStoreKeyDropped(browser: string): string;
|
|
17
18
|
export declare function mv2SandboxPolicyDropped(browser: string): string;
|
|
18
19
|
export declare function geckoSidePanelUnsupported(file: string): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface EmittedModule {
|
|
2
|
+
resource?: string;
|
|
3
|
+
modules?: Iterable<EmittedModule>;
|
|
4
|
+
}
|
|
5
|
+
export interface EmittedChunk {
|
|
6
|
+
files?: Iterable<string>;
|
|
7
|
+
}
|
|
8
|
+
export interface EmittedCompilation {
|
|
9
|
+
getAssets?: () => readonly {
|
|
10
|
+
name: string;
|
|
11
|
+
source: {
|
|
12
|
+
source(): string | Buffer;
|
|
13
|
+
};
|
|
14
|
+
}[];
|
|
15
|
+
chunkGraph?: {
|
|
16
|
+
getModuleChunksIterable(module: EmittedModule): Iterable<EmittedChunk>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare function shippableText(text: string): string;
|
|
20
|
+
export declare function readEmittedScripts(compilation: EmittedCompilation): Map<string, string>;
|
|
21
|
+
export declare function readProjectSource(resource: string): string | undefined;
|
|
22
|
+
export declare function emittedFilesOf(compilation: EmittedCompilation, module: EmittedModule): string[] | undefined;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { DevOptions, Manifest } from '../../../../types.js';
|
|
2
2
|
export default function patchBackground(manifest: Manifest, browser: DevOptions['browser']): {
|
|
3
|
+
background: ({
|
|
4
|
+
scripts?: string[] | undefined;
|
|
5
|
+
page?: string | undefined;
|
|
6
|
+
persistent?: boolean | undefined;
|
|
7
|
+
} & {
|
|
8
|
+
service_worker: string;
|
|
9
|
+
type?: "module";
|
|
10
|
+
}) | undefined;
|
|
11
|
+
} | {
|
|
3
12
|
background: {
|
|
4
13
|
scripts?: string[] | undefined;
|
|
5
14
|
page?: string | undefined;
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import type { Manifest } from '../../../../types.js';
|
|
2
|
+
export declare const DEV_RUNTIME_RESOURCES: string[];
|
|
2
3
|
declare function patchWebResourcesV2(manifest: Manifest): string[];
|
|
3
|
-
declare function patchWebResourcesV3(manifest: Manifest):
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} |
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} & {
|
|
10
|
-
extension_ids: string[];
|
|
11
|
-
matches?: string[] | undefined;
|
|
12
|
-
}) | (string & {
|
|
13
|
-
resources: string[];
|
|
14
|
-
use_dynamic_url?: boolean | undefined;
|
|
15
|
-
} & {
|
|
16
|
-
matches: string[];
|
|
17
|
-
extension_ids?: string[] | undefined;
|
|
18
|
-
}))[];
|
|
4
|
+
declare function patchWebResourcesV3(manifest: Manifest): unknown[];
|
|
5
|
+
export declare function patchWebResources(manifest: Manifest): {
|
|
6
|
+
web_accessible_resources?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
web_accessible_resources: Manifest['web_accessible_resources'];
|
|
9
|
+
};
|
|
19
10
|
export { patchWebResourcesV2, patchWebResourcesV3 };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type Compiler } from '@rspack/core';
|
|
2
2
|
import type { PluginInterface } from '../../../types.js';
|
|
3
|
-
|
|
3
|
+
import { type EmittedCompilation, type EmittedModule } from './apply-dev-defaults-lib/emitted-evidence.js';
|
|
4
|
+
export interface PermissionScanCompilation extends EmittedCompilation {
|
|
5
|
+
modules: Iterable<EmittedModule>;
|
|
6
|
+
}
|
|
7
|
+
export declare function findInjectedOnlyPermissionUses(compilation: PermissionScanCompilation, declared: Set<string>, injected: readonly string[]): Map<string, string>;
|
|
4
8
|
export declare class ApplyDevDefaults {
|
|
5
9
|
private readonly manifestPath?;
|
|
6
10
|
private readonly browser;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Compilation, type Compiler } from '@rspack/core';
|
|
2
2
|
import type { DevOptions, Manifest } from '../../../types.js';
|
|
3
3
|
import * as messages from '../messages.js';
|
|
4
|
+
import { type EmittedCompilation } from './apply-dev-defaults-lib/emitted-evidence.js';
|
|
4
5
|
declare const webkitUnsupportedApis: {
|
|
5
6
|
readonly sidePanel: typeof messages.safariSidePanelUnsupported;
|
|
6
7
|
readonly offscreen: typeof messages.safariOffscreenUnsupported;
|
|
@@ -124,20 +125,8 @@ interface ScannableModule {
|
|
|
124
125
|
modules?: Iterable<ScannableModule>;
|
|
125
126
|
rootModule?: ScannableModule;
|
|
126
127
|
}
|
|
127
|
-
interface
|
|
128
|
-
files?: Iterable<string>;
|
|
129
|
-
}
|
|
130
|
-
export interface ScannableCompilation {
|
|
128
|
+
export interface ScannableCompilation extends EmittedCompilation {
|
|
131
129
|
modules: Iterable<ScannableModule>;
|
|
132
|
-
getAssets?: () => readonly {
|
|
133
|
-
name: string;
|
|
134
|
-
source: {
|
|
135
|
-
source(): string | Buffer;
|
|
136
|
-
};
|
|
137
|
-
}[];
|
|
138
|
-
chunkGraph?: {
|
|
139
|
-
getModuleChunksIterable(module: ScannableModule): Iterable<ScannableChunk>;
|
|
140
|
-
};
|
|
141
130
|
}
|
|
142
131
|
export declare function findGeckoUnsupportedApiUses(compilation: ScannableCompilation, manifestVersion: unknown, engine?: UnsupportedApiEngine, requireEmittedEvidence?: boolean): GeckoUnsupportedApiUse[];
|
|
143
132
|
export declare function reportGeckoUnsupportedApis(compilation: Compilation, compiler: Compiler, browser: DevOptions['browser'], manifest: Manifest, projectPath: string, reported?: Set<string>): void;
|
|
@@ -20,6 +20,11 @@ declare const SPLIT_ENTRY_SURFACES: {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
export declare function entrySplitAcrossInitialFiles(entryName: string, surface: keyof typeof SPLIT_ENTRY_SURFACES, ownFile: string, extraFiles: string[]): string;
|
|
23
|
+
declare const PAGE_CONTEXT_SURFACES: {
|
|
24
|
+
readonly content_script: 'a content script';
|
|
25
|
+
readonly script: 'an injected script';
|
|
26
|
+
};
|
|
27
|
+
export declare function workerStartedFromPageContext(assetName: string, surface: keyof typeof PAGE_CONTEXT_SURFACES): string;
|
|
23
28
|
export declare function fetchedFileDependencyMissing(assetName: string, literal: string, expectedPath: string): string;
|
|
24
29
|
export declare function getURLDependencyMissing(assetName: string, literal: string, expectedPath: string): string;
|
|
25
30
|
export declare function runtimeSetSurfaceDependencyMissing(assetName: string, literal: string, expectedPath: string): string;
|
|
@@ -6,4 +6,5 @@ export declare const EMITTED_ASSET_REF_PATTERN: RegExp;
|
|
|
6
6
|
export declare function listEmittedAssetNames(compilation: Compilation): string[];
|
|
7
7
|
export declare function collectReferencedRuntimePayloads(source: string, emittedAssetNames: string[]): string[];
|
|
8
8
|
export declare function collectContentScriptAsyncChunkFiles(compilation: Compilation): Record<string, string[]>;
|
|
9
|
+
export declare function collectPageContextEntryFiles(compilation: Compilation): Record<string, string[]>;
|
|
9
10
|
export declare function collectContentScriptEntryImports(compilation: Compilation, includeList?: FilepathList): Record<string, string[]>;
|
|
@@ -6,5 +6,6 @@ export declare function warFieldError(filePath: string, opts?: {
|
|
|
6
6
|
}): string;
|
|
7
7
|
export declare function warStringEntryInMv3(entry: string): string;
|
|
8
8
|
export declare function warInvalidMatchPattern(pattern: string): string;
|
|
9
|
+
export declare function warUnreachableResource(resource: string, entryName: string): string;
|
|
9
10
|
export declare function entryImportsSummary(entryCount: number, totalResources: number): string;
|
|
10
11
|
export declare function warPatchedSummary(v3Groups: number, v3ResourcesTotal: number, v2Resources: number): string;
|
package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/unreachable-resources.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function normalizeResourcePath(value: string): string;
|
|
2
|
+
export declare function isResourceCovered(declared: readonly string[], candidate: string): boolean;
|
|
3
|
+
export declare const GET_URL_LITERAL_PATTERN: RegExp;
|
|
4
|
+
export declare function collectGetUrlLiterals(source: string): string[];
|
|
5
|
+
export declare function findUnreachableRuntimeResources(options: {
|
|
6
|
+
source: string;
|
|
7
|
+
emittedAssetNames: readonly string[];
|
|
8
|
+
declaredResources: readonly string[];
|
|
9
|
+
}): string[];
|
package/dist/rspack-config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Configuration } from '@rspack/core';
|
|
2
2
|
import type { ProjectStructure } from './lib/project.js';
|
|
3
3
|
import type { WebpackConfigOptions } from './types.js';
|
|
4
4
|
export default function webpackConfig(projectStructure: ProjectStructure, devOptions: WebpackConfigOptions): Configuration;
|