extension 4.0.26 → 4.0.28

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.
@@ -18,7 +18,7 @@
18
18
  */
19
19
  export type ProfileKind = 'system' | 'explicit' | 'managed';
20
20
  export interface ResolveProfileInput {
21
- rawProfile?: string | false;
21
+ rawProfile?: string | boolean;
22
22
  /** Managed-profile base directory: `<distRoot>/extension-js/profiles/<browser>-profile`. */
23
23
  managedBaseDir: string;
24
24
  /** EXTENSION_USE_SYSTEM_PROFILE / EXTJS_USE_SYSTEM_PROFILE resolved to a boolean. */
@@ -39,6 +39,17 @@ export interface ResolvedProfile {
39
39
  /** Set when `copyFromProfile` seeded this run, for logging/visibility. */
40
40
  seededFrom?: string;
41
41
  }
42
+ /**
43
+ * The one interpretation of the `--profile` / `profile` option value.
44
+ * Commander delivers flag values as strings, so `--profile false` arrives as
45
+ * the string `'false'`. Without this normalization that string reads as an
46
+ * explicit path and a literal profile directory named `false` gets created.
47
+ *
48
+ * - `false` / `'false'`: the browser's own default profile (system).
49
+ * - `true` / `'true'`: the managed default (same as leaving the option unset).
50
+ * - any other string: an explicit profile path.
51
+ */
52
+ export declare function normalizeProfileOption(value: string | boolean | undefined): string | false | undefined;
42
53
  export declare function ensureProfileRootIgnoreFile(managedBaseDir: string): void;
43
54
  export declare function seedProfileFrom(source: string, dest: string): void;
44
55
  export declare function resolveProfileConfig(input: ResolveProfileInput): ResolvedProfile;
@@ -35,7 +35,7 @@ export interface BrowserConfig {
35
35
  *
36
36
  * Each flag disables or modifies a specific browser feature for a more controlled development environment.
37
37
  */
38
- export type DefaultBrowserFlags = '--no-first-run' | '--disable-client-side-phishing-detection' | '--disable-component-extensions-with-background-pages' | '--disable-default-apps' | '--disable-features=InterestFeedContentSuggestions' | '--disable-features=Translate' | '--hide-scrollbars' | '--mute-audio' | '--no-default-browser-check' | '--ash-no-nudges' | '--disable-search-engine-choice-screen' | '--disable-features=MediaRoute' | '--use-mock-keychain' | '--disable-background-networking' | '--disable-breakpad' | '--disable-component-update' | '--disable-domain-reliability' | '--disable-features=AutofillServerCommunicatio' | '--disable-features=CertificateTransparencyComponentUpdate' | '--disable-sync' | '--disable-features=OptimizationHints' | '--disable-features=DialMediaRouteProvider' | '--no-pings' | '--enable-features=SidePanelUpdates' | '--enable-unsafe-extension-debugging' | '--silent-debugger-extension-api';
38
+ export type DefaultBrowserFlags = '--no-first-run' | '--disable-client-side-phishing-detection' | '--disable-component-extensions-with-background-pages' | '--disable-default-apps' | '--disable-features=InterestFeedContentSuggestions' | '--disable-features=Translate' | '--hide-scrollbars' | '--mute-audio' | '--no-default-browser-check' | '--ash-no-nudges' | '--disable-search-engine-choice-screen' | '--disable-features=MediaRoute' | '--use-mock-keychain' | '--disable-background-networking' | '--disable-breakpad' | '--disable-component-update' | '--disable-domain-reliability' | '--disable-features=AutofillServerCommunicatio' | '--disable-features=CertificateTransparencyComponentUpdate' | '--disable-sync' | '--disable-features=OptimizationHints' | '--disable-features=DialMediaRouteProvider' | '--no-pings' | '--enable-features=SidePanelUpdates' | '--disable-features=DisableLoadExtensionCommandLineSwitch' | '--disable-features=ExtensionDisableUnsupportedDeveloper' | '--enable-unsafe-extension-debugging' | '--silent-debugger-extension-api';
39
39
  /**
40
40
  * Options for the browser plugin.
41
41
  */
@@ -17,6 +17,13 @@ type PreviewRunOptions = {
17
17
  port?: number | string;
18
18
  dryRun?: boolean;
19
19
  readyPath?: string;
20
+ logLevel?: string;
21
+ logContexts?: string[];
22
+ logFormat?: 'pretty' | 'json' | 'ndjson';
23
+ logTimestamps?: boolean;
24
+ logColor?: boolean;
25
+ logUrl?: string;
26
+ logTab?: number | string;
20
27
  };
21
28
  export declare function runOnlyPreviewBrowser(opts: PreviewRunOptions): Promise<void>;
22
29
  export {};
@@ -10,6 +10,8 @@ export interface SafariPackagerOverrides {
10
10
  macOsOnly?: boolean;
11
11
  forceRegenerate?: boolean;
12
12
  safariBinary?: string;
13
+ /** When set, overrides the factory `noOpen` for this packaging call. */
14
+ noOpen?: boolean;
13
15
  }
14
16
  export interface SafariPackagerOptions extends SafariPackagerOverrides {
15
17
  /** 'safari' or 'webkit-based'. Defaults to 'safari'. */
@@ -10,6 +10,10 @@ interface DoctorOptions {
10
10
  browser?: string;
11
11
  output?: 'pretty' | 'json';
12
12
  }
13
+ export declare function resolveDoctorBrowser(projectPathArg: string | undefined, optsBrowser: string | undefined): {
14
+ browser: string;
15
+ sessionBrowsers: string[];
16
+ };
13
17
  /**
14
18
  * Walks the control-channel legs in dependency order and reports the first
15
19
  * failing one with a remediation, instead of the dead-end errors each verb
@@ -1,4 +1,12 @@
1
1
  import type { Command } from 'commander';
2
+ export interface StoredLogin {
3
+ token: string;
4
+ projectSlug: string;
5
+ workspaceSlug: string;
6
+ }
7
+ export declare function readStoredLogin(): StoredLogin | null;
8
+ export declare function readStoredLoginToken(): string;
9
+ export declare function readLocalProjectName(projectPath: string): string;
2
10
  export interface PublishRequest {
3
11
  url: string;
4
12
  headers: Record<string, string>;
@@ -9,7 +17,24 @@ export interface PublishInput {
9
17
  api?: string;
10
18
  ttl?: string | number;
11
19
  buildSha?: string;
20
+ projectPath?: string;
21
+ project?: string;
22
+ }
23
+ /**
24
+ * The project this publish will act for, and where that answer came from. A
25
+ * stored login is scoped to one project, so a publish run anywhere else answers
26
+ * for the wrong one; `actsFor` is what the command prints and refuses on.
27
+ */
28
+ export interface PublishScope {
29
+ source: 'flag' | 'env' | 'stored-login';
30
+ actsFor: string;
31
+ workspace: string;
32
+ localName: string;
12
33
  }
13
34
  /** Build the HTTP request (pure, unit-testable, no network). */
14
35
  export declare function buildPublishRequest(opts: PublishInput): PublishRequest;
36
+ export declare function buildPublishPlan(opts: PublishInput): {
37
+ request: PublishRequest;
38
+ scope: PublishScope;
39
+ };
15
40
  export declare function registerPublishCommand(program: Command): void;
@@ -50,6 +50,13 @@ export interface BrowserConfig extends BrowserLaunchConfig {
50
50
  geckoBinary?: string;
51
51
  firefoxBinary?: string;
52
52
  }
53
+ /** Asset categories the perf-budgets plugin recognizes. */
54
+ export type PerfBudgetCategory = 'content-script' | 'service-worker' | 'page' | 'ignored';
55
+ /**
56
+ * Per-category asset size budgets (bytes) for compiling commands.
57
+ * Set at the top level, or per command via `commands.dev|build.perfBudgets`.
58
+ */
59
+ export type PerfBudgetsConfig = Partial<Record<PerfBudgetCategory, number>>;
53
60
  /** `commands.dev` overrides. */
54
61
  export interface DevCommandConfig extends BrowserLaunchConfig, UnifiedLoggerConfig {
55
62
  browser?: BrowserType;
@@ -60,6 +67,7 @@ export interface DevCommandConfig extends BrowserLaunchConfig, UnifiedLoggerConf
60
67
  noBrowser?: boolean;
61
68
  polyfill?: boolean;
62
69
  hashContentScripts?: boolean;
70
+ perfBudgets?: PerfBudgetsConfig;
63
71
  }
64
72
  /** Shared `commands.start` / `commands.preview` overrides. */
65
73
  export interface ServeCommandConfig extends BrowserLaunchConfig, UnifiedLoggerConfig {
@@ -80,8 +88,10 @@ export interface BuildCommandConfig {
80
88
  zip?: boolean;
81
89
  zipSource?: boolean;
82
90
  zipFilename?: string;
91
+ silent?: boolean;
83
92
  extensions?: CompanionExtensionsConfig;
84
93
  transpilePackages?: string[];
94
+ perfBudgets?: PerfBudgetsConfig;
85
95
  }
86
96
  /**
87
97
  * The shape of `extension.config.js`.
@@ -119,6 +129,11 @@ export interface FileConfig {
119
129
  * `commands.<name>.transpilePackages` overrides this value.
120
130
  */
121
131
  transpilePackages?: string[];
132
+ /**
133
+ * Default per-category asset budgets for all commands. Per-command
134
+ * `commands.dev|build.perfBudgets` overrides this value.
135
+ */
136
+ perfBudgets?: PerfBudgetsConfig;
122
137
  /**
123
138
  * Escape hatch to customize the underlying Rspack/webpack-compatible
124
139
  * configuration. Receives and returns a bundler `Configuration` object.
@@ -0,0 +1,19 @@
1
+ import type { Command } from 'commander';
2
+ /**
3
+ * True when the user typed this option on the CLI (not a commander default).
4
+ * Negated boolean options (`--no-open`, `--no-log-color`) set a default value
5
+ * even when absent. Use this to leave those unset so extension.config.js
6
+ * `commands.*` values can apply downstream.
7
+ */
8
+ export declare function isExplicitCliOption(command: Command, name: string): boolean;
9
+ /**
10
+ * Return `value` only when the user typed the flag, `undefined` otherwise,
11
+ * so develop can fall through to extension.config.js and stock defaults.
12
+ */
13
+ export declare function explicitCliValue<T>(command: Command, name: string, value: T): T | undefined;
14
+ /**
15
+ * Coerce an optional boolean CLI value without inventing a default. Commander
16
+ * may leave the key unset, or set a boolean/string from `--flag`,
17
+ * `--flag false`, or `--no-flag`.
18
+ */
19
+ export declare function explicitOptionalBoolean(value: boolean | string | undefined): boolean | undefined;
package/package.json CHANGED
@@ -38,7 +38,7 @@
38
38
  "extension": "./bin/extension.cjs"
39
39
  },
40
40
  "name": "extension",
41
- "version": "4.0.26",
41
+ "version": "4.0.28",
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": {
@@ -95,20 +95,20 @@
95
95
  "cli"
96
96
  ],
97
97
  "dependencies": {
98
- "brave-location": "3.1.0",
99
- "chrome-location2": "4.1.0",
100
- "chromium-location": "2.1.1",
98
+ "brave-location": "3.1.1",
99
+ "chrome-location2": "4.1.1",
100
+ "chromium-location": "2.1.2",
101
101
  "cross-spawn": "^7.0.6",
102
- "edge-location": "2.3.0",
103
- "firefox-location2": "3.1.0",
104
- "librewolf-location": "1.2.0",
105
- "opera-location2": "2.1.0",
106
- "vivaldi-location2": "2.1.0",
107
- "waterfox-location": "2.1.0",
108
- "yandex-location": "2.1.0",
109
- "extension-create": "4.0.26",
110
- "extension-develop": "4.0.26",
111
- "extension-install": "4.0.26",
102
+ "edge-location": "2.3.1",
103
+ "firefox-location2": "3.1.1",
104
+ "librewolf-location": "1.2.1",
105
+ "opera-location2": "2.1.1",
106
+ "vivaldi-location2": "2.1.1",
107
+ "waterfox-location": "2.1.1",
108
+ "yandex-location": "2.1.1",
109
+ "extension-create": "4.0.28",
110
+ "extension-develop": "4.0.28",
111
+ "extension-install": "4.0.28",
112
112
  "commander": "^15.0.0",
113
113
  "pintor": "0.3.0",
114
114
  "semver": "^7.7.3",