extension 3.14.0-next.0 → 3.14.0
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/dist/cli.cjs +318 -708
- package/dist/extension/commands/build.d.ts +1 -1
- package/dist/extension/commands/create.d.ts +1 -1
- package/dist/extension/commands/dev.d.ts +1 -1
- package/dist/extension/commands/install.d.ts +1 -1
- package/dist/extension/commands/preview.d.ts +1 -1
- package/dist/extension/commands/start.d.ts +1 -1
- package/dist/extension/commands/telemetry.d.ts +2 -0
- package/dist/extension/helpers/messages.d.ts +2 -1
- package/dist/extension/helpers/telemetry-cli.d.ts +13 -3
- package/dist/extension/helpers/telemetry.d.ts +37 -7
- package/package.json +4 -4
- package/dist/extension/helpers/manifest-summary.d.ts +0 -13
- package/dist/extension/helpers/project-profile.d.ts +0 -17
- package/dist/extension/helpers/workflow-profile.d.ts +0 -35
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Command } from 'commander';
|
|
2
|
-
export declare function registerBuildCommand(program: Command
|
|
2
|
+
export declare function registerBuildCommand(program: Command): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Command } from 'commander';
|
|
2
|
-
export declare function registerCreateCommand(program: Command
|
|
2
|
+
export declare function registerCreateCommand(program: Command): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Command } from 'commander';
|
|
2
|
-
export declare function registerDevCommand(program: Command
|
|
2
|
+
export declare function registerDevCommand(program: Command): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Command } from 'commander';
|
|
2
|
-
export declare function registerInstallCommand(program: Command
|
|
2
|
+
export declare function registerInstallCommand(program: Command): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Command } from 'commander';
|
|
2
|
-
export declare function registerPreviewCommand(program: Command
|
|
2
|
+
export declare function registerPreviewCommand(program: Command): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Command } from 'commander';
|
|
2
|
-
export declare function registerStartCommand(program: Command
|
|
2
|
+
export declare function registerStartCommand(program: Command): void;
|
|
@@ -15,6 +15,7 @@ export declare const commandDescriptions: {
|
|
|
15
15
|
readonly build: "Builds the extension for packaging/distribution";
|
|
16
16
|
readonly install: "Installs a managed browser binary into Extension.js cache";
|
|
17
17
|
readonly uninstall: "Removes managed browser binaries from Extension.js cache";
|
|
18
|
+
readonly telemetry: "Manage anonymous telemetry consent (enable, disable, or show status)";
|
|
18
19
|
};
|
|
19
20
|
export declare function unhandledError(err: unknown): string;
|
|
20
21
|
export declare function updateFailed(err: any): string;
|
|
@@ -35,7 +36,7 @@ export declare function programAIHelp(): string;
|
|
|
35
36
|
export type ProgramAIHelpJSON = {
|
|
36
37
|
version: string;
|
|
37
38
|
commands: Array<{
|
|
38
|
-
name: 'create' | 'dev' | 'start' | 'preview' | 'build' | 'install' | 'uninstall';
|
|
39
|
+
name: 'create' | 'dev' | 'start' | 'preview' | 'build' | 'install' | 'uninstall' | 'telemetry';
|
|
39
40
|
summary: string;
|
|
40
41
|
supportsSourceInspection: boolean;
|
|
41
42
|
}>;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import { Telemetry } from './telemetry';
|
|
2
|
-
type KnownCommand = 'create' | 'dev' | 'start' | 'preview' | 'build' | 'install' | 'uninstall' | '
|
|
3
|
-
export declare const telemetry: Telemetry;
|
|
1
|
+
import { Telemetry, type TelemetrySource } from './telemetry';
|
|
2
|
+
type KnownCommand = 'create' | 'dev' | 'start' | 'preview' | 'build' | 'install' | 'uninstall' | 'telemetry' | 'unknown';
|
|
4
3
|
export declare function detectInvokedCommand(argv: string[]): KnownCommand;
|
|
4
|
+
export declare const telemetry: Telemetry;
|
|
5
|
+
export declare function getTelemetryConsent(): {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
source: TelemetrySource;
|
|
8
|
+
};
|
|
9
|
+
export declare function setTelemetryConsent(value: 'enabled' | 'disabled'): {
|
|
10
|
+
ok: boolean;
|
|
11
|
+
path: string | null;
|
|
12
|
+
};
|
|
13
|
+
export declare function markCommandSuccess(command?: KnownCommand): void;
|
|
14
|
+
export declare function markCommandFailure(command?: KnownCommand): void;
|
|
5
15
|
export {};
|
|
@@ -1,23 +1,53 @@
|
|
|
1
|
+
export type TelemetryEvent = 'command_executed' | 'command_failed';
|
|
2
|
+
export type TelemetryProps = {
|
|
3
|
+
command: string;
|
|
4
|
+
success: boolean;
|
|
5
|
+
version: string;
|
|
6
|
+
};
|
|
7
|
+
export type TelemetrySource = 'env' | 'flag' | 'config' | 'default';
|
|
1
8
|
type TelemetryInit = {
|
|
2
9
|
app: string;
|
|
3
10
|
version: string;
|
|
4
11
|
apiKey?: string;
|
|
5
12
|
host?: string;
|
|
6
13
|
disabled?: boolean;
|
|
14
|
+
sampleRate?: number;
|
|
15
|
+
maxEventsPerRun?: number;
|
|
16
|
+
debounceMs?: number;
|
|
17
|
+
};
|
|
18
|
+
type TelemetryStorage = {
|
|
19
|
+
telemetryDir: string;
|
|
20
|
+
auditFile: string;
|
|
21
|
+
idFile: string;
|
|
22
|
+
consentFile: string;
|
|
7
23
|
};
|
|
24
|
+
export declare function resolveTelemetryStorage(): TelemetryStorage | null;
|
|
25
|
+
export declare function resolveTelemetryConsent(argv?: string[]): {
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
source: TelemetrySource;
|
|
28
|
+
};
|
|
29
|
+
export declare function writeConsent(value: 'enabled' | 'disabled'): boolean;
|
|
8
30
|
export declare class Telemetry {
|
|
9
|
-
private anonId;
|
|
10
|
-
private common;
|
|
11
|
-
private debug;
|
|
12
31
|
private disabled;
|
|
13
|
-
private
|
|
14
|
-
private
|
|
32
|
+
private version;
|
|
33
|
+
private app;
|
|
34
|
+
private apiKey;
|
|
35
|
+
private host;
|
|
36
|
+
private anonId;
|
|
15
37
|
private storage;
|
|
38
|
+
private sent;
|
|
39
|
+
private readonly sampleRate;
|
|
40
|
+
private readonly maxEventsPerRun;
|
|
41
|
+
private readonly debounceMs;
|
|
42
|
+
private readonly debug;
|
|
43
|
+
private readonly common;
|
|
44
|
+
private recent;
|
|
16
45
|
private buffer;
|
|
17
|
-
private timer;
|
|
18
46
|
constructor(init: TelemetryInit);
|
|
19
|
-
|
|
47
|
+
get isEnabled(): boolean;
|
|
48
|
+
track(event: TelemetryEvent, props: TelemetryProps): void;
|
|
20
49
|
flush(): Promise<void>;
|
|
21
50
|
shutdown(): void;
|
|
51
|
+
private writeAudit;
|
|
22
52
|
}
|
|
23
53
|
export {};
|
package/package.json
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"extension": "./bin/extension.cjs"
|
|
39
39
|
},
|
|
40
40
|
"name": "extension",
|
|
41
|
-
"version": "3.14.0
|
|
41
|
+
"version": "3.14.0",
|
|
42
42
|
"description": "Create cross-browser extensions with no build configuration.",
|
|
43
43
|
"homepage": "https://extension.js.org/",
|
|
44
44
|
"bugs": {
|
|
@@ -100,9 +100,9 @@
|
|
|
100
100
|
"cross-spawn": "^7.0.6",
|
|
101
101
|
"edge-location": "2.2.0",
|
|
102
102
|
"firefox-location2": "3.0.0",
|
|
103
|
-
"extension-create": "3.14.0
|
|
104
|
-
"extension-develop": "3.14.0
|
|
105
|
-
"extension-install": "3.14.0
|
|
103
|
+
"extension-create": "3.14.0",
|
|
104
|
+
"extension-develop": "3.14.0",
|
|
105
|
+
"extension-install": "3.14.0",
|
|
106
106
|
"commander": "^14.0.3",
|
|
107
107
|
"pintor": "0.3.0",
|
|
108
108
|
"semver": "^7.7.3",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type ManifestSummary = {
|
|
2
|
-
mv: 2 | 3;
|
|
3
|
-
permissions_count: number;
|
|
4
|
-
optional_permissions_count: number;
|
|
5
|
-
host_permissions_count: number;
|
|
6
|
-
uses_all_urls: boolean;
|
|
7
|
-
uses_declarative_net_request: boolean;
|
|
8
|
-
background_type: 'service_worker' | 'event_page' | 'none';
|
|
9
|
-
content_scripts_count: number;
|
|
10
|
-
has_devtools_page: boolean;
|
|
11
|
-
has_action_popup: boolean;
|
|
12
|
-
};
|
|
13
|
-
export declare function summarizeManifest(manifest: any): ManifestSummary;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ManifestSummary } from './manifest-summary';
|
|
2
|
-
export type PackageManagerName = 'pnpm' | 'yarn' | 'npm' | 'bun' | 'unknown';
|
|
3
|
-
export type FrameworkPrimary = 'react' | 'preact' | 'vue' | 'svelte' | 'solid' | 'angular' | 'unknown';
|
|
4
|
-
export type PermissionBucket = '0' | '1_3' | '4_10' | '11_plus';
|
|
5
|
-
export type ManifestSurface = 'background_only' | 'content_scripts' | 'action_popup' | 'devtools' | 'multi_surface' | 'other' | 'unknown';
|
|
6
|
-
export type ProjectProfile = {
|
|
7
|
-
package_manager: PackageManagerName;
|
|
8
|
-
framework_primary: FrameworkPrimary;
|
|
9
|
-
has_typescript: boolean;
|
|
10
|
-
is_monorepo: boolean;
|
|
11
|
-
has_next_dependency: boolean;
|
|
12
|
-
has_turbo_dependency: boolean;
|
|
13
|
-
manifest_surface: ManifestSurface;
|
|
14
|
-
permissions_bucket: PermissionBucket;
|
|
15
|
-
host_permissions_bucket: PermissionBucket;
|
|
16
|
-
};
|
|
17
|
-
export declare function collectProjectProfile(projectRoot: string, summary?: ManifestSummary | null): ProjectProfile | null;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { FrameworkPrimary, PackageManagerName } from './project-profile';
|
|
2
|
-
export type WorkflowCohort = 'local_only' | 'shipping' | 'automation_heavy';
|
|
3
|
-
type WorkflowProjectShape = {
|
|
4
|
-
packageManager?: PackageManagerName;
|
|
5
|
-
frameworkPrimary?: FrameworkPrimary;
|
|
6
|
-
hasNextDependency?: boolean;
|
|
7
|
-
hasTurboDependency?: boolean;
|
|
8
|
-
};
|
|
9
|
-
type WorkflowContext = {
|
|
10
|
-
command: 'create' | 'dev' | 'start' | 'preview' | 'build' | 'install' | 'uninstall';
|
|
11
|
-
isMultiBrowser?: boolean;
|
|
12
|
-
isRemoteInput?: boolean;
|
|
13
|
-
isWaitMode?: boolean;
|
|
14
|
-
isNoBrowserMode?: boolean;
|
|
15
|
-
usesMachineReadableOutput?: boolean;
|
|
16
|
-
sourceInspectionRequested?: boolean;
|
|
17
|
-
companionExtensionsProvided?: boolean;
|
|
18
|
-
artifactKind?: 'directory' | 'zip' | 'source_zip' | 'zip_and_source';
|
|
19
|
-
whereMode?: boolean;
|
|
20
|
-
} & WorkflowProjectShape;
|
|
21
|
-
type WorkflowReason = 'production_command' | 'multi_browser' | 'artifact_output' | 'companion_extensions' | 'headless_sync' | 'machine_readable_output' | 'source_inspection' | 'where_mode';
|
|
22
|
-
export type WorkflowProfile = {
|
|
23
|
-
workflow_cohort: WorkflowCohort;
|
|
24
|
-
has_shipping_intent: boolean;
|
|
25
|
-
has_automation_intent: boolean;
|
|
26
|
-
shipping_signal_count: number;
|
|
27
|
-
automation_signal_count: number;
|
|
28
|
-
primary_workflow_signal: WorkflowReason | 'none';
|
|
29
|
-
package_manager?: PackageManagerName;
|
|
30
|
-
framework_primary?: FrameworkPrimary;
|
|
31
|
-
has_next_dependency?: boolean;
|
|
32
|
-
has_turbo_dependency?: boolean;
|
|
33
|
-
};
|
|
34
|
-
export declare function collectWorkflowProfile(context: WorkflowContext): WorkflowProfile;
|
|
35
|
-
export {};
|