@astrojs/telemetry
Advanced tools
+1
-1
@@ -31,3 +31,3 @@ export type AstroTelemetryOptions = { | ||
| private get anonymousSessionId(); | ||
| private get anonymousProjectInfo(); | ||
| private getAnonymousProjectInfo; | ||
| private get isDisabled(); | ||
@@ -34,0 +34,0 @@ setEnabled(value: boolean): void; |
+4
-3
@@ -61,4 +61,4 @@ import { randomBytes } from "node:crypto"; | ||
| } | ||
| get anonymousProjectInfo() { | ||
| this._anonymousProjectInfo = this._anonymousProjectInfo || getProjectInfo(this.isCI); | ||
| async getAnonymousProjectInfo() { | ||
| this._anonymousProjectInfo = this._anonymousProjectInfo || await getProjectInfo(this.isCI); | ||
| return this._anonymousProjectInfo; | ||
@@ -112,4 +112,5 @@ } | ||
| }; | ||
| const anonymousProjectInfo = await this.getAnonymousProjectInfo(); | ||
| const context = { | ||
| ...this.anonymousProjectInfo, | ||
| ...anonymousProjectInfo, | ||
| anonymousId: this.anonymousId, | ||
@@ -116,0 +117,0 @@ anonymousSessionId: this.anonymousSessionId |
@@ -48,2 +48,2 @@ /** | ||
| } | ||
| export declare function getProjectInfo(isCI: boolean): ProjectInfo; | ||
| export declare function getProjectInfo(isCI: boolean): Promise<ProjectInfo>; |
| import { execSync } from "node:child_process"; | ||
| import { createHash } from "node:crypto"; | ||
| import detectPackageManager from "which-pm-runs"; | ||
| import { detect } from "package-manager-detector"; | ||
| function createAnonymousValue(payload) { | ||
@@ -44,5 +44,5 @@ if (payload === "") { | ||
| } | ||
| function getProjectInfo(isCI) { | ||
| async function getProjectInfo(isCI) { | ||
| const projectId = getProjectId(isCI); | ||
| const packageManager = detectPackageManager(); | ||
| const packageManager = await detect(); | ||
| return { | ||
@@ -49,0 +49,0 @@ ...projectId, |
| import os from "node:os"; | ||
| import { name as ciName, isCI } from "ci-info"; | ||
| import isDocker from "is-docker"; | ||
| import isWSL from "is-wsl"; | ||
| let meta; | ||
@@ -28,3 +27,3 @@ function getSystemInfo(versions) { | ||
| isTTY: process.stdout.isTTY, | ||
| isWSL, | ||
| isWSL: !!process.env.WSL_DISTRO_NAME, | ||
| isCI, | ||
@@ -31,0 +30,0 @@ ciName |
+3
-9
| { | ||
| "name": "@astrojs/telemetry", | ||
| "version": "3.3.2", | ||
| "version": "3.3.3", | ||
| "type": "module", | ||
| "types": "./dist/index.d.ts", | ||
| "author": "withastro", | ||
@@ -16,6 +15,3 @@ "license": "MIT", | ||
| "exports": { | ||
| ".": { | ||
| "types": "./dist/index.d.ts", | ||
| "default": "./dist/index.js" | ||
| }, | ||
| ".": "./dist/index.js", | ||
| "./package.json": "./package.json" | ||
@@ -30,8 +26,6 @@ }, | ||
| "is-docker": "^4.0.0", | ||
| "is-wsl": "^3.1.1", | ||
| "which-pm-runs": "^1.1.0" | ||
| "package-manager-detector": "^1.6.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^22.10.6", | ||
| "@types/which-pm-runs": "^1.0.2", | ||
| "astro-scripts": "0.0.14" | ||
@@ -38,0 +32,0 @@ }, |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
4
-20%2
-33.33%20500
-0.29%9
12.5%+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed