Download next.js/packages/next/src/telemetry/events/session-stopped.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/telemetry/events/session-stopped.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/telemetry/events/session-stopped.ts
-
curl -L -o session-stopped.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/telemetry/events/session-stopped.ts
1.13 kB
| const EVENT_VERSION = 'NEXT_CLI_SESSION_STOPPED' | |
| export type EventCliSessionStopped = { | |
| cliCommand: string | |
| nextVersion: string | |
| nodeVersion: string | |
| turboFlag?: boolean | null | |
| durationMilliseconds?: number | null | |
| pagesDir?: boolean | |
| appDir?: boolean | |
| isRspack: boolean | |
| } | |
| export function eventCliSessionStopped( | |
| event: Omit< | |
| EventCliSessionStopped, | |
| 'nextVersion' | 'nodeVersion' | 'isRspack' | |
| > | |
| ): { eventName: string; payload: EventCliSessionStopped }[] { | |
| // This should be an invariant, if it fails our build tooling is broken. | |
| if (typeof process.env.__NEXT_VERSION !== 'string') { | |
| return [] | |
| } | |
| const payload: EventCliSessionStopped = { | |
| nextVersion: process.env.__NEXT_VERSION, | |
| nodeVersion: process.version, | |
| cliCommand: event.cliCommand, | |
| durationMilliseconds: event.durationMilliseconds, | |
| ...(typeof event.turboFlag !== 'undefined' | |
| ? { | |
| turboFlag: !!event.turboFlag, | |
| } | |
| : {}), | |
| pagesDir: event.pagesDir, | |
| appDir: event.appDir, | |
| isRspack: process.env.NEXT_RSPACK !== undefined, | |
| } | |
| return [{ eventName: EVENT_VERSION, payload }] | |
| } | |