extension 4.1.12 → 4.1.13

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 (30) hide show
  1. package/dist/49.cjs +2 -10
  2. package/dist/browsers.cjs +355 -111
  3. package/dist/cli.cjs +1012 -518
  4. package/dist/extension/browsers/browsers-lib/messages.d.ts +1 -1
  5. package/dist/extension/browsers/browsers-lib/newtab-override.d.ts +1 -0
  6. package/dist/extension/browsers/browsers-lib/resolve-profile.d.ts +1 -0
  7. package/dist/extension/browsers/run-chromium/chromium-launch/browser-config.d.ts +8 -1
  8. package/dist/extension/browsers/run-chromium/chromium-launch/index.d.ts +1 -0
  9. package/dist/extension/browsers/run-firefox/firefox-launch/binary-detector.d.ts +10 -0
  10. package/dist/extension/browsers/run-firefox/firefox-launch/browser-config.d.ts +9 -0
  11. package/dist/extension/browsers/run-firefox/firefox-launch/dry-run.d.ts +1 -1
  12. package/dist/extension/browsers/run-firefox/firefox-launch/index.d.ts +1 -0
  13. package/dist/extension/browsers/run-firefox/firefox-types.d.ts +1 -1
  14. package/dist/extension/browsers/run-firefox/rdp/rdp-extension-controller/index.d.ts +1 -0
  15. package/dist/extension/browsers/run-firefox/rdp/remote-firefox/index.d.ts +1 -0
  16. package/dist/extension/browsers/run-firefox/rdp/remote-firefox/manager-tab.d.ts +10 -0
  17. package/dist/extension/browsers/run-firefox/rdp/remote-firefox/messaging-client.d.ts +1 -0
  18. package/dist/extension/browsers/run-firefox/rdp/remote-firefox/transport.d.ts +3 -1
  19. package/dist/extension/commands/doctor.d.ts +1 -1
  20. package/dist/extension/helpers/cli-argv.d.ts +8 -0
  21. package/dist/extension/helpers/cli-options.d.ts +7 -0
  22. package/dist/extension/helpers/messages.d.ts +5 -0
  23. package/dist/extension/helpers/msg-placeholders.d.ts +2 -0
  24. package/dist/extension/helpers/output-flag.d.ts +6 -0
  25. package/dist/extension/helpers/session-project-path.d.ts +4 -0
  26. package/dist/extension/helpers/telemetry-cli.d.ts +1 -0
  27. package/dist/extension/helpers/template-catalog.d.ts +1 -1
  28. package/package.json +4 -4
  29. package/types/assets.d.ts +65 -0
  30. package/types/index.d.ts +1 -60
@@ -58,7 +58,7 @@ export declare function firefoxNoBinaryArgsFound(): string;
58
58
  export declare function firefoxFailedToStart(error: unknown): string;
59
59
  export declare function firefoxDryRunNotLaunching(): string;
60
60
  export declare function firefoxDryRunBinary(path: string): string;
61
- export declare function firefoxDryRunConfig(cfg: string): string;
61
+ export declare function firefoxDryRunArgs(args: string): string;
62
62
  export declare function safariBuildCalled(): string;
63
63
  export declare function safariRequiresMacOS(platform: string): string;
64
64
  export declare function safariPackagingSkippedNonMac(platform: string): string;
@@ -0,0 +1 @@
1
+ export declare function manifestDeclaresNewtabOverride(outPath: string): boolean;
@@ -30,6 +30,7 @@ export interface ResolveProfileInput {
30
30
  /** `copyFromProfile` option, seed the managed profile as a copy of this path. */
31
31
  copyFromProfile?: string;
32
32
  resolveExplicit: (trimmedProfile: string) => string;
33
+ provision?: boolean;
33
34
  }
