extension-develop 4.1.34 → 4.1.35

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.
Files changed (78) hide show
  1. package/dist/206~0.mjs +33 -0
  2. package/dist/363~0.mjs +1 -1
  3. package/dist/469~0.mjs +98 -16
  4. package/dist/519~0.mjs +12 -1
  5. package/dist/771~0.mjs +49 -8
  6. package/dist/832~0.mjs +127 -25
  7. package/dist/840~0.mjs +215 -54
  8. package/dist/846~0.mjs +16 -14
  9. package/dist/852~0.mjs +2 -0
  10. package/dist/88~0.mjs +10 -1
  11. package/dist/command-preview.d.ts +2 -0
  12. package/dist/contract/codes.json +9 -0
  13. package/dist/contracts-entry.d.ts +1 -1
  14. package/dist/contracts.mjs +109 -1
  15. package/dist/css-parse-guard-loader.mjs +7 -2
  16. package/dist/dev-server/control-bridge/log-rule.d.ts +38 -0
  17. package/dist/dev-server/control-bridge/logs-query.d.ts +2 -55
  18. package/dist/dev-server/control-bridge/producer-runtime.d.ts +1 -1
  19. package/dist/dev-server/html-refresh.d.ts +10 -0
  20. package/dist/dev-server/port-manager.d.ts +14 -0
  21. package/dist/dev-server/reserved-listen.d.ts +9 -0
  22. package/dist/dev-server/session-restart.d.ts +1 -1
  23. package/dist/dev-server~0.mjs +155 -30
  24. package/dist/extension-js-devtools/build-stamp.json +2 -2
  25. package/dist/extension-js-devtools/chrome/background/service_worker.js +2 -2
  26. package/dist/extension-js-devtools/chrome/pages/welcome.css +1 -1
  27. package/dist/extension-js-devtools/chromium/background/service_worker.js +2 -2
  28. package/dist/extension-js-devtools/chromium/pages/welcome.css +1 -1
  29. package/dist/extension-js-devtools/edge/background/service_worker.js +2 -2
  30. package/dist/extension-js-devtools/edge/pages/welcome.css +1 -1
  31. package/dist/extension-js-devtools/firefox/background/scripts.js +2 -2
  32. package/dist/extension-js-devtools/firefox/pages/welcome.css +1 -1
  33. package/dist/extension-js-theme/build-stamp.json +2 -2
  34. package/dist/feature-scripts-classic-concat-loader.js +45 -2
  35. package/dist/feature-scripts-classic-concat-loader.mjs +45 -2
  36. package/dist/feature-scripts-classic-traced-globals-loader.mjs +111 -0
  37. package/dist/feature-scripts-content-script-wrapper.js +10 -6
  38. package/dist/feature-scripts-content-script-wrapper.mjs +10 -6
  39. package/dist/lib/config-loader.d.ts +1 -0
  40. package/dist/lib/css-minimizer-options.d.ts +8 -0
  41. package/dist/lib/develop-context.d.ts +1 -1
  42. package/dist/lib/live-dev-session.d.ts +5 -0
  43. package/dist/lib/messages.d.ts +9 -1
  44. package/dist/lib/messaging.d.ts +2 -0
  45. package/dist/lib/package-manager.d.ts +7 -1
  46. package/dist/lib/paths.d.ts +1 -0
  47. package/dist/lib/project.d.ts +10 -2
  48. package/dist/lib/remote-archive.d.ts +11 -0
  49. package/dist/lib/rename-with-retry.d.ts +6 -0
  50. package/dist/lib/session-paths.d.ts +1 -0
  51. package/dist/lib/zip.d.ts +5 -1
  52. package/dist/plugin-browsers/index.d.ts +2 -0
  53. package/dist/plugin-css/css-in-content-script-loader.d.ts +1 -1
  54. package/dist/plugin-css/css-in-html-loader.d.ts +1 -1
  55. package/dist/plugin-css/css-lib/build-css-rules.d.ts +2 -1
  56. package/dist/plugin-css/css-lib/verbatim-css.d.ts +1 -0
  57. package/dist/plugin-js-frameworks/js-tools/typescript.d.ts +1 -0
  58. package/dist/plugin-playwright/index.d.ts +3 -0
  59. package/dist/plugin-special-folders/messages.d.ts +1 -0
  60. package/dist/plugin-special-folders/warn-upon-folder-changes.d.ts +1 -1
  61. package/dist/plugin-web-extension/feature-html/html-lib/options-dialog-floor.d.ts +7 -0
  62. package/dist/plugin-web-extension/feature-html/html-lib/patch-html.d.ts +3 -1
  63. package/dist/plugin-web-extension/feature-html/steps/update-html-file.d.ts +1 -0
  64. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-injected-hosts.d.ts +4 -1
  65. package/dist/plugin-web-extension/feature-scripts/messages.d.ts +1 -0
  66. package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/classic-concat-loader.d.ts +1 -0
  67. package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/content-script-wrapper.d.ts +1 -0
  68. package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/index.d.ts +1 -0
  69. package/dist/plugin-web-extension/feature-scripts/steps/classic-traced-globals-loader.d.ts +7 -0
  70. package/dist/plugin-web-extension/feature-scripts/steps/warn-unshipped-runtime-assets.d.ts +32 -0
  71. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/messages.d.ts +1 -0
  72. package/dist/plugin-web-extension/shared/discover-runtime-surfaces.d.ts +2 -0
  73. package/dist/plugin-web-extension/shared/script-graph.d.ts +4 -0
  74. package/dist/rspack-config~0.mjs +799 -196
  75. package/dist/types.d.ts +7 -1
  76. package/dist/zip~0.mjs +14 -7
  77. package/package.json +3 -3
  78. package/dist/plugin-css/css-lib/is-content-script.d.ts +0 -2
@@ -43,6 +43,7 @@ export type ReadyMetadata = {
43
43
  extensionName?: string;
44
44
  extensionVersion?: string;
45
45
  extensionId?: string;
46
+ extensionIdSource?: ExtensionIdSource;
46
47
  browserExitedAt?: string;
47
48
  browserExitCode?: number | null;
48
49
  browserExitSignal?: string | null;
@@ -107,6 +108,7 @@ type PluginOptions = {
107
108
  };
108
109
  export declare function formatStatsErrors(errors: unknown): string[];
109
110
  export declare function getSessionRunId(packageJsonDir: string, browser: string): string;
111
+ export type ExtensionIdSource = 'browser' | 'derived' | 'packager';
110
112
  export declare function stampReadyDistExtensionId(packageJsonDir: string, browser: string, distPath: string): void;
111
113
  export declare function stampReadyKnownExtensionId(packageJsonDir: string, browser: string, extensionId: string): void;
112
114
  export interface LiveDevSessionOwner {
@@ -115,6 +117,7 @@ export interface LiveDevSessionOwner {
115
117
  runId: string;
116
118
  instanceId?: string;
117
119
  instanceExplicit?: boolean;
120
+ distPath?: string;
118
121
  }
119
122
  export declare function detectLiveDevSessionOwner(readyPath: string, isAlive?: (pid: number) => boolean): LiveDevSessionOwner | null;
120
123
  export declare function getPlaywrightMetadataDir(packageJsonDir: string, browser: string): AbsolutePath;
@@ -2,6 +2,7 @@ export declare function serverRestartRequiredFromSpecialFolderMessageOnly(adding
2
2
  export declare function publicFolderOffRef(asset: string, via: 'a CSS url()' | 'an HTML src/href attribute', ref: string): string;
3
3
  export declare function publicMustBeAtProjectRoot(foundAt: string, expectedAt: string, projectRoot: string): string;
4
4
  export declare function publicFolderShadowed(usedAt: string, ignoredAt: string, projectRoot: string): string;
5
+ export declare function publicFolderAppeared(publicDir: string, projectRoot: string): string;
5
6
  export declare function specialFoldersSetupSummary(hasPublic: boolean, copyEnabled: boolean, ignoredCount: number): string;
6
7
  export declare function specialFolderChangeDetected(action: 'add' | 'remove', folder: 'pages' | 'scripts', relativePath: string): string;
7
8
  export declare function packageScriptLeftOut(relativePaths: string[]): string;
@@ -4,7 +4,7 @@ export declare class WarnUponFolderChanges {
4
4
  private knownFolderFiles;
5
5
  private hasSnapshot;
6
6
  private snapshotFolderFiles;
7
- private getContextDependencyPaths;
7
+ private getWatchedFolders;
8
8
  private throwCompilationError;
9
9
  private trackChange;
10
10
  private collectChanges;
@@ -0,0 +1,7 @@
1
+ import * as parse5utilities from 'parse5-utilities';
2
+ import type { Manifest } from '../../../types.js';
3
+ export declare const OPTIONS_DIALOG_FLOOR_PX = 32;
4
+ export declare const OPTIONS_DIALOG_FLOOR_MARK = "options-dialog-floor";
5
+ export declare const OPTIONS_DIALOG_FLOOR_CSS = "html{min-height:32px}";
6
+ export declare function needsOptionsDialogFloor(manifest: Manifest | undefined, browser: string | undefined, feature: string): boolean;
7
+ export declare function injectOptionsDialogFloor(headNode: Parameters<typeof parse5utilities.prepend>[0]): void;
@@ -1,4 +1,6 @@
1
1
  import { type Compilation } from '@rspack/core';
2
2
  import type { FilepathList } from '../../../types.js';
3
- export declare function patchHtml(compilation: Compilation, feature: string, htmlEntry: string, includeList: FilepathList, manifestDir?: string, siblingScripts?: string[], html?: string): string;
3
+ export declare function patchHtml(compilation: Compilation, feature: string, htmlEntry: string, includeList: FilepathList, manifestDir?: string, siblingScripts?: string[], html?: string, options?: {
4
+ optionsDialogFloor?: boolean;
5
+ }): string;
4
6
  export declare function patchHtmlNested(compilation: Compilation, htmlEntry: string, manifestDir?: string): string;
@@ -6,5 +6,6 @@ export declare class UpdateHtmlFile {
6
6
  readonly includeList?: FilepathList;
7
7
  readonly browser?: string;
8
8
  constructor(options: PluginInterface);
9
+ private readManifestForBrowser;
9
10
  apply(compiler: Compiler): void;
10
11
  }
@@ -3,7 +3,10 @@ export declare function declaredHostPatterns(manifest: Record<string, unknown>):
3
3
  export declare function optionalHostPatterns(manifest: Record<string, unknown>): string[];
4
4
  export declare function isHostPattern(value: string): boolean;
5
5
  export declare function scannableSourcePath(resource: string | undefined): string | undefined;
6
- export declare function matchesHostPattern(pattern: string, url: string): boolean;
6
+ export declare function matchesHostPattern(pattern: string, url: string, { ignorePath }?: {
7
+ ignorePath?: boolean;
8
+ }): boolean;
9
+ export declare function matchesHostPermission(pattern: string, url: string): boolean;
7
10
  export interface InjectedOnlyHostUse {
8
11
  url: string;
9
12
  file: string;
@@ -33,4 +33,5 @@ export declare function staticImportDependencyMissing(assetName: string, literal
33
33
  export declare function buildConstantNeverDefined(file: string, name: string, entryName: string): string;
34
34
  export declare function reservedScriptsFolder(relPath: string, indicators: string[]): string;
35
35
  export declare function compiledSourceSpelling(assetName: string, api: string, literal: string, emittedPath: string): string;
36
+ export declare function runtimeAssetFolderNotShipped(assetName: string, literal: string, folder: string, missing: string[]): string;
36
37
  export {};
@@ -4,6 +4,7 @@ export interface ClassicTopLevelBinding {
4
4
  }
5
5
  export declare function collectClassicGlobalNames(file: string, content: string): string[];
6
6
  export declare function collectClassicTopLevelBindings(_file: string, content: string): ClassicTopLevelBinding[];
7
+ export declare function rebaseDynamicImports(file: string, content: string, baseDir: string): string;
7
8
  interface ClassicConcatLoaderContext {
8
9
  resourcePath: string;
9
10
  resourceQuery: string;
@@ -2,6 +2,7 @@ interface ContentScriptLoaderContext {
2
2
  getOptions(): {
3
3
  manifestPath: string;
4
4
  mode?: string;
5
+ devSession?: boolean;
5
6
  browser?: string;
6
7
  mainWorldScripts?: string[];
7
8
  scriptsFolder?: string | false;
@@ -6,6 +6,7 @@ export declare class AddContentScriptWrapper {
6
6
  private readonly manifestPath;
7
7
  private readonly browser;
8
8
  private readonly includeList;
9
+ private readonly devSession?;
9
10
  constructor(options: PluginInterface);
10
11
  private resolveLoader;
11
12
  private resolveConcatLoader;
@@ -0,0 +1,7 @@
1
+ export declare function collectExposableClassicNames(content: string): string[];
2
+ interface LoaderContext {
3
+ resourcePath: string;
4
+ callback(err: Error | null, content?: string, sourceMap?: unknown): void;
5
+ }
6
+ export default function classicTracedGlobalsLoader(this: LoaderContext, source: string, inputSourceMap?: unknown): string | undefined;
7
+ export {};
@@ -0,0 +1,32 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ export interface RuntimePathReference {
3
+ literal: string;
4
+ folder: string;
5
+ namePrefix: string;
6
+ file?: string;
7
+ }
8
+ export interface UnshippedFolder {
9
+ folder: string;
10
+ literal: string;
11
+ assetName: string;
12
+ missing: string[];
13
+ }
14
+ export declare function extractPathLiterals(text: string): string[];
15
+ export declare function toRuntimePathReference(literal: string): RuntimePathReference | undefined;
16
+ export declare function findUnshippedFolders(options: {
17
+ extensionRoot: string;
18
+ sources: Array<{
19
+ assetName: string;
20
+ text: string;
21
+ }>;
22
+ isShipped: (distRel: string) => boolean;
23
+ isBundled: (absolutePath: string) => boolean;
24
+ }): UnshippedFolder[];
25
+ export declare class WarnUnshippedRuntimeAssets {
26
+ readonly manifestPath: string;
27
+ constructor(options: {
28
+ manifestPath: string;
29
+ });
30
+ apply(compiler: Compiler): void;
31
+ private report;
32
+ }
@@ -7,5 +7,6 @@ export declare function warFieldError(filePath: string, opts?: {
7
7
  export declare function warStringEntryInMv3(entry: string): string;
8
8
  export declare function warInvalidMatchPattern(pattern: string): string;
9
9
  export declare function warUnreachableResource(resource: string, entryName: string): string;
10
+ export declare function warInjectedScriptExposed(file: string, resources: string[]): string;
10
11
  export declare function entryImportsSummary(entryCount: number, totalResources: number): string;
11
12
  export declare function warPatchedSummary(v3Groups: number, v3ResourcesTotal: number, v2Resources: number): string;
@@ -0,0 +1,2 @@
1
+ import type { FilepathList } from '../../types.js';
2
+ export declare function discoverRuntimeSurfacePages(manifestPath: string, manifestScripts: FilepathList, manifestPages: FilepathList): FilepathList;
@@ -0,0 +1,4 @@
1
+ export declare function readIfFile(absPath: string): string | undefined;
2
+ export declare function scanScriptGraph(entryAbsPath: string, collect: (source: string) => string[]): string[];
3
+ export declare function scanPageScripts(htmlAbsPath: string, projectDir: string, collect: (source: string) => string[]): string[];
4
+ export declare function rootRelativePages(literals: string[], projectDir: string): Record<string, string>;