extension-develop 4.1.14 → 4.1.16
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 +2 -2
- package/dist/0~rspack-config.mjs +216 -100
- package/dist/101.mjs +1 -1
- package/dist/266.mjs +40 -1
- package/dist/372.mjs +2 -1
- package/dist/77.mjs +4 -1
- package/dist/{518.mjs → 834.mjs} +1 -42
- package/dist/839.mjs +106 -3
- package/dist/86.mjs +45 -0
- package/dist/dead-css-url-loader.mjs +1 -1
- package/dist/extension-js-devtools/chrome/options/index.html +1 -1
- package/dist/extension-js-devtools/chrome/options/index.js +1 -1
- package/dist/extension-js-devtools/chrome/pages/centralized-logger.html +1 -1
- package/dist/extension-js-devtools/chrome/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/chrome/pages/welcome.html +1 -1
- package/dist/extension-js-devtools/chrome/pages/welcome.js +4 -4
- package/dist/extension-js-devtools/chrome/shared/commons.js +1 -0
- package/dist/extension-js-devtools/chrome/shared/framework.js +1 -0
- package/dist/extension-js-devtools/chromium/options/index.html +1 -1
- package/dist/extension-js-devtools/chromium/options/index.js +1 -1
- package/dist/extension-js-devtools/chromium/pages/centralized-logger.html +1 -1
- package/dist/extension-js-devtools/chromium/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/chromium/pages/welcome.html +1 -1
- package/dist/extension-js-devtools/chromium/pages/welcome.js +4 -4
- package/dist/extension-js-devtools/chromium/shared/commons.js +1 -0
- package/dist/extension-js-devtools/chromium/shared/framework.js +1 -0
- package/dist/extension-js-devtools/edge/options/index.html +1 -1
- package/dist/extension-js-devtools/edge/options/index.js +1 -1
- package/dist/extension-js-devtools/edge/pages/centralized-logger.html +1 -1
- package/dist/extension-js-devtools/edge/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/edge/pages/welcome.html +1 -1
- package/dist/extension-js-devtools/edge/pages/welcome.js +4 -4
- package/dist/extension-js-devtools/edge/shared/commons.js +1 -0
- package/dist/extension-js-devtools/edge/shared/framework.js +1 -0
- package/dist/extension-js-devtools/firefox/options/index.html +1 -1
- package/dist/extension-js-devtools/firefox/options/index.js +1 -1
- package/dist/extension-js-devtools/firefox/pages/centralized-logger.html +1 -1
- package/dist/extension-js-devtools/firefox/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/firefox/pages/welcome.html +1 -1
- package/dist/extension-js-devtools/firefox/pages/welcome.js +4 -4
- package/dist/extension-js-devtools/firefox/shared/commons.js +1 -0
- package/dist/extension-js-devtools/firefox/shared/framework.js +1 -0
- package/dist/lib/messages.d.ts +1 -0
- package/dist/lib/normalize-split-chunks.d.ts +7 -0
- package/dist/lib/split-chunks.d.ts +13 -0
- package/dist/plugin-css/index.d.ts +1 -0
- package/dist/plugin-css/public-css-url-loader.d.ts +13 -0
- package/dist/plugin-web-extension/feature-html/html-lib/inject.d.ts +12 -1
- package/dist/plugin-web-extension/feature-html/html-lib/patch-html.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/steps/update-html-file.d.ts +2 -1
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-injected-permissions.d.ts +2 -0
- package/dist/plugin-web-extension/feature-scripts/messages.d.ts +21 -0
- package/dist/plugin-web-extension/feature-scripts/steps/trace-runtime-loaded-files.d.ts +2 -0
- package/dist/plugin-web-extension/feature-scripts/steps/warn-split-initial-chunks.d.ts +7 -0
- package/dist/plugin-web-extension/shared/initial-files.d.ts +11 -0
- package/dist/public-css-url-loader.mjs +37 -0
- package/package.json +1 -1
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
export declare function importScriptsDependencyMissing(workerPath: string, literal: string, expectedPath: string, sourceSibling?: string): string;
|
|
2
2
|
export declare function injectedFileDependencyMissing(assetName: string, literal: string, expectedPath: string, sourceSibling?: string): string;
|
|
3
|
+
export declare function injectedCompiledSourceLiteral(assetName: string, literal: string, emittedPath: string): string;
|
|
4
|
+
declare const SPLIT_ENTRY_SURFACES: {
|
|
5
|
+
readonly page: {
|
|
6
|
+
readonly loads: (entryName: string) => string;
|
|
7
|
+
readonly effect: 'the page renders blank';
|
|
8
|
+
};
|
|
9
|
+
readonly background: {
|
|
10
|
+
readonly loads: () => string;
|
|
11
|
+
readonly effect: 'the background script never starts';
|
|
12
|
+
};
|
|
13
|
+
readonly content_script: {
|
|
14
|
+
readonly loads: () => string;
|
|
15
|
+
readonly effect: 'the content script never runs on the page';
|
|
16
|
+
};
|
|
17
|
+
readonly script: {
|
|
18
|
+
readonly loads: () => string;
|
|
19
|
+
readonly effect: 'the script never runs';
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare function entrySplitAcrossInitialFiles(entryName: string, surface: keyof typeof SPLIT_ENTRY_SURFACES, ownFile: string, extraFiles: string[]): string;
|
|
3
23
|
export declare function fetchedFileDependencyMissing(assetName: string, literal: string, expectedPath: string): string;
|
|
4
24
|
export declare function getURLDependencyMissing(assetName: string, literal: string, expectedPath: string): string;
|
|
5
25
|
export declare function runtimeSetSurfaceDependencyMissing(assetName: string, literal: string, expectedPath: string): string;
|
|
6
26
|
export declare function staticImportDependencyMissing(assetName: string, literal: string, expectedPath: string): string;
|
|
7
27
|
export declare function reservedScriptsFolder(relPath: string, indicators: string[]): string;
|
|
28
|
+
export {};
|
|
@@ -12,6 +12,8 @@ export declare class TraceRuntimeLoadedFiles {
|
|
|
12
12
|
private traceWebpackChunkSiblings;
|
|
13
13
|
private traceInjectedFilePayloads;
|
|
14
14
|
}
|
|
15
|
+
export declare function compiledSourceEmittedPath(distRel: string): string | null;
|
|
15
16
|
export declare function resolveExtensionPath(literal: string, basePath: string): string | null;
|
|
16
17
|
export declare function extractRuntimeSurfaceLiterals(source: string): string[];
|
|
17
18
|
export declare function extractStaticImportLiterals(source: string): string[];
|
|
19
|
+
export declare function extractInjectedFileLiterals(source: string): string[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Compiler } from '@rspack/core';
|
|
2
|
+
import { classifyEntrySurface, type EntrySurface } from '../../../lib/split-chunks';
|
|
3
|
+
export type SplitEntrySurface = EntrySurface;
|
|
4
|
+
export { classifyEntrySurface };
|
|
5
|
+
export declare class WarnSplitInitialChunks {
|
|
6
|
+
apply(compiler: Compiler): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ChunkLike {
|
|
2
|
+
files?: Iterable<string> | null;
|
|
3
|
+
}
|
|
4
|
+
export interface EntrypointLike {
|
|
5
|
+
getFiles(): string[];
|
|
6
|
+
getRuntimeChunk?(): ChunkLike | null | undefined;
|
|
7
|
+
getEntrypointChunk?(): ChunkLike | null | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare function isJsFile(file: string): boolean;
|
|
10
|
+
export declare function initialJsFiles(entrypoint: EntrypointLike): string[];
|
|
11
|
+
export declare function entryOwnJsFile(entryName: string, entrypoint: EntrypointLike, files: string[]): string | undefined;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
|
+
import { publicFolderOrDefault } from "./278.mjs";
|
|
3
|
+
import { replaceCssUrlRefs } from "./86.mjs";
|
|
4
|
+
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
5
|
+
import * as __rspack_external_node_path_c5b9b54f from "node:path";
|
|
6
|
+
const PUBLIC_ROOT_SCHEME = 'https://extensionjs-public.invalid';
|
|
7
|
+
function isFile(candidate) {
|
|
8
|
+
try {
|
|
9
|
+
return __rspack_external_node_fs_5ea92f0c.statSync(candidate).isFile();
|
|
10
|
+
} catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function keepPublicRootRefs(source, publicRoot) {
|
|
15
|
+
return replaceCssUrlRefs(source, (request)=>{
|
|
16
|
+
if (!request.startsWith('/') || request.startsWith('//')) return;
|
|
17
|
+
const suffixAt = request.search(/[?#]/);
|
|
18
|
+
const rel = (-1 === suffixAt ? request : request.slice(0, suffixAt)).slice(1);
|
|
19
|
+
if (!rel || !isFile(__rspack_external_node_path_c5b9b54f.join(publicRoot, rel))) return;
|
|
20
|
+
return `${PUBLIC_ROOT_SCHEME}${request}`;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function restorePublicRootRefs(source) {
|
|
24
|
+
return source.split(PUBLIC_ROOT_SCHEME).join('');
|
|
25
|
+
}
|
|
26
|
+
function publicCssUrlLoader(source) {
|
|
27
|
+
const { manifestPath, projectPath } = this.getOptions() || {};
|
|
28
|
+
if (!manifestPath || !projectPath) return source;
|
|
29
|
+
try {
|
|
30
|
+
const publicRoot = publicFolderOrDefault(manifestPath, projectPath);
|
|
31
|
+
return keepPublicRootRefs(source, publicRoot);
|
|
32
|
+
} catch {
|
|
33
|
+
return source;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export default publicCssUrlLoader;
|
|
37
|
+
export { PUBLIC_ROOT_SCHEME, keepPublicRootRefs, restorePublicRootRefs };
|