🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
61
node_modules/@astrojs/telemetry/LICENSE
generated
vendored
Normal file
61
node_modules/@astrojs/telemetry/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2021 Fred K. Schott
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
"""
|
||||
This license applies to parts of the `packages/create-astro` and `packages/astro` subdirectories originating from the https://github.com/sveltejs/kit repository:
|
||||
|
||||
Copyright (c) 2020 [these people](https://github.com/sveltejs/kit/graphs/contributors)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
"""
|
||||
|
||||
|
||||
"""
|
||||
This license applies to parts of the `packages/create-astro` and `packages/astro` subdirectories originating from the https://github.com/vitejs/vite repository:
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
"""
|
||||
9
node_modules/@astrojs/telemetry/README.md
generated
vendored
Normal file
9
node_modules/@astrojs/telemetry/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Astro Telemetry
|
||||
|
||||
This package is used to collect anonymous telemetry data within the Astro CLI. It is enabled by default. Telemetry data does not contain any personal identifying information and can be disabled via:
|
||||
|
||||
```shell
|
||||
astro telemetry disable
|
||||
```
|
||||
|
||||
See the [CLI documentation](https://docs.astro.build/en/reference/cli-reference/#astro-telemetry) for more options on configuration telemetry.
|
||||
8
node_modules/@astrojs/telemetry/dist/config-keys.js
generated
vendored
Normal file
8
node_modules/@astrojs/telemetry/dist/config-keys.js
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
const TELEMETRY_ENABLED = "telemetry.enabled";
|
||||
const TELEMETRY_NOTIFY_DATE = "telemetry.notifiedAt";
|
||||
const TELEMETRY_ID = `telemetry.anonymousId`;
|
||||
export {
|
||||
TELEMETRY_ENABLED,
|
||||
TELEMETRY_ID,
|
||||
TELEMETRY_NOTIFY_DATE
|
||||
};
|
||||
78
node_modules/@astrojs/telemetry/dist/config.js
generated
vendored
Normal file
78
node_modules/@astrojs/telemetry/dist/config.js
generated
vendored
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
import dget from "dlv";
|
||||
import { dset } from "dset";
|
||||
import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import process from "node:process";
|
||||
function getConfigDir(name) {
|
||||
const homedir = os.homedir();
|
||||
const macos = () => path.join(homedir, "Library", "Preferences", name);
|
||||
const win = () => {
|
||||
const { APPDATA = path.join(homedir, "AppData", "Roaming") } = process.env;
|
||||
return path.join(APPDATA, name, "Config");
|
||||
};
|
||||
const linux = () => {
|
||||
const { XDG_CONFIG_HOME = path.join(homedir, ".config") } = process.env;
|
||||
return path.join(XDG_CONFIG_HOME, name);
|
||||
};
|
||||
switch (process.platform) {
|
||||
case "darwin":
|
||||
return macos();
|
||||
case "win32":
|
||||
return win();
|
||||
default:
|
||||
return linux();
|
||||
}
|
||||
}
|
||||
class GlobalConfig {
|
||||
constructor(project) {
|
||||
this.project = project;
|
||||
this.dir = getConfigDir(this.project.name);
|
||||
this.file = path.join(this.dir, "config.json");
|
||||
}
|
||||
get store() {
|
||||
if (this._store)
|
||||
return this._store;
|
||||
this.ensureDir();
|
||||
if (fs.existsSync(this.file)) {
|
||||
this._store = JSON.parse(fs.readFileSync(this.file).toString());
|
||||
} else {
|
||||
const store = {};
|
||||
this._store = store;
|
||||
this.write();
|
||||
}
|
||||
return this._store;
|
||||
}
|
||||
set store(value) {
|
||||
this._store = value;
|
||||
this.write();
|
||||
}
|
||||
ensureDir() {
|
||||
fs.mkdirSync(this.dir, { recursive: true });
|
||||
}
|
||||
write() {
|
||||
fs.writeFileSync(this.file, JSON.stringify(this.store, null, " "));
|
||||
}
|
||||
clear() {
|
||||
this.store = {};
|
||||
fs.rmSync(this.file, { recursive: true });
|
||||
}
|
||||
delete(key) {
|
||||
dset(this.store, key, void 0);
|
||||
this.write();
|
||||
return true;
|
||||
}
|
||||
get(key) {
|
||||
return dget(this.store, key);
|
||||
}
|
||||
has(key) {
|
||||
return typeof this.get(key) !== "undefined";
|
||||
}
|
||||
set(key, value) {
|
||||
dset(this.store, key, value);
|
||||
this.write();
|
||||
}
|
||||
}
|
||||
export {
|
||||
GlobalConfig
|
||||
};
|
||||
117
node_modules/@astrojs/telemetry/dist/index.js
generated
vendored
Normal file
117
node_modules/@astrojs/telemetry/dist/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
import { isCI } from "ci-info";
|
||||
import debug from "debug";
|
||||
import { randomBytes } from "node:crypto";
|
||||
import * as KEY from "./config-keys.js";
|
||||
import { GlobalConfig } from "./config.js";
|
||||
import { post } from "./post.js";
|
||||
import { getProjectInfo } from "./project-info.js";
|
||||
import { getSystemInfo } from "./system-info.js";
|
||||
class AstroTelemetry {
|
||||
constructor(opts) {
|
||||
this.opts = opts;
|
||||
this.config = new GlobalConfig({ name: "astro" });
|
||||
this.debug = debug("astro:telemetry");
|
||||
}
|
||||
get astroVersion() {
|
||||
return this.opts.astroVersion;
|
||||
}
|
||||
get viteVersion() {
|
||||
return this.opts.viteVersion;
|
||||
}
|
||||
get ASTRO_TELEMETRY_DISABLED() {
|
||||
return process.env.ASTRO_TELEMETRY_DISABLED;
|
||||
}
|
||||
get TELEMETRY_DISABLED() {
|
||||
return process.env.TELEMETRY_DISABLED;
|
||||
}
|
||||
/**
|
||||
* Get value from either the global config or the provided fallback.
|
||||
* If value is not set, the fallback is saved to the global config,
|
||||
* persisted for later sessions.
|
||||
*/
|
||||
getConfigWithFallback(key, getValue) {
|
||||
const currentValue = this.config.get(key);
|
||||
if (currentValue) {
|
||||
return currentValue;
|
||||
}
|
||||
const newValue = getValue();
|
||||
this.config.set(key, newValue);
|
||||
return newValue;
|
||||
}
|
||||
get enabled() {
|
||||
return this.getConfigWithFallback(KEY.TELEMETRY_ENABLED, () => true);
|
||||
}
|
||||
get notifyDate() {
|
||||
return this.getConfigWithFallback(KEY.TELEMETRY_NOTIFY_DATE, () => "");
|
||||
}
|
||||
get anonymousId() {
|
||||
return this.getConfigWithFallback(KEY.TELEMETRY_ID, () => randomBytes(32).toString("hex"));
|
||||
}
|
||||
get anonymousSessionId() {
|
||||
this._anonymousSessionId = this._anonymousSessionId || randomBytes(32).toString("hex");
|
||||
return this._anonymousSessionId;
|
||||
}
|
||||
get anonymousProjectInfo() {
|
||||
this._anonymousProjectInfo = this._anonymousProjectInfo || getProjectInfo(isCI);
|
||||
return this._anonymousProjectInfo;
|
||||
}
|
||||
get isDisabled() {
|
||||
if (Boolean(this.ASTRO_TELEMETRY_DISABLED || this.TELEMETRY_DISABLED)) {
|
||||
return true;
|
||||
}
|
||||
return this.enabled === false;
|
||||
}
|
||||
setEnabled(value) {
|
||||
this.config.set(KEY.TELEMETRY_ENABLED, value);
|
||||
}
|
||||
clear() {
|
||||
return this.config.clear();
|
||||
}
|
||||
async notify(callback) {
|
||||
if (this.isDisabled || isCI) {
|
||||
return;
|
||||
}
|
||||
if (this.notifyDate) {
|
||||
return;
|
||||
}
|
||||
const enabled = await callback();
|
||||
this.config.set(KEY.TELEMETRY_NOTIFY_DATE, Date.now().toString());
|
||||
this.config.set(KEY.TELEMETRY_ENABLED, enabled);
|
||||
}
|
||||
async record(event = []) {
|
||||
const events = Array.isArray(event) ? event : [event];
|
||||
if (events.length < 1) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (this.isDisabled) {
|
||||
this.debug("telemetry disabled");
|
||||
return Promise.resolve();
|
||||
}
|
||||
const meta = {
|
||||
...getSystemInfo({ astroVersion: this.astroVersion, viteVersion: this.viteVersion })
|
||||
};
|
||||
const context = {
|
||||
...this.anonymousProjectInfo,
|
||||
anonymousId: this.anonymousId,
|
||||
anonymousSessionId: this.anonymousSessionId
|
||||
};
|
||||
if (meta.isCI) {
|
||||
context.anonymousId = `CI.${meta.ciName || "UNKNOWN"}`;
|
||||
}
|
||||
if (this.debug.enabled) {
|
||||
this.debug({ context, meta });
|
||||
this.debug(JSON.stringify(events, null, 2));
|
||||
return Promise.resolve();
|
||||
}
|
||||
return post({
|
||||
context,
|
||||
meta,
|
||||
events
|
||||
}).catch((err) => {
|
||||
this.debug(`Error sending event: ${err.message}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
export {
|
||||
AstroTelemetry
|
||||
};
|
||||
12
node_modules/@astrojs/telemetry/dist/post.js
generated
vendored
Normal file
12
node_modules/@astrojs/telemetry/dist/post.js
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { fetch } from "undici";
|
||||
const ASTRO_TELEMETRY_ENDPOINT = `https://telemetry.astro.build/api/v1/record`;
|
||||
function post(body) {
|
||||
return fetch(ASTRO_TELEMETRY_ENDPOINT, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(body),
|
||||
headers: { "content-type": "application/json" }
|
||||
});
|
||||
}
|
||||
export {
|
||||
post
|
||||
};
|
||||
55
node_modules/@astrojs/telemetry/dist/project-info.js
generated
vendored
Normal file
55
node_modules/@astrojs/telemetry/dist/project-info.js
generated
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
import { execSync } from "child_process";
|
||||
import { createHash } from "node:crypto";
|
||||
import detectPackageManager from "which-pm-runs";
|
||||
function createAnonymousValue(payload) {
|
||||
if (payload === "") {
|
||||
return payload;
|
||||
}
|
||||
const hash = createHash("sha256");
|
||||
hash.update(payload);
|
||||
return hash.digest("hex");
|
||||
}
|
||||
function getProjectIdFromGit() {
|
||||
try {
|
||||
const originBuffer = execSync(`git rev-list --max-parents=0 HEAD`, {
|
||||
timeout: 500,
|
||||
stdio: ["ignore", "pipe", "ignore"]
|
||||
});
|
||||
return String(originBuffer).trim();
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
function getProjectId(isCI) {
|
||||
const projectIdFromGit = getProjectIdFromGit();
|
||||
if (projectIdFromGit) {
|
||||
return {
|
||||
isGit: true,
|
||||
anonymousProjectId: createAnonymousValue(projectIdFromGit)
|
||||
};
|
||||
}
|
||||
const cwd = process.cwd();
|
||||
const isCwdGeneric = (cwd.match(/[\/|\\]/g) || []).length === 1;
|
||||
if (isCI || isCwdGeneric) {
|
||||
return {
|
||||
isGit: false,
|
||||
anonymousProjectId: void 0
|
||||
};
|
||||
}
|
||||
return {
|
||||
isGit: false,
|
||||
anonymousProjectId: createAnonymousValue(cwd)
|
||||
};
|
||||
}
|
||||
function getProjectInfo(isCI) {
|
||||
const projectId = getProjectId(isCI);
|
||||
const packageManager = detectPackageManager();
|
||||
return {
|
||||
...projectId,
|
||||
packageManager: packageManager == null ? void 0 : packageManager.name,
|
||||
packageManagerVersion: packageManager == null ? void 0 : packageManager.version
|
||||
};
|
||||
}
|
||||
export {
|
||||
getProjectInfo
|
||||
};
|
||||
35
node_modules/@astrojs/telemetry/dist/system-info.js
generated
vendored
Normal file
35
node_modules/@astrojs/telemetry/dist/system-info.js
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { isCI, name as ciName } from "ci-info";
|
||||
import isDocker from "is-docker";
|
||||
import isWSL from "is-wsl";
|
||||
import os from "node:os";
|
||||
let meta;
|
||||
function getSystemInfo(versions) {
|
||||
if (meta) {
|
||||
return meta;
|
||||
}
|
||||
const cpus = os.cpus() || [];
|
||||
meta = {
|
||||
// Version information
|
||||
nodeVersion: process.version.replace(/^v?/, ""),
|
||||
viteVersion: versions.viteVersion,
|
||||
astroVersion: versions.astroVersion,
|
||||
// Software information
|
||||
systemPlatform: os.platform(),
|
||||
systemRelease: os.release(),
|
||||
systemArchitecture: os.arch(),
|
||||
// Machine information
|
||||
cpuCount: cpus.length,
|
||||
cpuModel: cpus.length ? cpus[0].model : null,
|
||||
cpuSpeed: cpus.length ? cpus[0].speed : null,
|
||||
memoryInMb: Math.trunc(os.totalmem() / Math.pow(1024, 2)),
|
||||
// Environment information
|
||||
isDocker: isDocker(),
|
||||
isWSL,
|
||||
isCI,
|
||||
ciName
|
||||
};
|
||||
return meta;
|
||||
}
|
||||
export {
|
||||
getSystemInfo
|
||||
};
|
||||
6
node_modules/@astrojs/telemetry/dist/types/config-keys.d.ts
generated
vendored
Normal file
6
node_modules/@astrojs/telemetry/dist/types/config-keys.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
/** Specifies whether or not telemetry is enabled or disabled. */
|
||||
export declare const TELEMETRY_ENABLED = "telemetry.enabled";
|
||||
/** Specifies when the user was informed of anonymous telemetry. */
|
||||
export declare const TELEMETRY_NOTIFY_DATE = "telemetry.notifiedAt";
|
||||
/** Specifies an anonymous identifier used to dedupe events for a user. */
|
||||
export declare const TELEMETRY_ID = "telemetry.anonymousId";
|
||||
19
node_modules/@astrojs/telemetry/dist/types/config.d.ts
generated
vendored
Normal file
19
node_modules/@astrojs/telemetry/dist/types/config.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
export interface ConfigOptions {
|
||||
name: string;
|
||||
}
|
||||
export declare class GlobalConfig {
|
||||
private project;
|
||||
private dir;
|
||||
private file;
|
||||
constructor(project: ConfigOptions);
|
||||
private _store?;
|
||||
private get store();
|
||||
private set store(value);
|
||||
private ensureDir;
|
||||
write(): void;
|
||||
clear(): void;
|
||||
delete(key: string): boolean;
|
||||
get(key: string): any;
|
||||
has(key: string): boolean;
|
||||
set(key: string, value: any): void;
|
||||
}
|
||||
36
node_modules/@astrojs/telemetry/dist/types/index.d.ts
generated
vendored
Normal file
36
node_modules/@astrojs/telemetry/dist/types/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
export type AstroTelemetryOptions = {
|
||||
astroVersion: string;
|
||||
viteVersion: string;
|
||||
};
|
||||
export type TelemetryEvent = {
|
||||
eventName: string;
|
||||
payload: Record<string, any>;
|
||||
};
|
||||
export declare class AstroTelemetry {
|
||||
private opts;
|
||||
private _anonymousSessionId;
|
||||
private _anonymousProjectInfo;
|
||||
private config;
|
||||
private debug;
|
||||
private get astroVersion();
|
||||
private get viteVersion();
|
||||
private get ASTRO_TELEMETRY_DISABLED();
|
||||
private get TELEMETRY_DISABLED();
|
||||
constructor(opts: AstroTelemetryOptions);
|
||||
/**
|
||||
* Get value from either the global config or the provided fallback.
|
||||
* If value is not set, the fallback is saved to the global config,
|
||||
* persisted for later sessions.
|
||||
*/
|
||||
private getConfigWithFallback;
|
||||
private get enabled();
|
||||
private get notifyDate();
|
||||
private get anonymousId();
|
||||
private get anonymousSessionId();
|
||||
private get anonymousProjectInfo();
|
||||
private get isDisabled();
|
||||
setEnabled(value: boolean): void;
|
||||
clear(): void;
|
||||
notify(callback: () => Promise<boolean>): Promise<void>;
|
||||
record(event?: TelemetryEvent | TelemetryEvent[]): Promise<any>;
|
||||
}
|
||||
1
node_modules/@astrojs/telemetry/dist/types/post.d.ts
generated
vendored
Normal file
1
node_modules/@astrojs/telemetry/dist/types/post.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export declare function post(body: Record<string, any>): Promise<any>;
|
||||
48
node_modules/@astrojs/telemetry/dist/types/project-info.d.ts
generated
vendored
Normal file
48
node_modules/@astrojs/telemetry/dist/types/project-info.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/**
|
||||
* Astro Telemetry -- Project Info
|
||||
*
|
||||
* To better understand our telemetry insights, Astro attempts to create an anonymous identifier
|
||||
* for each Astro project. This value is meant to be unique to each project but common across
|
||||
* multiple different users on the same project.
|
||||
*
|
||||
* To do this, we generate a unique, anonymous hash from your working git repository data. This is
|
||||
* ideal because git data is shared across all users on the same repository, but the data itself
|
||||
* that we generate our hash from does not contain any personal or otherwise identifying information.
|
||||
*
|
||||
* We do not use your repository's remote URL, GitHub URL, or any other personally identifying
|
||||
* information to generate the project identifier hash. In this way it is almost completely anonymous.
|
||||
*
|
||||
* If you are running Astro outside of a git repository, then we will generate a unique, anonymous project
|
||||
* identifier by hashing your project's file path on your machine.
|
||||
*
|
||||
* ~~~
|
||||
*
|
||||
* Q: Can this project identifier be traced back to me?
|
||||
*
|
||||
* A: If your repository is private, there is no way for anyone to trace your unique
|
||||
* project identifier back to you, your organization, or your project. This is because it is itself
|
||||
* a hash of a commit hash, and a commit hash does not include any identifying information.
|
||||
*
|
||||
* If your repository is publicly available, then it is possible for someone to generate this unique
|
||||
* project identifier themselves by cloning your repo. Specifically, someone would need access to run
|
||||
* the `git rev-list` command below to generate this hash. Without this access, it is impossible to
|
||||
* trace the project identifier back to you or your project.
|
||||
*
|
||||
* If you are running Astro outside of a git repository, then the project identifier could be matched
|
||||
* back to the exact file path on your machine. It is unlikely (but still possible) for this to happen
|
||||
* without access to your machine or knowledge of your machine's file system.
|
||||
*
|
||||
* ~~~
|
||||
*
|
||||
* Q: I don't want Astro to collect a project identifier. How can I disable it?
|
||||
*
|
||||
* A: You can disable telemetry completely at any time by running `astro telemetry disable`. There is
|
||||
* currently no way to disable just this identifier while keeping the rest of telemetry enabled.
|
||||
*/
|
||||
export interface ProjectInfo {
|
||||
anonymousProjectId: string | undefined;
|
||||
isGit: boolean;
|
||||
packageManager: string | undefined;
|
||||
packageManagerVersion: string | undefined;
|
||||
}
|
||||
export declare function getProjectInfo(isCI: boolean): ProjectInfo;
|
||||
44
node_modules/@astrojs/telemetry/dist/types/system-info.d.ts
generated
vendored
Normal file
44
node_modules/@astrojs/telemetry/dist/types/system-info.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/// <reference types="node" />
|
||||
/**
|
||||
* Astro Telemetry -- System Info
|
||||
*
|
||||
* To better understand our telemetry insights, Astro collects the following anonymous information
|
||||
* about the system that it runs on. This helps us prioritize fixes and new features based on a
|
||||
* better understanding of our real-world system requirements.
|
||||
*
|
||||
* ~~~
|
||||
*
|
||||
* Q: Can this system info be traced back to me?
|
||||
*
|
||||
* A: No personally identifiable information is contained in the system info that we collect. It could
|
||||
* be possible for someone with direct access to your machine to collect this information themselves
|
||||
* and then attempt to match it all together with our collected telemetry data, however most users'
|
||||
* systems are probably not uniquely identifiable via their system info alone.
|
||||
*
|
||||
* ~~~
|
||||
*
|
||||
* Q: I don't want Astro to collect system info. How can I disable it?
|
||||
*
|
||||
* A: You can disable telemetry completely at any time by running `astro telemetry disable`. There is
|
||||
* currently no way to disable this otherwise while keeping the rest of telemetry enabled.
|
||||
*/
|
||||
export type SystemInfo = {
|
||||
systemPlatform: NodeJS.Platform;
|
||||
systemRelease: string;
|
||||
systemArchitecture: string;
|
||||
astroVersion: string;
|
||||
nodeVersion: string;
|
||||
viteVersion: string;
|
||||
cpuCount: number;
|
||||
cpuModel: string | null;
|
||||
cpuSpeed: number | null;
|
||||
memoryInMb: number;
|
||||
isDocker: boolean;
|
||||
isWSL: boolean;
|
||||
isCI: boolean;
|
||||
ciName: string | null;
|
||||
};
|
||||
export declare function getSystemInfo(versions: {
|
||||
viteVersion: string;
|
||||
astroVersion: string;
|
||||
}): SystemInfo;
|
||||
1
node_modules/@astrojs/telemetry/node_modules/.bin/is-docker
generated
vendored
Symbolic link
1
node_modules/@astrojs/telemetry/node_modules/.bin/is-docker
generated
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../../is-docker/cli.js
|
||||
50
node_modules/@astrojs/telemetry/package.json
generated
vendored
Normal file
50
node_modules/@astrojs/telemetry/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"name": "@astrojs/telemetry",
|
||||
"version": "2.1.1",
|
||||
"type": "module",
|
||||
"types": "./dist/types/index.d.ts",
|
||||
"author": "withastro",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/withastro/astro.git",
|
||||
"directory": "packages/telemetry"
|
||||
},
|
||||
"bugs": "https://github.com/withastro/astro/issues",
|
||||
"homepage": "https://astro.build",
|
||||
"exports": {
|
||||
".": "./dist/index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"ci-info": "^3.3.1",
|
||||
"debug": "^4.3.4",
|
||||
"dlv": "^1.1.3",
|
||||
"dset": "^3.1.2",
|
||||
"is-docker": "^3.0.0",
|
||||
"is-wsl": "^2.2.0",
|
||||
"undici": "^5.22.0",
|
||||
"which-pm-runs": "^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/debug": "^4.1.7",
|
||||
"@types/dlv": "^1.1.2",
|
||||
"@types/node": "^14.18.21",
|
||||
"@types/which-pm-runs": "^1.0.0",
|
||||
"chai": "^4.3.6",
|
||||
"mocha": "^9.2.2",
|
||||
"astro-scripts": "0.0.14"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.12.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
|
||||
"build:ci": "astro-scripts build \"src/**/*.ts\"",
|
||||
"dev": "astro-scripts dev \"src/**/*.ts\"",
|
||||
"test": "mocha --exit --timeout 20000 test/"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue