extension 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.
- package/README.md +1 -0
- package/dist/597.cjs +4 -0
- package/dist/browsers.cjs +101 -27
- package/dist/cli.cjs +545 -308
- package/dist/extension/browsers/browsers-lib/official-chrome.d.ts +2 -0
- package/dist/extension/browsers/browsers-lib/rename-with-retry.d.ts +6 -0
- package/dist/extension/browsers/run-chromium/cdp/cdp-extension-controller/ensure.d.ts +1 -0
- package/dist/extension/config-types.d.ts +6 -0
- package/dist/extension/helpers/cli-argv.d.ts +1 -0
- package/dist/extension/helpers/cli-failure.d.ts +1 -0
- package/dist/extension/helpers/dependency-install-outcome.d.ts +9 -0
- package/dist/extension/helpers/exit-after-drain.d.ts +1 -0
- package/dist/extension/helpers/known-commands.d.ts +2 -0
- package/dist/extension/helpers/messages.d.ts +3 -1
- package/dist/extension/helpers/messaging.d.ts +1 -0
- package/dist/extension/helpers/node-version-guard.d.ts +1 -0
- package/dist/extension/helpers/project-name-prompt.d.ts +4 -0
- package/dist/extension/helpers/telemetry-cli.d.ts +7 -4
- package/dist/extension/helpers/telemetry.d.ts +5 -0
- package/dist/extension/helpers/template-catalog.d.ts +1 -1
- package/dist/extension/helpers/template-corpus.generated.d.ts +1 -1
- package/package.json +6 -6
|
@@ -10,6 +10,7 @@ export type LoadUnpackedOutcome = {
|
|
|
10
10
|
} | {
|
|
11
11
|
status: 'unknown';
|
|
12
12
|
unsupported?: boolean;
|
|
13
|
+
transportError?: string;
|
|
13
14
|
};
|
|
14
15
|
export declare function loadUnpacked(cdp: CDPClient, outPath: string): Promise<LoadUnpackedOutcome>;
|
|
15
16
|
export declare function loadUnpackedIfNeeded(cdp: CDPClient, outPath: string): Promise<string | null>;
|
|
@@ -121,6 +121,12 @@ export interface ServeCommandConfig extends BrowserLaunchConfig, UnifiedLoggerCo
|
|
|
121
121
|
/** `commands.build` overrides. */
|
|
122
122
|
export interface BuildCommandConfig {
|
|
123
123
|
browser?: BrowserType;
|
|
124
|
+
/**
|
|
125
|
+
* Base folder for the build output, relative to the project root. The
|
|
126
|
+
* build writes `<outDir>/<browser>` instead of `dist/<browser>`, zip
|
|
127
|
+
* included, so it can run beside a dev session that serves `dist`.
|
|
128
|
+
*/
|
|
129
|
+
outDir?: string;
|
|
124
130
|
polyfill?: boolean;
|
|
125
131
|
zip?: boolean;
|
|
126
132
|
zipSource?: boolean;
|
|
@@ -2,6 +2,7 @@ import type { Command } from 'commander';
|
|
|
2
2
|
export declare function scanArgvValue(argv: string[], flag: string): string | undefined;
|
|
3
3
|
export declare function collectValuedLongFlags(program: Command): Set<string>;
|
|
4
4
|
export declare function resolveCommandFromArgv(argv: string[], valuedFlags?: ReadonlySet<string>): string | undefined;
|
|
5
|
+
export declare function movePreCommandOutputArgv(argv: string[], valuedFlags?: ReadonlySet<string>): string[];
|
|
5
6
|
export declare function rewriteOutputAliasArgv(argv: string[], valuedFlags?: ReadonlySet<string>): {
|
|
6
7
|
argv: string[];
|
|
7
8
|
rewritten: boolean;
|
|
@@ -9,6 +9,7 @@ interface CommanderErrorLike {
|
|
|
9
9
|
}
|
|
10
10
|
export declare function isCommanderError(err: unknown): err is CommanderErrorLike;
|
|
11
11
|
export declare function commanderExitCode(err: CommanderErrorLike): number;
|
|
12
|
+
export declare function codeForCommanderError(code: string): ErrorCode;
|
|
12
13
|
export declare function commanderErrorEnvelope(err: CommanderErrorLike, command: string): ReturnType<typeof ENVELOPE.fail>;
|
|
13
14
|
export declare function commanderHumanError(err: CommanderErrorLike, command: string): string;
|
|
14
15
|
export declare function isUsageCode(code: ErrorCode): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type DependencyInstallOutcome = 'skipped' | 'installed' | 'failed';
|
|
2
|
+
interface DependencyInstallRecord {
|
|
3
|
+
outcome: DependencyInstallOutcome;
|
|
4
|
+
seconds?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function recordDependencyInstall(outcome: DependencyInstallOutcome, seconds?: number): void;
|
|
7
|
+
export declare function readDependencyInstall(): DependencyInstallRecord | null;
|
|
8
|
+
export declare function resetDependencyInstall(): void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export type KnownCommand = 'build' | 'capabilities' | 'create' | 'dev' | 'doctor' | 'eval' | 'inspect' | 'install' | 'logs' | 'navigate' | 'open' | 'preview' | 'publish' | 'reload' | 'start' | 'storage' | 'telemetry' | 'uninstall' | 'unknown';
|
|
2
|
+
export declare const KNOWN_COMMANDS: ReadonlySet<KnownCommand>;
|
|
@@ -24,7 +24,7 @@ declare const COMMAND_TABLE: readonly [{
|
|
|
24
24
|
readonly name: 'create';
|
|
25
25
|
readonly positionals: readonly [{
|
|
26
26
|
readonly name: 'project-name|project-path';
|
|
27
|
-
readonly required:
|
|
27
|
+
readonly required: false;
|
|
28
28
|
}];
|
|
29
29
|
readonly description: 'Create a new extension from a template (React, TypeScript, Vue, Svelte, etc.)';
|
|
30
30
|
readonly supportsSourceInspection: false;
|
|
@@ -227,6 +227,8 @@ export declare function checkUpdates(packageJson: Record<string, unknown>, updat
|
|
|
227
227
|
suffix: string;
|
|
228
228
|
message: string;
|
|
229
229
|
};
|
|
230
|
+
export declare function createNeedsProjectName(command: string): string;
|
|
231
|
+
export declare function createProjectNameQuestion(defaultName: string): string;
|
|
230
232
|
export declare function noURLWithoutStart(argument: string): string;
|
|
231
233
|
export declare function notImplemented(argument: string): string;
|
|
232
234
|
export declare function programUserHelp(): string;
|
|
@@ -112,6 +112,7 @@ export declare const CODES: {
|
|
|
112
112
|
readonly E_POLYFILL_NOT_FOUND: 'E_POLYFILL_NOT_FOUND';
|
|
113
113
|
readonly E_LOCALES_LAYOUT: 'E_LOCALES_LAYOUT';
|
|
114
114
|
readonly E_WAR_INVALID: 'E_WAR_INVALID';
|
|
115
|
+
readonly E_DEV_SESSION_DIST_SHARED: 'E_DEV_SESSION_DIST_SHARED';
|
|
115
116
|
readonly E_BACKGROUND_REQUIRED: 'E_BACKGROUND_REQUIRED';
|
|
116
117
|
readonly E_CONTENT_SCRIPT_SYNTAX: 'E_CONTENT_SCRIPT_SYNTAX';
|
|
117
118
|
readonly E_NO_ENTRYPOINTS: 'E_NO_ENTRYPOINTS';
|
|
@@ -7,4 +7,5 @@ export declare function unsupportedDenoVersionMessage(version: string): string;
|
|
|
7
7
|
export declare function unsupportedBunVersionMessage(version: string): string;
|
|
8
8
|
export declare function unsupportedNodeVersionMessage(version: string): string;
|
|
9
9
|
export declare function unsupportedNodeVersionFrame(version: string, argv: string[]): Record<string, unknown> | undefined;
|
|
10
|
+
export declare function reportUnsupportedRuntime(argv?: string[]): void;
|
|
10
11
|
export declare function enforceSupportedNodeVersion(version?: string, bunVersion?: string | undefined, denoVersion?: string | undefined, argv?: string[]): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const DEFAULT_PROJECT_NAME = "my-extension";
|
|
2
|
+
export declare function canPromptForProjectName(): boolean;
|
|
3
|
+
export declare function askProjectName(question: string): Promise<string | null>;
|
|
4
|
+
export declare function createCommandFor(template: string | undefined): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { KNOWN_COMMANDS, type KnownCommand } from './known-commands.js';
|
|
1
2
|
import { Telemetry, type TelemetrySource } from './telemetry.js';
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
export declare function detectInvokedCommand(argv: string[]): KnownCommand;
|
|
3
|
+
export { KNOWN_COMMANDS };
|
|
4
|
+
export declare function detectInvokedCommand(argv: string[], valuedFlags?: ReadonlySet<string>): KnownCommand;
|
|
5
5
|
export declare function advertisedTemplateName(value: string | undefined): string | undefined;
|
|
6
6
|
export declare function createSourceTag(value: string | undefined): string;
|
|
7
7
|
export declare function telemetryCommandContext(command: string, argv?: string[]): {
|
|
@@ -10,6 +10,8 @@ export declare function telemetryCommandContext(command: string, argv?: string[]
|
|
|
10
10
|
browser_install?: string;
|
|
11
11
|
browser_install_browser?: string;
|
|
12
12
|
browser_install_seconds?: number;
|
|
13
|
+
deps_install?: string;
|
|
14
|
+
deps_install_seconds?: number;
|
|
13
15
|
};
|
|
14
16
|
export declare const telemetry: Telemetry;
|
|
15
17
|
export declare function getTelemetryConsent(): {
|
|
@@ -17,6 +19,7 @@ export declare function getTelemetryConsent(): {
|
|
|
17
19
|
source: TelemetrySource;
|
|
18
20
|
};
|
|
19
21
|
export declare function invokedCommand(): string;
|
|
22
|
+
export declare function resolveInvokedCommand(argv: string[], valuedFlags: ReadonlySet<string>): void;
|
|
20
23
|
export declare function setTelemetryConsent(value: 'enabled' | 'disabled'): {
|
|
21
24
|
ok: boolean;
|
|
22
25
|
path: string | null;
|
|
@@ -31,4 +34,4 @@ export interface CommandFailureDetails {
|
|
|
31
34
|
export declare function telemetryFailureCode(code: unknown): string | undefined;
|
|
32
35
|
export declare function telemetryExitCode(exitCode: unknown): number | undefined;
|
|
33
36
|
export declare function markCommandFailure(command?: KnownCommand, details?: CommandFailureDetails): void;
|
|
34
|
-
export
|
|
37
|
+
export declare function reportCommandFailureNow(details?: CommandFailureDetails): void;
|
|
@@ -8,6 +8,11 @@ export type TelemetryProps = {
|
|
|
8
8
|
session?: 'started';
|
|
9
9
|
code?: string;
|
|
10
10
|
exit_code?: number;
|
|
11
|
+
browser_install?: string;
|
|
12
|
+
browser_install_browser?: string;
|
|
13
|
+
browser_install_seconds?: number;
|
|
14
|
+
deps_install?: string;
|
|
15
|
+
deps_install_seconds?: number;
|
|
11
16
|
};
|
|
12
17
|
export type TelemetrySource = 'env' | 'flag' | 'config' | 'ci' | 'default';
|
|
13
18
|
type TelemetryInit = {
|
|
@@ -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/
|
|
3
|
+
export declare const TEMPLATE_CATALOG_URL = "https://github.com/extension-js/examples/tree/4753cbd121dac8784f4cb5c515b773f87ebff3b4/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 = "
|
|
2
|
+
export declare const TEMPLATE_CORPUS_REF = "4753cbd121dac8784f4cb5c515b773f87ebff3b4";
|
|
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.
|
|
41
|
+
"version": "4.1.35",
|
|
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.
|
|
108
|
-
"extension-develop": "4.1.
|
|
109
|
-
"extension-install": "4.1.
|
|
107
|
+
"extension-create": "4.1.35",
|
|
108
|
+
"extension-develop": "4.1.35",
|
|
109
|
+
"extension-install": "4.1.35",
|
|
110
110
|
"firefox-location2": "3.2.0",
|
|
111
111
|
"floorp-location": "1.0.0",
|
|
112
112
|
"librewolf-location": "1.2.1",
|
|
@@ -126,9 +126,9 @@
|
|
|
126
126
|
"@rslib/core": "^1.0.0",
|
|
127
127
|
"@types/semver": "^7.7.1",
|
|
128
128
|
"@types/ws": "^8.18.1",
|
|
129
|
-
"webextension-polyfill": "^0.12.0",
|
|
130
129
|
"tsconfig": "*",
|
|
131
130
|
"typescript": "7.0.2",
|
|
132
|
-
"vitest": "^5.0.
|
|
131
|
+
"vitest": "^5.0.5",
|
|
132
|
+
"webextension-polyfill": "^0.12.0"
|
|
133
133
|
}
|
|
134
134
|
}
|