extension 4.1.35 → 4.1.36

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.
@@ -20,6 +20,10 @@ export interface FakeSafariToolsOptions {
20
20
  };
21
21
  automationMatch?: string;
22
22
  appMatch?: string;
23
+ codesign?: {
24
+ output: string;
25
+ };
26
+ xcodeTeams?: string;
23
27
  }
24
28
  export interface FakeSafariTools extends SafariPipelineTools {
25
29
  calls: {
@@ -30,6 +34,8 @@ export interface FakeSafariTools extends SafariPipelineTools {
30
34
  resolvePid: string[];
31
35
  pluginkit: number;
32
36
  webdriver: number[];
37
+ codesign: string[];
38
+ xcodeTeams: number;
33
39
  };
34
40
  webdriverProcesses: SafariWebDriverProcess[];
35
41
  events: string[];
@@ -1,6 +1,7 @@
1
1
  export declare const COMPANION_SESSION_FLAGS_FILE = "extension-js-session.json";
2
2
  export interface CompanionSessionFlags {
3
3
  noOpen: boolean;
4
+ startingUrl: boolean;
4
5
  }
5
6
  export declare function isDevtoolsCompanionPath(extensionPath: string): boolean;
6
7
  export declare function companionPathsForCdpLoad(extensionPaths: string[], outPath: string): string[];
@@ -8,6 +9,7 @@ export declare function stagedCompanionPath(stageRoot: string, companionPath: st
8
9
  export declare function stageCompanionForSession(input: {
9
10
  extensionPaths: string[];
10
11
  noOpen?: boolean;
12
+ startingUrl?: boolean;
11
13
  browser?: string;
12
14
  stageRoot?: string;
13
15
  provision?: boolean;
@@ -75,6 +75,13 @@ export type SystemProfileSource = {
75
75
  export declare function geckoSystemProfileRefused(browser: Browser, sources: SystemProfileSource[]): string;
76
76
  export declare function browserStderrTail(browser: Browser, lines: string[]): string;
77
77
  export declare function browserGoneBeforeReady(browser: Browser): string;
78
+ export declare function browserUpNotAttached(opts: {
79
+ browser: Browser;
80
+ browserPid?: number;
81
+ profilePath?: string;
82
+ profileReused: boolean;
83
+ waitedMs: number;
84
+ }): string;
78
85
  export declare function chromeProcessError(error: unknown): string;
79
86
  export declare function chromeFailedToSpawn(error: unknown): string;
80
87
  export declare function chromeInitializingEnhancedReload(browser: Browser): string;
@@ -103,14 +110,30 @@ export declare function safariConverted(projectDir: string): string;
103
110
  export declare function safariBuilding(scheme: string): string;
104
111
  export declare function safariBuilt(appPath: string): string;
105
112
  export declare function safariOpening(target: string): string;
106
- export declare function safariToolFailed(tool: string, exitCode: number | null, outputTail: string): string;
113
+ export declare function safariToolFailed(tool: string, exitCode: number | null, outputTail: string, cause?: string): string;
114
+ export interface SafariKnownTeam {
115
+ id: string;
116
+ name: string | null;
117
+ }
118
+ export declare function safariTeamRemedyLines(team: string, knownTeams?: SafariKnownTeam[]): string[];
119
+ export declare function safariNoAccountForTeam(team: string, knownTeams?: SafariKnownTeam[]): string;
120
+ export interface SafariSigningNote {
121
+ team?: string | null;
122
+ requestedTeam?: string;
123
+ noAccount?: boolean;
124
+ knownTeams?: SafariKnownTeam[];
125
+ }
107
126
  export declare function safariConverterWarnings(warnings: string[]): string;
108
127
  export declare function safariDefaultBundleIdNote(bundleId: string): string;
109
128
  export declare function safariOpenHint(appPath: string, appName: string): string;
110
129
  export declare function safariDryRunNotBuilding(): string;
111
130
  export declare function safariDryRunConverter(cmd: string): string;
112
131
  export declare function safariDryRunXcodebuild(cmd: string): string;
113
- export declare function safariNextSteps(appName: string, signed?: boolean): string;
132
+ export declare const SAFARI_AD_HOC_LOADING = "Safari runs an ad-hoc build only while unsigned extensions are allowed, and Safari turns that off at quit";
133
+ export declare const SAFARI_TEAM_SIGNED_LOADING = "A team-signed build needs no toggle, and the Apple Development certificate of an Xcode account signed in on this Mac is enough for local runs, no Developer ID needed";
134
+ export declare const SAFARI_DEVELOPMENT_TEAM_HELP: string;
135
+ export declare function safariNextSteps(appName: string, signed?: boolean, signing?: SafariSigningNote): string;
136
+ export declare function safariSigningChanged(appName: string, before: string, after: string): string;
114
137
  export declare function safariEnableStep(step: string, before: string | null, after: string | null, detail?: string): string;
115
138
  export declare function safariEnabled(appName: string, otherWebsites: string | null): string;
116
139
  export declare function safariEnableIncomplete(appName: string, reason: string): string;
@@ -126,7 +149,6 @@ export declare function safariForcedRegeneration(): string;
126
149
  export declare function safariRegenerationDiscards(preservedKeys: string[]): string;
127
150
  export declare function safariSettingsPreserved(keys: string[]): string;
128
151
  export declare function safariBuildUpToDate(): string;
129
- export declare function safariStorageReset(appName: string): string;
130
152
  export declare function safariSkippingConversion(): string;
131
153
  export declare function cdpClientFoundTargets(count: number): string;
132
154
  export declare function cdpClientTargetWebSocketUrlStored(): string;
@@ -15,6 +15,12 @@ export declare function stampReadyBrowserLaunch(extensionOutputPath: string | un
15
15
  extensionId?: string;
16
16
  binary?: string;
17
17
  binaryProvenance?: 'managed' | 'pinned' | 'system' | 'snapshot';
18
+ profileReused?: boolean;
19
+ }, runId?: string): void;
20
+ export declare function readReadyExecutorAttached(extensionOutputPath: string | undefined, runId?: string): boolean;
21
+ export declare function stampReadyBrowserUpNotAttached(extensionOutputPath: string | undefined, details: {
22
+ waitedMs: number;
23
+ hint: string;
18
24
  }, runId?: string): void;
19
25
  export declare function describeLaunchFailure(error: unknown): string;
20
26
  export declare function stampReadyBrowserLaunchFailed(extensionOutputPath: string | undefined, reason: string, runId?: string, errorCode?: string): void;
@@ -1,5 +1,7 @@
1
1
  import type { CompilationLike, DefaultBrowserFlags, PluginInterface } from '../../browsers-types.js';
2
2
  export declare const DEFAULT_BROWSER_FLAGS: DefaultBrowserFlags[];
3
+ export declare const HEADLESS_ONLY_BROWSER_FLAGS: string[];
4
+ export declare function applyLaunchModeFlags(flags: string[], excludeFlags?: string[]): string[];
3
5
  export declare function getChromiumMasterPreferences(browser: PluginInterface['browser']): Record<string, unknown>;
4
6
  export interface BrowserConfigMode {
5
7
  provision?: boolean;
@@ -12,6 +12,8 @@ export declare class ChromiumLaunchPlugin {
12
12
  private readonly ctx;
13
13
  private didLaunch;
14
14
  private didReportReady;
15
+ private readyDeferred;
16
+ private profileReused;
15
17
  private browserGone;
16
18
  private didSpawn;
17
19
  private extensionLoadRefused;
@@ -28,6 +30,15 @@ export declare class ChromiumLaunchPlugin {
28
30
  private stampCdpFault;
29
31
  apply(compiler: unknown): void;
30
32
  private launchChromium;
33
+ reportReadyWhenAttached(opts: {
34
+ compilation: CompilationLike;
35
+ enableCdp: boolean;
36
+ reportReady: () => void;
37
+ browserPid?: number;
38
+ profilePath?: string;
39
+ graceMs?: number;
40
+ pollMs?: number;
41
+ }): Promise<void>;
31
42
  private waitForBrowserGone;
32
43
  private printDryRunPlan;
33
44
  private launchWithDirectSpawn;
@@ -0,0 +1,18 @@
1
+ import type { SafariBuildConfig } from '../safari-types.js';
2
+ export interface SafariCodeSignature {
3
+ signed: boolean;
4
+ team: string | null;
5
+ }
6
+ export declare const ADHOC_SIGNATURE = "adhoc";
7
+ export declare function parseCodeSignature(output: string): SafariCodeSignature;
8
+ export declare function signatureKey(signature: SafariCodeSignature): string;
9
+ export declare function describeSignature(key: string | null): string;
10
+ export declare function noAccountForTeam(output: string): string | null;
11
+ export interface XcodeTeam {
12
+ id: string;
13
+ name: string | null;
14
+ }
15
+ export declare function parseXcodeTeams(output: string): XcodeTeam[];
16
+ export declare function signatureRecordPath(config: SafariBuildConfig): string;
17
+ export declare function readSignatureRecord(config: SafariBuildConfig): string | null;
18
+ export declare function saveSignatureRecord(config: SafariBuildConfig, signature: SafariCodeSignature): void;
@@ -22,6 +22,8 @@ export interface SafariPipelineTools {
22
22
  startWebDriver(port: number): Promise<SafariWebDriverProcess>;
23
23
  listAutomationPids(): Promise<number[]>;
24
24
  listAppPids(appPath: string): Promise<number[]>;
25
+ readCodeSignature(appPath: string): Promise<SafariToolResult>;
26
+ readXcodeTeams(): Promise<string>;
25
27
  }
26
28
  export declare function isAutomationSafariArgs(args: string): boolean;
27
29
  export declare function isContainerAppArgs(appPath: string, args: string): boolean;
@@ -1,4 +1,6 @@
1
1
  import type { SafariPipelineTools } from './tools.js';
2
+ export declare const WEBDRIVER_NOT_ASKED_YET = "the launcher has not asked safaridriver for a session yet: it opens the app and enables the extension first, then asks, and this line is replaced by the session or by the reason it got none";
3
+ export declare const WEBDRIVER_SESSION_PENDING = "the launcher is asking safaridriver for a session now: the request alone waits up to 30 s, and this line is replaced by the session or by the reason it got none";
2
4
  export interface SafariWebDriverSession {
3
5
  port: number;
4
6
  sessionId: string;
@@ -113,6 +113,7 @@ export declare const CODES: {
113
113
  readonly E_LOCALES_LAYOUT: 'E_LOCALES_LAYOUT';
114
114
  readonly E_WAR_INVALID: 'E_WAR_INVALID';
115
115
  readonly E_DEV_SESSION_DIST_SHARED: 'E_DEV_SESSION_DIST_SHARED';
116
+ readonly E_PROD_LOOPBACK_ORIGIN: 'E_PROD_LOOPBACK_ORIGIN';
116
117
  readonly E_BACKGROUND_REQUIRED: 'E_BACKGROUND_REQUIRED';
117
118
  readonly E_CONTENT_SCRIPT_SYNTAX: 'E_CONTENT_SCRIPT_SYNTAX';
118
119
  readonly E_NO_ENTRYPOINTS: 'E_NO_ENTRYPOINTS';
@@ -1,6 +1,6 @@
1
1
  export declare const DEFAULT_TEMPLATE = "typescript";
2
2
  export declare const BUNDLED_TEMPLATES: readonly string[];
3
- export declare const TEMPLATE_CATALOG_URL = "https://github.com/extension-js/examples/tree/4753cbd121dac8784f4cb5c515b773f87ebff3b4/examples";
3
+ export declare const TEMPLATE_CATALOG_URL = "https://github.com/extension-js/examples/tree/6443985200d0a27526662fc7be5d13fe66a0fa2b/examples";
4
4
  export interface TemplateGroup {
5
5
  title: string;
6
6
  summary: string;
@@ -1,3 +1,3 @@
1
1
  export declare const TEMPLATE_CORPUS_REPO = "extension-js/examples";
2
- export declare const TEMPLATE_CORPUS_REF = "4753cbd121dac8784f4cb5c515b773f87ebff3b4";
2
+ export declare const TEMPLATE_CORPUS_REF = "6443985200d0a27526662fc7be5d13fe66a0fa2b";
3
3
  export declare const TEMPLATE_CORPUS_SLUGS: readonly string[];
package/package.json CHANGED
@@ -38,7 +38,7 @@
38
38
  "extension": "./bin/extension.cjs"
39
39
  },
40
40
  "name": "extension",
41
- "version": "4.1.35",
41
+ "version": "4.1.36",
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
  "funding": "https://github.com/sponsors/cezaraugusto",
@@ -104,9 +104,9 @@
104
104
  "chromium-location": "2.1.2",
105
105
  "commander": "^15.0.0",
106
106
  "edge-location": "2.3.1",
107
- "extension-create": "4.1.35",
108
- "extension-develop": "4.1.35",
109
- "extension-install": "4.1.35",
107
+ "extension-create": "4.1.36",
108
+ "extension-develop": "4.1.36",
109
+ "extension-install": "4.1.36",
110
110
  "firefox-location2": "3.2.0",
111
111
  "floorp-location": "1.0.0",
112
112
  "librewolf-location": "1.2.1",
package/types/index.d.ts CHANGED
@@ -9,12 +9,27 @@ declare global {
9
9
  // webextension-polyfill in Chromium; Firefox and Safari ship it natively.
10
10
  const browser: typeof import('webextension-polyfill')
11
11
 
12
+ // Every target the CLI accepts for --browser, so a branch on
13
+ // process.env.EXTENSION_PUBLIC_BROWSER typechecks for each of them.
12
14
  type ExtensionBrowser =
13
15
  | 'chrome'
14
16
  | 'edge'
15
17
  | 'firefox'
18
+ | 'chromium'
19
+ | 'brave'
20
+ | 'opera'
21
+ | 'vivaldi'
22
+ | 'yandex'
23
+ | 'waterfox'
24
+ | 'librewolf'
25
+ | 'zen'
26
+ | 'floorp'
16
27
  | 'chromium-based'
17
28
  | 'gecko-based'
29
+ | 'firefox-based'
30
+ | 'safari'
31
+ | 'webkit-based'
32
+ | 'chromium-emulator'
18
33
 
19
34
  type ExtensionMode = 'development' | 'production'
20
35