34
35
  export interface ResolvedProfile {
35
36
  kind: ProfileKind;
@@ -1,3 +1,10 @@
1
1
  import type { CompilationLike, DefaultBrowserFlags, PluginInterface } from '../../browsers-types';
2
2
  export declare const DEFAULT_BROWSER_FLAGS: DefaultBrowserFlags[];
3
- export declare function browserConfig(compilation: CompilationLike, configOptions: PluginInterface): string[];
3
+ export interface BrowserConfigMode {
4
+ provision?: boolean;
5
+ }
6
+ export declare function chromiumLaunchPlan(binary: string, chromiumConfig: string[], startingUrl?: string): {
7
+ binary: string;
8
+ args: string[];
9
+ };
10
+ export declare function browserConfig(compilation: CompilationLike, configOptions: PluginInterface, mode?: BrowserConfigMode): string[];
@@ -30,6 +30,7 @@ export declare class ChromiumLaunchPlugin {
30
30
  }): Promise<void>;
31
31
  apply(compiler: unknown): void;
32
32
  private launchChromium;
33
+ private printDryRunPlan;
33
34
  private launchWithDirectSpawn;
34
35
  private printEnhancedPuppeteerInstallHint;
35
36
  }
@@ -3,6 +3,16 @@ export declare function parseFlatpakBinary(binary: string): {
3
3
  } | null;
4
4
  export declare function isFirefoxHeadlessRequested(env?: NodeJS.ProcessEnv): boolean;
5
5
  export declare class FirefoxBinaryDetector {
6
+ static launchPlan(input: {
7
+ binaryPath: string;
8
+ profilePath: string;
9
+ debugPort: number;
10
+ binaryArgs: string[];
11
+ headless: boolean;
12
+ }): {
13
+ binary: string;
14
+ args: string[];
15
+ };
6
16
  static generateFirefoxArgs(binaryPath: string, profilePath: string, debugPort: number, additionalArgs?: string[], headless?: boolean): {
7
17
  binary: string;
8
18
  args: string[];
@@ -14,5 +14,14 @@ type BrowserConfigOptions = {
14
14
  copyFromProfile?: string;
15
15
  instanceId?: string;
16
16
  };
17
+ export interface FirefoxLaunchConfig {
18
+ profilePath: string;
19
+ binaryArgs: string[];
20
+ config: string;
21
+ }
22
+ export interface FirefoxConfigMode {
23
+ provision?: boolean;
24
+ }
17
25
  export declare function browserConfig(compilation: CompilationLike, configOptions: BrowserConfigOptions): Promise<string>;
26
+ export declare function resolveFirefoxLaunchConfig(compilation: CompilationLike, configOptions: BrowserConfigOptions, mode?: FirefoxConfigMode): Promise<FirefoxLaunchConfig>;
18
27
  export {};
@@ -1 +1 @@
1
- export declare function logFirefoxDryRun(browserBinaryLocation: string, firefoxConfig: string): void;
1
+ export declare function logFirefoxDryRun(browserBinaryLocation: string, launchArgs: string[]): void;
@@ -22,6 +22,7 @@ export declare class FirefoxLaunchPlugin {
22
22
  runOnce(compilation: CompilationLike, options: LaunchOptions): Promise<void>;
23
23
  apply(compiler: unknown): void;
24
24
  private launch;
25
+ private printDryRunPlan;
25
26
  private resolveSpawnStdio;
26
27
  private spawnFirefoxChild;
27
28
  private pipeChildOutput;
@@ -1,6 +1,6 @@
1
1
  import type { BrowserLogSink, ExtensionLoadRetryResult, PluginInterface } from '../browsers-types';
2
2
  import type { FirefoxRDPController } from './rdp/rdp-extension-controller';
3
- export type FirefoxPluginLike = Pick<PluginInterface, 'extension' | 'browserFlags' | 'profile' | 'persistProfile' | 'keepProfileChanges' | 'copyFromProfile' | 'preferences' | 'startingUrl' | 'geckoBinary' | 'instanceId' | 'port' | 'logLevel' | 'logContexts' | 'logFormat' | 'logTimestamps' | 'logColor' | 'logUrl' | 'logTab' | 'dryRun'> & {
3
+ export type FirefoxPluginLike = Pick<PluginInterface, 'extension' | 'browserFlags' | 'profile' | 'persistProfile' | 'keepProfileChanges' | 'copyFromProfile' | 'preferences' | 'startingUrl' | 'noOpen' | 'geckoBinary' | 'instanceId' | 'port' | 'logLevel' | 'logContexts' | 'logFormat' | 'logTimestamps' | 'logColor' | 'logUrl' | 'logTab' | 'dryRun'> & {
4
4
  browser: PluginInterface['browser'];
5
5
  };
6
6
  export interface FirefoxPluginRuntime extends FirefoxPluginLike {
@@ -22,6 +22,7 @@ export declare class FirefoxRDPController {
22
22
  constructor(plugin: PluginLike, debugPort: number);
23
23
  ensureLoaded(compilation: CompilationLike): Promise<void>;
24
24
  getAddonInstallRefusalReason(): string | null;
25
+ openNewTab(): Promise<boolean>;
25
26
  getExtensionId(): string | undefined;
26
27
  enableUnifiedLogging(opts: {
27
28
  level?: string;
@@ -21,6 +21,7 @@ export declare class RemoteFirefox {
21
21
  private connectClient;
22
22
  private invalidateConnectionScopedCaches;
23
23
  installAddons(compilation: CompilationLike): Promise<void>;
24
+ openNewTab(): Promise<boolean>;
24
25
  enableUnifiedLogging(opts: {
25
26
  level?: string;
26
27
  contexts?: string[] | undefined;
@@ -0,0 +1,10 @@
1
+ export declare const MANAGER_ADDON_ID = "devtools@extension.js";
2
+ export declare const OPEN_NEW_TAB_EXPRESSION: string;
3
+ export interface ManagerTabClient {
4
+ request: (payload: unknown) => Promise<unknown>;
5
+ evaluate: (actor: string, expression: string) => Promise<unknown>;
6
+ on: (event: string, listener: (message: unknown) => void) => unknown;
7
+ off?: (event: string, listener: (message: unknown) => void) => unknown;
8
+ removeListener?: (event: string, listener: (message: unknown) => void) => unknown;
9
+ }
10
+ export declare function openManagerNewTab(client: ManagerTabClient): Promise<boolean>;
@@ -6,6 +6,7 @@ export declare class MessagingClient extends EventEmitter {
6
6
  private reconnecting;
7
7
  private disconnectedByUser;
8
8
  connect(port: number): Promise<void>;
9
+ private openTransport;
9
10
  disconnect(): void;
10
11
  private attemptReconnect;
11
12
  request(requestProps: unknown): Promise<unknown>;
@@ -1,9 +1,11 @@
1
1
  import EventEmitter from 'node:events';
2
+ export declare function surfaceTransportError(emitter: EventEmitter, error: unknown): void;
2
3
  export declare class RdpTransport extends EventEmitter {
3
4
  private conn?;
4
5
  private incoming;
5
6
  private active;
6
7
  private pending;
8
+ private lost;
7
9
  connect(port: number, host?: string): Promise<void>;
8
10
  disconnect(): void;
9
11
  private rejectAll;
@@ -15,6 +17,6 @@ export declare class RdpTransport extends EventEmitter {
15
17
  private onData;
16
18
  private readMessage;
17
19
  private handleMessage;
18
- private onEnd;
20
+ private onConnectionLost;
19
21
  private onTimeout;
20
22
  }
@@ -10,7 +10,7 @@ interface DoctorOptions {
10
10
  browser?: string;
11
11
  output?: 'pretty' | 'json';
12
12
  }
13
- export declare function resolveDoctorBrowser(projectPathArg: string | undefined, optsBrowser: string | undefined): {
13
+ export declare function resolveDoctorBrowser(projectPath: string | undefined, optsBrowser: string | undefined): {
14
14
  browser: string;
15
15
  sessionBrowsers: string[];
16
16
  };
@@ -0,0 +1,8 @@
1
+ import type { Command } from 'commander';
2
+ export declare function scanArgvValue(argv: string[], flag: string): string | undefined;
3
+ export declare function collectValuedLongFlags(program: Command): Set<string>;
4
+ export declare function resolveCommandFromArgv(argv: string[], valuedFlags?: ReadonlySet<string>): string | undefined;
5
+ export declare function rewriteOutputAliasArgv(argv: string[], valuedFlags?: ReadonlySet<string>): {
6
+ argv: string[];
7
+ rewritten: boolean;
8
+ };
@@ -0,0 +1,7 @@
1
+ import { Option } from 'commander';
2
+ export declare function geckoBinaryOption(): Option;
3
+ export declare function firefoxBinaryAliasOption(): Option;
4
+ export declare function cliGeckoBinary(opts: {
5
+ geckoBinary?: string;
6
+ firefoxBinary?: string;
7
+ }): string | undefined;
@@ -280,4 +280,9 @@ export declare function programAIHelpJSON(version: string): ProgramAIHelpJSON;
280
280
  export declare function invalidAIHelpFormat(value: string): string;
281
281
  export declare function removedNoRunnerFlag(): string;
282
282
  export declare function deprecatedOutputAlias(flag: string): string;
283
+ export declare function openSurfaceGestureStep(surface: string): string;
284
+ export declare function openSurfaceNeedsGesturePlain(surface: string): string;
285
+ export declare function openSurfaceNeedsGesture(surface: string): string;
286
+ export declare function controlDisabledInSessionPlain(browser: string, port: number | undefined, flag: string): string;
287
+ export declare function controlDisabledInSession(browser: string, port: number | undefined, flag: string): string;
283
288
  export declare function noBrowserNotSupportedForCommand(command?: string): string;
@@ -0,0 +1,2 @@
1
+ export declare function collectMsgReferences(value: unknown): string[];
2
+ export declare function findUndefinedMsgReferences(value: unknown, catalogKeys: Iterable<string>): string[];
@@ -1,5 +1,11 @@
1
1
  export type OutputFormat = 'pretty' | 'json';
2
2
  export declare function warnDeprecatedOutputAlias(flag: string): void;
3
+ export declare function normalizeOutputFormat(value: unknown): OutputFormat | undefined;
4
+ export declare function isJsonOutput(opts: {
5
+ output?: string;
6
+ format?: string;
7
+ waitFormat?: string;
8
+ }): boolean;
3
9
  export declare function resolveOutputFormat(opts: {
4
10
  output?: string;
5
11
  format?: string;
@@ -0,0 +1,4 @@
1
+ import type { AnyDevelopModule } from './extension-develop-runtime';
2
+ export declare function resolveSessionProjectPath(bridge: AnyDevelopModule, pathArg?: string): string;
3
+ export declare function sessionReadyPath(bridge: AnyDevelopModule, projectPath: string, browser: string): string;
4
+ export declare function sessionLogsPath(bridge: AnyDevelopModule, projectPath: string, browser: string): string;
@@ -1,6 +1,7 @@
1
1
  import { Telemetry, type TelemetrySource } from './telemetry';
2
2
  type KnownCommand = 'create' | 'dev' | 'start' | 'preview' | 'build' | 'install' | 'uninstall' | 'telemetry' | 'unknown';
3
3
  export declare function detectInvokedCommand(argv: string[]): KnownCommand;
4
+ export declare function advertisedTemplateName(value: string | undefined): string | undefined;
4
5
  export declare function telemetryCommandContext(command: string, argv?: string[]): {
5
6
  template?: string;
6
7
  source?: string;
@@ -1,4 +1,4 @@
1
- export declare const DEFAULT_TEMPLATE = "javascript";
1
+ export declare const DEFAULT_TEMPLATE = "typescript";
2
2
  export declare const BUNDLED_TEMPLATES: readonly string[];
3
3
  export declare const TEMPLATE_CATALOG_URL = "https://github.com/extension-js/examples/tree/cb6a25377bd9516a1e55447a2010537019851ab2/examples";
4
4
  export interface TemplateGroup {
package/package.json CHANGED
@@ -38,7 +38,7 @@
38
38
  "extension": "./bin/extension.cjs"
39
39
  },
40
40
  "name": "extension",
41
- "version": "4.1.12",
41
+ "version": "4.1.13",
42
42
  "description": "The cross-browser extension framework. Build Chrome, Edge, Firefox, and Safari extensions with no build configuration.",
43
43
  "homepage": "https://extension.js.org/",
44
44
  "bugs": {
@@ -106,9 +106,9 @@
106
106
  "vivaldi-location2": "2.1.1",
107
107
  "waterfox-location": "2.1.1",
108
108
  "yandex-location": "2.1.1",
109
- "extension-create": "4.1.12",
110
- "extension-develop": "4.1.12",
111
- "extension-install": "4.1.12",
109
+ "extension-create": "4.1.13",
110
+ "extension-develop": "4.1.13",
111
+ "extension-install": "4.1.13",
112
112
  "commander": "^15.0.0",
113
113
  "pintor": "0.3.0",
114
114
  "semver": "^7.7.3",
@@ -0,0 +1,65 @@
1
+ // Wildcard module declarations for assets and stylesheets.
2
+ // This file is a script on purpose: index.d.ts is a module (it augments the
3
+ // global scope), and a wildcard `declare module` inside a module file is an
4
+ // augmentation TypeScript silently ignores, so the declares live here and
5
+ // index.d.ts pulls them in through a reference.
6
+
7
+ type CSSContentData = Readonly<Record<string, string>>
8
+ type CSSModuleData = Readonly<Record<string, string>>
9
+
10
+ declare module '*.css' {
11
+ const content: CSSContentData
12
+ export default content
13
+ }
14
+
15
+ declare module '*.module.css' {
16
+ const content: CSSModuleData
17
+ export default content
18
+ }
19
+ declare module '*.module.scss' {
20
+ const content: CSSModuleData
21
+ export default content
22
+ }
23
+ declare module '*.module.sass' {
24
+ const content: CSSModuleData
25
+ export default content
26
+ }
27
+
28
+ declare module '*.png' {
29
+ const content: string
30
+ export default content
31
+ }
32
+ declare module '*.jpg' {
33
+ const content: string
34
+ export default content
35
+ }
36
+ declare module '*.jpeg' {
37
+ const content: string
38
+ export default content
39
+ }
40
+ declare module '*.gif' {
41
+ const content: string
42
+ export default content
43
+ }
44
+ declare module '*.webp' {
45
+ const content: string
46
+ export default content
47
+ }
48
+ declare module '*.avif' {
49
+ const content: string
50
+ export default content
51
+ }
52
+ declare module '*.ico' {
53
+ const content: string
54
+ export default content
55
+ }
56
+ declare module '*.bmp' {
57
+ const content: string
58
+ export default content
59
+ }
60
+ declare module '*.svg' {
61
+ // Use any to avoid conflicts with SVGR or other SVG loaders.
62
+ // biome-ignore lint/suspicious/noExplicitAny: deliberate, a stricter type conflicts with SVGR-style loaders
63
+ const content: any
64
+ export default content
65
+ }
package/types/index.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  // This file is published by the extension package.
3
3
  /// <reference types="node" />
4
4
  /// <reference types="chrome" />
5
+ /// <reference path="./assets.d.ts" />
5
6
 
6
7
  declare global {
7
8
  // Align types with Extension.js runtime: we provide the browser global via
@@ -59,64 +60,4 @@ declare global {
59
60
  }
60
61
  }
61
62
 
62
- type CSSContentData = Readonly<Record<string, string>>
63
- type CSSModuleData = Readonly<Record<string, string>>
64
-
65
- declare module '*.css' {
66
- const content: CSSContentData
67
- export default content
68
- }
69
-
70
- declare module '*.module.css' {
71
- const content: CSSModuleData
72
- export default content
73
- }
74
- declare module '*.module.scss' {
75
- const content: CSSModuleData
76
- export default content
77
- }
78
- declare module '*.module.sass' {
79
- const content: CSSModuleData
80
- export default content
81
- }
82
-
83
- declare module '*.png' {
84
- const content: string
85
- export default content
86
- }
87
- declare module '*.jpg' {
88
- const content: string
89
- export default content
90
- }
91
- declare module '*.jpeg' {
92
- const content: string
93
- export default content
94
- }
95
- declare module '*.gif' {
96
- const content: string
97
- export default content
98
- }
99
- declare module '*.webp' {
100
- const content: string
101
- export default content
102
- }
103
- declare module '*.avif' {
104
- const content: string
105
- export default content
106
- }
107
- declare module '*.ico' {
108
- const content: string
109
- export default content
110
- }
111
- declare module '*.bmp' {
112
- const content: string
113
- export default content
114
- }
115
- declare module '*.svg' {
116
- // Use any to avoid conflicts with SVGR or other SVG loaders.
117
- // biome-ignore lint/suspicious/noExplicitAny: deliberate, a stricter type conflicts with SVGR-style loaders
118
- const content: any
119
- export default content
120
- }
121
-
122
63
  export {}