Initial boiler plate project

This commit is contained in:
2024-09-24 03:52:46 +00:00
parent 6120b2d6c3
commit 154b93e267
10034 changed files with 2079352 additions and 2 deletions

18
node_modules/next/dist/telemetry/anonymous-meta.d.ts generated vendored Normal file
View File

@ -0,0 +1,18 @@
/// <reference types="node" />
type AnonymousMeta = {
systemPlatform: NodeJS.Platform;
systemRelease: string;
systemArchitecture: string;
cpuCount: number;
cpuModel: string | null;
cpuSpeed: number | null;
memoryInMb: number;
isDocker: boolean;
isNowDev: boolean;
isWsl: boolean;
isCI: boolean;
ciName: string | null;
nextVersion: string;
};
export declare function getAnonymousMeta(): AnonymousMeta;
export {};

89
node_modules/next/dist/telemetry/anonymous-meta.js generated vendored Normal file
View File

@ -0,0 +1,89 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getAnonymousMeta", {
enumerable: true,
get: function() {
return getAnonymousMeta;
}
});
const _isdocker = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/is-docker"));
const _iswsl = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/is-wsl"));
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
const _ciinfo = /*#__PURE__*/ _interop_require_wildcard(require("./ci-info"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function") return null;
var cacheBabelInterop = new WeakMap();
var cacheNodeInterop = new WeakMap();
return (_getRequireWildcardCache = function(nodeInterop) {
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interop_require_wildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;
}
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
return {
default: obj
};
}
var cache = _getRequireWildcardCache(nodeInterop);
if (cache && cache.has(obj)) {
return cache.get(obj);
}
var newObj = {
__proto__: null
};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for(var key in obj){
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
newObj.default = obj;
if (cache) {
cache.set(obj, newObj);
}
return newObj;
}
let traits;
function getAnonymousMeta() {
if (traits) {
return traits;
}
const cpus = _os.default.cpus() || [];
const { NOW_REGION } = process.env;
traits = {
// Software information
systemPlatform: _os.default.platform(),
systemRelease: _os.default.release(),
systemArchitecture: _os.default.arch(),
// Machine information
cpuCount: cpus.length,
cpuModel: cpus.length ? cpus[0].model : null,
cpuSpeed: cpus.length ? cpus[0].speed : null,
memoryInMb: Math.trunc(_os.default.totalmem() / Math.pow(1024, 2)),
// Environment information
isDocker: (0, _isdocker.default)(),
isNowDev: NOW_REGION === "dev1",
isWsl: _iswsl.default,
isCI: _ciinfo.isCI,
ciName: _ciinfo.isCI && _ciinfo.name || null,
nextVersion: "14.2.13"
};
return traits;
}
//# sourceMappingURL=anonymous-meta.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/telemetry/anonymous-meta.ts"],"names":["getAnonymousMeta","traits","cpus","os","NOW_REGION","process","env","systemPlatform","platform","systemRelease","release","systemArchitecture","arch","cpuCount","length","cpuModel","model","cpuSpeed","speed","memoryInMb","Math","trunc","totalmem","pow","isDocker","isDockerFunction","isNowDev","isWsl","isWslBoolean","isCI","ciEnvironment","ciName","name","nextVersion","__NEXT_VERSION"],"mappings":";;;;+BAwBgBA;;;eAAAA;;;iEAxBa;8DACJ;2DACV;gEAEgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkB/B,IAAIC;AAEG,SAASD;IACd,IAAIC,QAAQ;QACV,OAAOA;IACT;IAEA,MAAMC,OAAOC,WAAE,CAACD,IAAI,MAAM,EAAE;IAC5B,MAAM,EAAEE,UAAU,EAAE,GAAGC,QAAQC,GAAG;IAClCL,SAAS;QACP,uBAAuB;QACvBM,gBAAgBJ,WAAE,CAACK,QAAQ;QAC3BC,eAAeN,WAAE,CAACO,OAAO;QACzBC,oBAAoBR,WAAE,CAACS,IAAI;QAC3B,sBAAsB;QACtBC,UAAUX,KAAKY,MAAM;QACrBC,UAAUb,KAAKY,MAAM,GAAGZ,IAAI,CAAC,EAAE,CAACc,KAAK,GAAG;QACxCC,UAAUf,KAAKY,MAAM,GAAGZ,IAAI,CAAC,EAAE,CAACgB,KAAK,GAAG;QACxCC,YAAYC,KAAKC,KAAK,CAAClB,WAAE,CAACmB,QAAQ,KAAKF,KAAKG,GAAG,CAAC,MAAM;QACtD,0BAA0B;QAC1BC,UAAUC,IAAAA,iBAAgB;QAC1BC,UAAUtB,eAAe;QACzBuB,OAAOC,cAAY;QACnBC,MAAMC,QAAcD,IAAI;QACxBE,QAAQ,AAACD,QAAcD,IAAI,IAAIC,QAAcE,IAAI,IAAK;QACtDC,aAAa5B,QAAQC,GAAG,CAAC4B,cAAc;IACzC;IAEA,OAAOjC;AACT"}

3
node_modules/next/dist/telemetry/ci-info.d.ts generated vendored Normal file
View File

@ -0,0 +1,3 @@
export declare const isCI: boolean;
export declare const name: string | null;
export declare const hasNextSupport: boolean;

41
node_modules/next/dist/telemetry/ci-info.js generated vendored Normal file
View File

@ -0,0 +1,41 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
hasNextSupport: null,
isCI: null,
name: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
hasNextSupport: function() {
return hasNextSupport;
},
isCI: function() {
return isCI;
},
name: function() {
return name;
}
});
const _ciinfo = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/ci-info"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const { isCI: _isCI, name: _name } = _ciinfo.default;
const isZeitNow = !!process.env.NOW_BUILDER;
const envStack = process.env.STACK;
const isHeroku = typeof envStack === "string" && envStack.toLowerCase().includes("heroku");
const isCI = isZeitNow || isHeroku || _isCI;
const name = isZeitNow ? "ZEIT Now" : isHeroku ? "Heroku" : _name;
const hasNextSupport = Boolean(isZeitNow);
//# sourceMappingURL=ci-info.js.map

1
node_modules/next/dist/telemetry/ci-info.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/telemetry/ci-info.ts"],"names":["hasNextSupport","isCI","name","_isCI","_name","ciEnvironment","isZeitNow","process","env","NOW_BUILDER","envStack","STACK","isHeroku","toLowerCase","includes","Boolean"],"mappings":";;;;;;;;;;;;;;;;IAgBaA,cAAc;eAAdA;;IANAC,IAAI;eAAJA;;IACAC,IAAI;eAAJA;;;+DAXa;;;;;;AAE1B,MAAM,EAAED,MAAME,KAAK,EAAED,MAAME,KAAK,EAAE,GAAGC,eAAa;AAElD,MAAMC,YAAY,CAAC,CAACC,QAAQC,GAAG,CAACC,WAAW;AAE3C,MAAMC,WAAWH,QAAQC,GAAG,CAACG,KAAK;AAClC,MAAMC,WACJ,OAAOF,aAAa,YAAYA,SAASG,WAAW,GAAGC,QAAQ,CAAC;AAE3D,MAAMb,OAAOK,aAAaM,YAAYT;AACtC,MAAMD,OAAOI,YAAY,aAAaM,WAAW,WAAWR;AAK5D,MAAMJ,iBAAiBe,QAAQT"}

1
node_modules/next/dist/telemetry/detached-flush.d.ts generated vendored Normal file
View File

@ -0,0 +1 @@
export {};

49
node_modules/next/dist/telemetry/detached-flush.js generated vendored Normal file
View File

@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
const _storage = require("./storage");
const _config = /*#__PURE__*/ _interop_require_default(require("../server/config"));
const _getprojectdir = require("../lib/get-project-dir");
const _constants = require("../shared/lib/constants");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
(async ()=>{
const args = [
...process.argv
];
let dir = args.pop();
const mode = args.pop();
if (!dir || mode !== "dev") {
throw new Error(`Invalid flags should be run as node detached-flush dev ./path-to/project`);
}
dir = (0, _getprojectdir.getProjectDir)(dir);
const config = await (0, _config.default)(_constants.PHASE_DEVELOPMENT_SERVER, dir);
const distDir = _path.default.join(dir, config.distDir || ".next");
const eventsPath = _path.default.join(distDir, "_events.json");
let events;
try {
events = JSON.parse(_fs.default.readFileSync(eventsPath, "utf8"));
} catch (err) {
if (err.code === "ENOENT") {
// no events to process we can exit now
process.exit(0);
}
throw err;
}
const telemetry = new _storage.Telemetry({
distDir
});
await telemetry.record(events);
await telemetry.flush();
// finished flushing events clean-up/exit
_fs.default.unlinkSync(eventsPath);
process.exit(0);
})();
//# sourceMappingURL=detached-flush.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/telemetry/detached-flush.ts"],"names":["args","process","argv","dir","pop","mode","Error","getProjectDir","config","loadConfig","PHASE_DEVELOPMENT_SERVER","distDir","path","join","eventsPath","events","JSON","parse","fs","readFileSync","err","code","exit","telemetry","Telemetry","record","flush","unlinkSync"],"mappings":";;;;2DAAe;6DACE;yBAES;+DACH;+BACO;2BACW;;;;;;AAKvC,CAAA;IACA,MAAMA,OAAO;WAAIC,QAAQC,IAAI;KAAC;IAC9B,IAAIC,MAAMH,KAAKI,GAAG;IAClB,MAAMC,OAAOL,KAAKI,GAAG;IAErB,IAAI,CAACD,OAAOE,SAAS,OAAO;QAC1B,MAAM,IAAIC,MACR,CAAC,wEAAwE,CAAC;IAE9E;IACAH,MAAMI,IAAAA,4BAAa,EAACJ;IAEpB,MAAMK,SAAS,MAAMC,IAAAA,eAAU,EAACC,mCAAwB,EAAEP;IAC1D,MAAMQ,UAAUC,aAAI,CAACC,IAAI,CAACV,KAAKK,OAAOG,OAAO,IAAI;IACjD,MAAMG,aAAaF,aAAI,CAACC,IAAI,CAACF,SAAS;IAEtC,IAAII;IACJ,IAAI;QACFA,SAASC,KAAKC,KAAK,CAACC,WAAE,CAACC,YAAY,CAACL,YAAY;IAClD,EAAE,OAAOM,KAAU;QACjB,IAAIA,IAAIC,IAAI,KAAK,UAAU;YACzB,uCAAuC;YACvCpB,QAAQqB,IAAI,CAAC;QACf;QACA,MAAMF;IACR;IAEA,MAAMG,YAAY,IAAIC,kBAAS,CAAC;QAAEb;IAAQ;IAC1C,MAAMY,UAAUE,MAAM,CAACV;IACvB,MAAMQ,UAAUG,KAAK;IAErB,yCAAyC;IACzCR,WAAE,CAACS,UAAU,CAACb;IACdb,QAAQqB,IAAI,CAAC;AACf,CAAA"}

87
node_modules/next/dist/telemetry/events/build.d.ts generated vendored Normal file
View File

@ -0,0 +1,87 @@
import type { TelemetryPlugin } from '../../build/webpack/plugins/telemetry-plugin';
import type { SWC_TARGET_TRIPLE } from '../../build/webpack/plugins/telemetry-plugin';
type EventTypeCheckCompleted = {
durationInSeconds: number;
typescriptVersion: string | null;
inputFilesCount?: number;
totalFilesCount?: number;
incremental?: boolean;
};
export declare function eventTypeCheckCompleted(event: EventTypeCheckCompleted): {
eventName: string;
payload: EventTypeCheckCompleted;
};
export type EventLintCheckCompleted = {
durationInSeconds: number;
eslintVersion: string | null;
lintedFilesCount?: number;
lintFix?: boolean;
buildLint?: boolean;
nextEslintPluginVersion?: string | null;
nextEslintPluginErrorsCount?: number;
nextEslintPluginWarningsCount?: number;
nextRulesEnabled: {
[ruleName: `@next/next/${string}`]: 'off' | 'warn' | 'error';
};
};
export declare function eventLintCheckCompleted(event: EventLintCheckCompleted): {
eventName: string;
payload: EventLintCheckCompleted;
};
type EventBuildCompleted = {
durationInSeconds: number;
totalPageCount: number;
hasDunderPages: boolean;
hasTestPages: boolean;
totalAppPagesCount?: number;
};
export declare function eventBuildCompleted(pagePaths: string[], event: Omit<EventBuildCompleted, 'totalPageCount' | 'hasDunderPages' | 'hasTestPages'>): {
eventName: string;
payload: EventBuildCompleted;
};
type EventBuildOptimized = {
durationInSeconds: number;
totalPageCount: number;
staticPageCount: number;
staticPropsPageCount: number;
serverPropsPageCount: number;
ssrPageCount: number;
hasDunderPages: boolean;
hasTestPages: boolean;
hasStatic404: boolean;
hasReportWebVitals: boolean;
headersCount: number;
rewritesCount: number;
redirectsCount: number;
headersWithHasCount: number;
rewritesWithHasCount: number;
redirectsWithHasCount: number;
middlewareCount: number;
totalAppPagesCount?: number;
staticAppPagesCount?: number;
serverAppPagesCount?: number;
edgeRuntimeAppCount?: number;
edgeRuntimePagesCount?: number;
};
export declare function eventBuildOptimize(pagePaths: string[], event: Omit<EventBuildOptimized, 'totalPageCount' | 'hasDunderPages' | 'hasTestPages'>): {
eventName: string;
payload: EventBuildOptimized;
};
export declare const EVENT_BUILD_FEATURE_USAGE = "NEXT_BUILD_FEATURE_USAGE";
export type EventBuildFeatureUsage = {
featureName: 'next/image' | 'next/legacy/image' | 'next/future/image' | 'next/script' | 'next/dynamic' | '@next/font/google' | '@next/font/local' | 'next/font/google' | 'next/font/local' | 'experimental/nextScriptWorkers' | 'experimental/optimizeCss' | 'experimental/ppr' | 'optimizeFonts' | 'swcLoader' | 'swcMinify' | 'swcRelay' | 'swcStyledComponents' | 'swcReactRemoveProperties' | 'swcExperimentalDecorators' | 'swcRemoveConsole' | 'swcImportSource' | 'swcEmotion' | `swc/target/${SWC_TARGET_TRIPLE}` | 'turbotrace' | 'build-lint' | 'vercelImageGeneration' | 'transpilePackages' | 'skipMiddlewareUrlNormalize' | 'skipTrailingSlashRedirect' | 'modularizeImports';
invocationCount: number;
};
export declare function eventBuildFeatureUsage(usages: ReturnType<TelemetryPlugin['usages']>): Array<{
eventName: string;
payload: EventBuildFeatureUsage;
}>;
export declare const EVENT_NAME_PACKAGE_USED_IN_GET_SERVER_SIDE_PROPS = "NEXT_PACKAGE_USED_IN_GET_SERVER_SIDE_PROPS";
export type EventPackageUsedInGetServerSideProps = {
package: string;
};
export declare function eventPackageUsedInGetServerSideProps(packagesUsedInServerSideProps: ReturnType<TelemetryPlugin['packagesUsedInServerSideProps']>): Array<{
eventName: string;
payload: EventPackageUsedInGetServerSideProps;
}>;
export {};

114
node_modules/next/dist/telemetry/events/build.js generated vendored Normal file
View File

@ -0,0 +1,114 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
EVENT_BUILD_FEATURE_USAGE: null,
EVENT_NAME_PACKAGE_USED_IN_GET_SERVER_SIDE_PROPS: null,
eventBuildCompleted: null,
eventBuildFeatureUsage: null,
eventBuildOptimize: null,
eventLintCheckCompleted: null,
eventPackageUsedInGetServerSideProps: null,
eventTypeCheckCompleted: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
EVENT_BUILD_FEATURE_USAGE: function() {
return EVENT_BUILD_FEATURE_USAGE;
},
EVENT_NAME_PACKAGE_USED_IN_GET_SERVER_SIDE_PROPS: function() {
return EVENT_NAME_PACKAGE_USED_IN_GET_SERVER_SIDE_PROPS;
},
eventBuildCompleted: function() {
return eventBuildCompleted;
},
eventBuildFeatureUsage: function() {
return eventBuildFeatureUsage;
},
eventBuildOptimize: function() {
return eventBuildOptimize;
},
eventLintCheckCompleted: function() {
return eventLintCheckCompleted;
},
eventPackageUsedInGetServerSideProps: function() {
return eventPackageUsedInGetServerSideProps;
},
eventTypeCheckCompleted: function() {
return eventTypeCheckCompleted;
}
});
const REGEXP_DIRECTORY_DUNDER = /[\\/]__[^\\/]+(?<![\\/]__(?:tests|mocks))__[\\/]/i;
const REGEXP_DIRECTORY_TESTS = /[\\/]__(tests|mocks)__[\\/]/i;
const REGEXP_FILE_TEST = /\.(?:spec|test)\.[^.]+$/i;
const EVENT_TYPE_CHECK_COMPLETED = "NEXT_TYPE_CHECK_COMPLETED";
function eventTypeCheckCompleted(event) {
return {
eventName: EVENT_TYPE_CHECK_COMPLETED,
payload: event
};
}
const EVENT_LINT_CHECK_COMPLETED = "NEXT_LINT_CHECK_COMPLETED";
function eventLintCheckCompleted(event) {
return {
eventName: EVENT_LINT_CHECK_COMPLETED,
payload: event
};
}
const EVENT_BUILD_COMPLETED = "NEXT_BUILD_COMPLETED";
function eventBuildCompleted(pagePaths, event) {
return {
eventName: EVENT_BUILD_COMPLETED,
payload: {
...event,
totalPageCount: pagePaths.length,
hasDunderPages: pagePaths.some((path)=>REGEXP_DIRECTORY_DUNDER.test(path)),
hasTestPages: pagePaths.some((path)=>REGEXP_DIRECTORY_TESTS.test(path) || REGEXP_FILE_TEST.test(path)),
totalAppPagesCount: event.totalAppPagesCount
}
};
}
const EVENT_BUILD_OPTIMIZED = "NEXT_BUILD_OPTIMIZED";
function eventBuildOptimize(pagePaths, event) {
return {
eventName: EVENT_BUILD_OPTIMIZED,
payload: {
...event,
totalPageCount: pagePaths.length,
hasDunderPages: pagePaths.some((path)=>REGEXP_DIRECTORY_DUNDER.test(path)),
hasTestPages: pagePaths.some((path)=>REGEXP_DIRECTORY_TESTS.test(path) || REGEXP_FILE_TEST.test(path)),
totalAppPagesCount: event.totalAppPagesCount,
staticAppPagesCount: event.staticAppPagesCount,
serverAppPagesCount: event.serverAppPagesCount,
edgeRuntimeAppCount: event.edgeRuntimeAppCount,
edgeRuntimePagesCount: event.edgeRuntimePagesCount
}
};
}
const EVENT_BUILD_FEATURE_USAGE = "NEXT_BUILD_FEATURE_USAGE";
function eventBuildFeatureUsage(usages) {
return usages.map(({ featureName, invocationCount })=>({
eventName: EVENT_BUILD_FEATURE_USAGE,
payload: {
featureName,
invocationCount
}
}));
}
const EVENT_NAME_PACKAGE_USED_IN_GET_SERVER_SIDE_PROPS = "NEXT_PACKAGE_USED_IN_GET_SERVER_SIDE_PROPS";
function eventPackageUsedInGetServerSideProps(packagesUsedInServerSideProps) {
return packagesUsedInServerSideProps.map((packageName)=>({
eventName: EVENT_NAME_PACKAGE_USED_IN_GET_SERVER_SIDE_PROPS,
payload: {
package: packageName
}
}));
}
//# sourceMappingURL=build.js.map

1
node_modules/next/dist/telemetry/events/build.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/telemetry/events/build.ts"],"names":["EVENT_BUILD_FEATURE_USAGE","EVENT_NAME_PACKAGE_USED_IN_GET_SERVER_SIDE_PROPS","eventBuildCompleted","eventBuildFeatureUsage","eventBuildOptimize","eventLintCheckCompleted","eventPackageUsedInGetServerSideProps","eventTypeCheckCompleted","REGEXP_DIRECTORY_DUNDER","REGEXP_DIRECTORY_TESTS","REGEXP_FILE_TEST","EVENT_TYPE_CHECK_COMPLETED","event","eventName","payload","EVENT_LINT_CHECK_COMPLETED","EVENT_BUILD_COMPLETED","pagePaths","totalPageCount","length","hasDunderPages","some","path","test","hasTestPages","totalAppPagesCount","EVENT_BUILD_OPTIMIZED","staticAppPagesCount","serverAppPagesCount","edgeRuntimeAppCount","edgeRuntimePagesCount","usages","map","featureName","invocationCount","packagesUsedInServerSideProps","packageName","package"],"mappings":";;;;;;;;;;;;;;;;;;;;;IA2IaA,yBAAyB;eAAzBA;;IAkDAC,gDAAgD;eAAhDA;;IAhIGC,mBAAmB;eAAnBA;;IAoHAC,sBAAsB;eAAtBA;;IAlEAC,kBAAkB;eAAlBA;;IArEAC,uBAAuB;eAAvBA;;IA0JAC,oCAAoC;eAApCA;;IAnLAC,uBAAuB;eAAvBA;;;AAdhB,MAAMC,0BACJ;AACF,MAAMC,yBAAyB;AAC/B,MAAMC,mBAAmB;AAEzB,MAAMC,6BAA6B;AAS5B,SAASJ,wBAAwBK,KAA8B;IAIpE,OAAO;QACLC,WAAWF;QACXG,SAASF;IACX;AACF;AAEA,MAAMG,6BAA6B;AAe5B,SAASV,wBAAwBO,KAA8B;IAIpE,OAAO;QACLC,WAAWE;QACXD,SAASF;IACX;AACF;AAEA,MAAMI,wBAAwB;AASvB,SAASd,oBACde,SAAmB,EACnBL,KAGC;IAED,OAAO;QACLC,WAAWG;QACXF,SAAS;YACP,GAAGF,KAAK;YACRM,gBAAgBD,UAAUE,MAAM;YAChCC,gBAAgBH,UAAUI,IAAI,CAAC,CAACC,OAC9Bd,wBAAwBe,IAAI,CAACD;YAE/BE,cAAcP,UAAUI,IAAI,CAC1B,CAACC,OACCb,uBAAuBc,IAAI,CAACD,SAASZ,iBAAiBa,IAAI,CAACD;YAE/DG,oBAAoBb,MAAMa,kBAAkB;QAC9C;IACF;AACF;AAEA,MAAMC,wBAAwB;AA0BvB,SAAStB,mBACda,SAAmB,EACnBL,KAGC;IAED,OAAO;QACLC,WAAWa;QACXZ,SAAS;YACP,GAAGF,KAAK;YACRM,gBAAgBD,UAAUE,MAAM;YAChCC,gBAAgBH,UAAUI,IAAI,CAAC,CAACC,OAC9Bd,wBAAwBe,IAAI,CAACD;YAE/BE,cAAcP,UAAUI,IAAI,CAC1B,CAACC,OACCb,uBAAuBc,IAAI,CAACD,SAASZ,iBAAiBa,IAAI,CAACD;YAE/DG,oBAAoBb,MAAMa,kBAAkB;YAC5CE,qBAAqBf,MAAMe,mBAAmB;YAC9CC,qBAAqBhB,MAAMgB,mBAAmB;YAC9CC,qBAAqBjB,MAAMiB,mBAAmB;YAC9CC,uBAAuBlB,MAAMkB,qBAAqB;QACpD;IACF;AACF;AAEO,MAAM9B,4BAA4B;AAsClC,SAASG,uBACd4B,MAA6C;IAE7C,OAAOA,OAAOC,GAAG,CAAC,CAAC,EAAEC,WAAW,EAAEC,eAAe,EAAE,GAAM,CAAA;YACvDrB,WAAWb;YACXc,SAAS;gBACPmB;gBACAC;YACF;QACF,CAAA;AACF;AAEO,MAAMjC,mDACX;AAMK,SAASK,qCACd6B,6BAEC;IAED,OAAOA,8BAA8BH,GAAG,CAAC,CAACI,cAAiB,CAAA;YACzDvB,WAAWZ;YACXa,SAAS;gBACPuB,SAASD;YACX;QACF,CAAA;AACF"}

3
node_modules/next/dist/telemetry/events/index.d.ts generated vendored Normal file
View File

@ -0,0 +1,3 @@
export * from './version';
export * from './build';
export * from './plugins';

23
node_modules/next/dist/telemetry/events/index.js generated vendored Normal file
View File

@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && __export(require("./version")) && __export(require("./build")) && __export(require("./plugins"));
_export_star(require("./version"), exports);
_export_star(require("./build"), exports);
_export_star(require("./plugins"), exports);
function _export_star(from, to) {
Object.keys(from).forEach(function(k) {
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
Object.defineProperty(to, k, {
enumerable: true,
get: function() {
return from[k];
}
});
}
});
return from;
}
//# sourceMappingURL=index.js.map

1
node_modules/next/dist/telemetry/events/index.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/telemetry/events/index.ts"],"names":[],"mappings":";;;;;qBAAc;qBACA;qBACA"}

9
node_modules/next/dist/telemetry/events/plugins.d.ts generated vendored Normal file
View File

@ -0,0 +1,9 @@
type NextPluginsEvent = {
eventName: string;
payload: {
packageName: string;
packageVersion: string;
};
};
export declare function eventNextPlugins(dir: string): Promise<Array<NextPluginsEvent>>;
export {};

51
node_modules/next/dist/telemetry/events/plugins.js generated vendored Normal file
View File

@ -0,0 +1,51 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "eventNextPlugins", {
enumerable: true,
get: function() {
return eventNextPlugins;
}
});
const _findup = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/find-up"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const EVENT_PLUGIN_PRESENT = "NEXT_PACKAGE_DETECTED";
async function eventNextPlugins(dir) {
try {
const packageJsonPath = await (0, _findup.default)("package.json", {
cwd: dir
});
if (!packageJsonPath) {
return [];
}
const { dependencies = {}, devDependencies = {} } = require(packageJsonPath);
const deps = {
...devDependencies,
...dependencies
};
return Object.keys(deps).reduce((events, plugin)=>{
const version = deps[plugin];
// Don't add deps without a version set
if (!version) {
return events;
}
events.push({
eventName: EVENT_PLUGIN_PRESENT,
payload: {
packageName: plugin,
packageVersion: version
}
});
return events;
}, []);
} catch (_) {
return [];
}
}
//# sourceMappingURL=plugins.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/telemetry/events/plugins.ts"],"names":["eventNextPlugins","EVENT_PLUGIN_PRESENT","dir","packageJsonPath","findUp","cwd","dependencies","devDependencies","require","deps","Object","keys","reduce","events","plugin","version","push","eventName","payload","packageName","packageVersion","_"],"mappings":";;;;+BAWsBA;;;eAAAA;;;+DAXH;;;;;;AAEnB,MAAMC,uBAAuB;AAStB,eAAeD,iBACpBE,GAAW;IAEX,IAAI;QACF,MAAMC,kBAAkB,MAAMC,IAAAA,eAAM,EAAC,gBAAgB;YAAEC,KAAKH;QAAI;QAChE,IAAI,CAACC,iBAAiB;YACpB,OAAO,EAAE;QACX;QAEA,MAAM,EAAEG,eAAe,CAAC,CAAC,EAAEC,kBAAkB,CAAC,CAAC,EAAE,GAAGC,QAAQL;QAE5D,MAAMM,OAAO;YAAE,GAAGF,eAAe;YAAE,GAAGD,YAAY;QAAC;QAEnD,OAAOI,OAAOC,IAAI,CAACF,MAAMG,MAAM,CAC7B,CAACC,QAA4BC;YAC3B,MAAMC,UAAUN,IAAI,CAACK,OAAO;YAC5B,uCAAuC;YACvC,IAAI,CAACC,SAAS;gBACZ,OAAOF;YACT;YAEAA,OAAOG,IAAI,CAAC;gBACVC,WAAWhB;gBACXiB,SAAS;oBACPC,aAAaL;oBACbM,gBAAgBL;gBAClB;YACF;YAEA,OAAOF;QACT,GACA,EAAE;IAEN,EAAE,OAAOQ,GAAG;QACV,OAAO,EAAE;IACX;AACF"}

View File

@ -0,0 +1,13 @@
export type EventCliSessionStopped = {
cliCommand: string;
nextVersion: string;
nodeVersion: string;
turboFlag?: boolean | null;
durationMilliseconds?: number | null;
pagesDir?: boolean;
appDir?: boolean;
};
export declare function eventCliSessionStopped(event: Omit<EventCliSessionStopped, 'nextVersion' | 'nodeVersion'>): {
eventName: string;
payload: EventCliSessionStopped;
}[];

View File

@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "eventCliSessionStopped", {
enumerable: true,
get: function() {
return eventCliSessionStopped;
}
});
const EVENT_VERSION = "NEXT_CLI_SESSION_STOPPED";
function eventCliSessionStopped(event) {
// This should be an invariant, if it fails our build tooling is broken.
if (typeof "14.2.13" !== "string") {
return [];
}
const payload = {
nextVersion: "14.2.13",
nodeVersion: process.version,
cliCommand: event.cliCommand,
durationMilliseconds: event.durationMilliseconds,
...typeof event.turboFlag !== "undefined" ? {
turboFlag: !!event.turboFlag
} : {},
pagesDir: event.pagesDir,
appDir: event.appDir
};
return [
{
eventName: EVENT_VERSION,
payload
}
];
}
//# sourceMappingURL=session-stopped.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/telemetry/events/session-stopped.ts"],"names":["eventCliSessionStopped","EVENT_VERSION","event","process","env","__NEXT_VERSION","payload","nextVersion","nodeVersion","version","cliCommand","durationMilliseconds","turboFlag","pagesDir","appDir","eventName"],"mappings":";;;;+BAYgBA;;;eAAAA;;;AAZhB,MAAMC,gBAAgB;AAYf,SAASD,uBACdE,KAAkE;IAElE,wEAAwE;IACxE,IAAI,OAAOC,QAAQC,GAAG,CAACC,cAAc,KAAK,UAAU;QAClD,OAAO,EAAE;IACX;IAEA,MAAMC,UAAkC;QACtCC,aAAaJ,QAAQC,GAAG,CAACC,cAAc;QACvCG,aAAaL,QAAQM,OAAO;QAC5BC,YAAYR,MAAMQ,UAAU;QAC5BC,sBAAsBT,MAAMS,oBAAoB;QAChD,GAAI,OAAOT,MAAMU,SAAS,KAAK,cAC3B;YACEA,WAAW,CAAC,CAACV,MAAMU,SAAS;QAC9B,IACA,CAAC,CAAC;QACNC,UAAUX,MAAMW,QAAQ;QACxBC,QAAQZ,MAAMY,MAAM;IACtB;IACA,OAAO;QAAC;YAAEC,WAAWd;YAAeK;QAAQ;KAAE;AAChD"}

View File

@ -0,0 +1,14 @@
export type EventSwcLoadFailure = {
eventName: string;
payload: {
platform: string;
arch: string;
nodeVersion: string;
nextVersion: string;
wasm?: 'enabled' | 'fallback' | 'failed';
glibcVersion?: string;
installedSwcPackages?: string;
nativeBindingsErrorCode?: string;
};
};
export declare function eventSwcLoadFailure(event?: EventSwcLoadFailure['payload']): Promise<void>;

View File

@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "eventSwcLoadFailure", {
enumerable: true,
get: function() {
return eventSwcLoadFailure;
}
});
const _shared = require("../../trace/shared");
const _packagejson = require("next/package.json");
const EVENT_PLUGIN_PRESENT = "NEXT_SWC_LOAD_FAILURE";
async function eventSwcLoadFailure(event) {
const telemetry = _shared.traceGlobals.get("telemetry");
// can't continue if telemetry isn't set
if (!telemetry) return;
let glibcVersion;
let installedSwcPackages;
try {
var _process_report;
// @ts-ignore
glibcVersion = (_process_report = process.report) == null ? void 0 : _process_report.getReport().header.glibcVersionRuntime;
} catch {}
try {
const pkgNames = Object.keys(_packagejson.optionalDependencies || {}).filter((pkg)=>pkg.startsWith("@next/swc"));
const installedPkgs = [];
for (const pkg of pkgNames){
try {
const { version } = require(`${pkg}/package.json`);
installedPkgs.push(`${pkg}@${version}`);
} catch {}
}
if (installedPkgs.length > 0) {
installedSwcPackages = installedPkgs.sort().join(",");
}
} catch {}
telemetry.record({
eventName: EVENT_PLUGIN_PRESENT,
payload: {
nextVersion: _packagejson.version,
glibcVersion,
installedSwcPackages,
arch: process.arch,
platform: process.platform,
nodeVersion: process.versions.node,
wasm: event == null ? void 0 : event.wasm,
nativeBindingsErrorCode: event == null ? void 0 : event.nativeBindingsErrorCode
}
});
// ensure this event is flushed before process exits
await telemetry.flush();
}
//# sourceMappingURL=swc-load-failure.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/telemetry/events/swc-load-failure.ts"],"names":["eventSwcLoadFailure","EVENT_PLUGIN_PRESENT","event","telemetry","traceGlobals","get","glibcVersion","installedSwcPackages","process","report","getReport","header","glibcVersionRuntime","pkgNames","Object","keys","optionalDependencies","filter","pkg","startsWith","installedPkgs","version","require","push","length","sort","join","record","eventName","payload","nextVersion","arch","platform","nodeVersion","versions","node","wasm","nativeBindingsErrorCode","flush"],"mappings":";;;;+BAoBsBA;;;eAAAA;;;wBApBO;6BAGgC;AAE7D,MAAMC,uBAAuB;AAetB,eAAeD,oBACpBE,KAAsC;IAEtC,MAAMC,YAAmCC,oBAAY,CAACC,GAAG,CAAC;IAC1D,wCAAwC;IACxC,IAAI,CAACF,WAAW;IAEhB,IAAIG;IACJ,IAAIC;IAEJ,IAAI;YAEaC;QADf,aAAa;QACbF,gBAAeE,kBAAAA,QAAQC,MAAM,qBAAdD,gBAAgBE,SAAS,GAAGC,MAAM,CAACC,mBAAmB;IACvE,EAAE,OAAM,CAAC;IAET,IAAI;QACF,MAAMC,WAAWC,OAAOC,IAAI,CAACC,iCAAoB,IAAI,CAAC,GAAGC,MAAM,CAAC,CAACC,MAC/DA,IAAIC,UAAU,CAAC;QAEjB,MAAMC,gBAAgB,EAAE;QAExB,KAAK,MAAMF,OAAOL,SAAU;YAC1B,IAAI;gBACF,MAAM,EAAEQ,OAAO,EAAE,GAAGC,QAAQ,CAAC,EAAEJ,IAAI,aAAa,CAAC;gBACjDE,cAAcG,IAAI,CAAC,CAAC,EAAEL,IAAI,CAAC,EAAEG,QAAQ,CAAC;YACxC,EAAE,OAAM,CAAC;QACX;QAEA,IAAID,cAAcI,MAAM,GAAG,GAAG;YAC5BjB,uBAAuBa,cAAcK,IAAI,GAAGC,IAAI,CAAC;QACnD;IACF,EAAE,OAAM,CAAC;IAETvB,UAAUwB,MAAM,CAAC;QACfC,WAAW3B;QACX4B,SAAS;YACPC,aAAAA,oBAAW;YACXxB;YACAC;YACAwB,MAAMvB,QAAQuB,IAAI;YAClBC,UAAUxB,QAAQwB,QAAQ;YAC1BC,aAAazB,QAAQ0B,QAAQ,CAACC,IAAI;YAClCC,IAAI,EAAElC,yBAAAA,MAAOkC,IAAI;YACjBC,uBAAuB,EAAEnC,yBAAAA,MAAOmC,uBAAuB;QACzD;IACF;IACA,oDAAoD;IACpD,MAAMlC,UAAUmC,KAAK;AACvB"}

View File

@ -0,0 +1,10 @@
import type { NextConfig } from '../../server/config-shared';
type SwcPluginsEvent = {
eventName: string;
payload: {
pluginName: string;
pluginVersion?: string;
};
};
export declare function eventSwcPlugins(dir: string, config: NextConfig): Promise<Array<SwcPluginsEvent>>;
export {};

55
node_modules/next/dist/telemetry/events/swc-plugins.js generated vendored Normal file
View File

@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "eventSwcPlugins", {
enumerable: true,
get: function() {
return eventSwcPlugins;
}
});
const _findup = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/find-up"));
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const EVENT_SWC_PLUGIN_PRESENT = "NEXT_SWC_PLUGIN_DETECTED";
async function eventSwcPlugins(dir, config) {
try {
var _config_experimental_swcPlugins, _config_experimental;
const packageJsonPath = await (0, _findup.default)("package.json", {
cwd: dir
});
if (!packageJsonPath) {
return [];
}
const { dependencies = {}, devDependencies = {} } = require(packageJsonPath);
const deps = {
...devDependencies,
...dependencies
};
const swcPluginPackages = ((_config_experimental = config.experimental) == null ? void 0 : (_config_experimental_swcPlugins = _config_experimental.swcPlugins) == null ? void 0 : _config_experimental_swcPlugins.map(([name, _])=>name)) ?? [];
return swcPluginPackages.map((plugin)=>{
// swc plugins can be non-npm pkgs with absolute path doesn't have version
const version = deps[plugin] ?? undefined;
let pluginName = plugin;
if (_fs.default.existsSync(pluginName)) {
pluginName = _path.default.basename(plugin, ".wasm");
}
return {
eventName: EVENT_SWC_PLUGIN_PRESENT,
payload: {
pluginName: pluginName,
pluginVersion: version
}
};
});
} catch (_) {
return [];
}
}
//# sourceMappingURL=swc-plugins.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/telemetry/events/swc-plugins.ts"],"names":["eventSwcPlugins","EVENT_SWC_PLUGIN_PRESENT","dir","config","packageJsonPath","findUp","cwd","dependencies","devDependencies","require","deps","swcPluginPackages","experimental","swcPlugins","map","name","_","plugin","version","undefined","pluginName","fs","existsSync","path","basename","eventName","payload","pluginVersion"],"mappings":";;;;+BAcsBA;;;eAAAA;;;+DAdH;6DACF;2DACF;;;;;;AAGf,MAAMC,2BAA2B;AAS1B,eAAeD,gBACpBE,GAAW,EACXC,MAAkB;IAElB,IAAI;YAUAA,iCAAAA;QATF,MAAMC,kBAAkB,MAAMC,IAAAA,eAAM,EAAC,gBAAgB;YAAEC,KAAKJ;QAAI;QAChE,IAAI,CAACE,iBAAiB;YACpB,OAAO,EAAE;QACX;QAEA,MAAM,EAAEG,eAAe,CAAC,CAAC,EAAEC,kBAAkB,CAAC,CAAC,EAAE,GAAGC,QAAQL;QAE5D,MAAMM,OAAO;YAAE,GAAGF,eAAe;YAAE,GAAGD,YAAY;QAAC;QACnD,MAAMI,oBACJR,EAAAA,uBAAAA,OAAOS,YAAY,sBAAnBT,kCAAAA,qBAAqBU,UAAU,qBAA/BV,gCAAiCW,GAAG,CAAC,CAAC,CAACC,MAAMC,EAAE,GAAKD,UAAS,EAAE;QAEjE,OAAOJ,kBAAkBG,GAAG,CAAC,CAACG;YAC5B,0EAA0E;YAC1E,MAAMC,UAAUR,IAAI,CAACO,OAAO,IAAIE;YAChC,IAAIC,aAAaH;YACjB,IAAII,WAAE,CAACC,UAAU,CAACF,aAAa;gBAC7BA,aAAaG,aAAI,CAACC,QAAQ,CAACP,QAAQ;YACrC;YAEA,OAAO;gBACLQ,WAAWxB;gBACXyB,SAAS;oBACPN,YAAYA;oBACZO,eAAeT;gBACjB;YACF;QACF;IACF,EAAE,OAAOF,GAAG;QACV,OAAO,EAAE;IACX;AACF"}

39
node_modules/next/dist/telemetry/events/version.d.ts generated vendored Normal file
View File

@ -0,0 +1,39 @@
import type { NextConfigComplete } from '../../server/config-shared';
type EventCliSessionStarted = {
nextVersion: string;
nodeVersion: string;
cliCommand: string;
isSrcDir: boolean | null;
hasNowJson: boolean;
isCustomServer: boolean | null;
hasNextConfig: boolean;
buildTarget: string;
hasWebpackConfig: boolean;
hasBabelConfig: boolean;
basePathEnabled: boolean;
i18nEnabled: boolean;
imageEnabled: boolean;
imageFutureEnabled: boolean;
locales: string | null;
localeDomainsCount: number | null;
localeDetectionEnabled: boolean | null;
imageDomainsCount: number | null;
imageRemotePatternsCount: number | null;
imageSizes: string | null;
imageLoader: string | null;
imageFormats: string | null;
nextConfigOutput: string | null;
trailingSlashEnabled: boolean;
reactStrictMode: boolean;
webpackVersion: number | null;
turboFlag: boolean;
appDir: boolean | null;
pagesDir: boolean | null;
staticStaleTime: number | null;
dynamicStaleTime: number | null;
};
export declare function eventCliSession(dir: string, nextConfig: NextConfigComplete, event: Omit<EventCliSessionStarted, 'nextVersion' | 'nodeVersion' | 'hasNextConfig' | 'buildTarget' | 'hasWebpackConfig' | 'hasBabelConfig' | 'basePathEnabled' | 'i18nEnabled' | 'imageEnabled' | 'imageFutureEnabled' | 'locales' | 'localeDomainsCount' | 'localeDetectionEnabled' | 'imageDomainsCount' | 'imageRemotePatternsCount' | 'imageSizes' | 'imageLoader' | 'imageFormats' | 'nextConfigOutput' | 'trailingSlashEnabled' | 'reactStrictMode' | 'staticStaleTime' | 'dynamicStaleTime'>): {
eventName: string;
payload: EventCliSessionStarted;
}[];
export {};

84
node_modules/next/dist/telemetry/events/version.js generated vendored Normal file
View File

@ -0,0 +1,84 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "eventCliSession", {
enumerable: true,
get: function() {
return eventCliSession;
}
});
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const EVENT_VERSION = "NEXT_CLI_SESSION_STARTED";
function hasBabelConfig(dir) {
try {
var _res_options_presets, _res_options, _res_options_plugins, _res_options1;
const noopFile = _path.default.join(dir, "noop.js");
const res = require("next/dist/compiled/babel/core").loadPartialConfig({
cwd: dir,
filename: noopFile,
sourceFileName: noopFile
});
const isForTooling = ((_res_options = res.options) == null ? void 0 : (_res_options_presets = _res_options.presets) == null ? void 0 : _res_options_presets.every((e)=>{
var _e_file;
return (e == null ? void 0 : (_e_file = e.file) == null ? void 0 : _e_file.request) === "next/babel";
})) && ((_res_options1 = res.options) == null ? void 0 : (_res_options_plugins = _res_options1.plugins) == null ? void 0 : _res_options_plugins.length) === 0;
return res.hasFilesystemConfig() && !isForTooling;
} catch {
return false;
}
}
function eventCliSession(dir, nextConfig, event) {
var _nextConfig_experimental_staleTimes, _nextConfig_experimental_staleTimes1;
// This should be an invariant, if it fails our build tooling is broken.
if (typeof "14.2.13" !== "string") {
return [];
}
const { images, i18n } = nextConfig || {};
const payload = {
nextVersion: "14.2.13",
nodeVersion: process.version,
cliCommand: event.cliCommand,
isSrcDir: event.isSrcDir,
hasNowJson: event.hasNowJson,
isCustomServer: event.isCustomServer,
hasNextConfig: nextConfig.configOrigin !== "default",
buildTarget: "default",
hasWebpackConfig: typeof (nextConfig == null ? void 0 : nextConfig.webpack) === "function",
hasBabelConfig: hasBabelConfig(dir),
imageEnabled: !!images,
imageFutureEnabled: !!images,
basePathEnabled: !!(nextConfig == null ? void 0 : nextConfig.basePath),
i18nEnabled: !!i18n,
locales: (i18n == null ? void 0 : i18n.locales) ? i18n.locales.join(",") : null,
localeDomainsCount: (i18n == null ? void 0 : i18n.domains) ? i18n.domains.length : null,
localeDetectionEnabled: !i18n ? null : i18n.localeDetection !== false,
imageDomainsCount: (images == null ? void 0 : images.domains) ? images.domains.length : null,
imageRemotePatternsCount: (images == null ? void 0 : images.remotePatterns) ? images.remotePatterns.length : null,
imageSizes: (images == null ? void 0 : images.imageSizes) ? images.imageSizes.join(",") : null,
imageLoader: images == null ? void 0 : images.loader,
imageFormats: (images == null ? void 0 : images.formats) ? images.formats.join(",") : null,
nextConfigOutput: (nextConfig == null ? void 0 : nextConfig.output) || null,
trailingSlashEnabled: !!(nextConfig == null ? void 0 : nextConfig.trailingSlash),
reactStrictMode: !!(nextConfig == null ? void 0 : nextConfig.reactStrictMode),
webpackVersion: event.webpackVersion || null,
turboFlag: event.turboFlag || false,
appDir: event.appDir,
pagesDir: event.pagesDir,
staticStaleTime: ((_nextConfig_experimental_staleTimes = nextConfig.experimental.staleTimes) == null ? void 0 : _nextConfig_experimental_staleTimes.static) ?? null,
dynamicStaleTime: ((_nextConfig_experimental_staleTimes1 = nextConfig.experimental.staleTimes) == null ? void 0 : _nextConfig_experimental_staleTimes1.dynamic) ?? null
};
return [
{
eventName: EVENT_VERSION,
payload
}
];
}
//# sourceMappingURL=version.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/telemetry/events/version.ts"],"names":["eventCliSession","EVENT_VERSION","hasBabelConfig","dir","res","noopFile","path","join","require","loadPartialConfig","cwd","filename","sourceFileName","isForTooling","options","presets","every","e","file","request","plugins","length","hasFilesystemConfig","nextConfig","event","process","env","__NEXT_VERSION","images","i18n","payload","nextVersion","nodeVersion","version","cliCommand","isSrcDir","hasNowJson","isCustomServer","hasNextConfig","configOrigin","buildTarget","hasWebpackConfig","webpack","imageEnabled","imageFutureEnabled","basePathEnabled","basePath","i18nEnabled","locales","localeDomainsCount","domains","localeDetectionEnabled","localeDetection","imageDomainsCount","imageRemotePatternsCount","remotePatterns","imageSizes","imageLoader","loader","imageFormats","formats","nextConfigOutput","output","trailingSlashEnabled","trailingSlash","reactStrictMode","webpackVersion","turboFlag","appDir","pagesDir","staticStaleTime","experimental","staleTimes","static","dynamicStaleTime","dynamic","eventName"],"mappings":";;;;+BAyDgBA;;;eAAAA;;;6DAxDC;;;;;;AAEjB,MAAMC,gBAAgB;AAoCtB,SAASC,eAAeC,GAAW;IACjC,IAAI;YAQAC,sBAAAA,cAEKA,sBAAAA;QATP,MAAMC,WAAWC,aAAI,CAACC,IAAI,CAACJ,KAAK;QAChC,MAAMC,MAAMI,QAAQ,iCAAiCC,iBAAiB,CAAC;YACrEC,KAAKP;YACLQ,UAAUN;YACVO,gBAAgBP;QAClB;QACA,MAAMQ,eACJT,EAAAA,eAAAA,IAAIU,OAAO,sBAAXV,uBAAAA,aAAaW,OAAO,qBAApBX,qBAAsBY,KAAK,CACzB,CAACC;gBAAWA;mBAAAA,CAAAA,sBAAAA,UAAAA,EAAGC,IAAI,qBAAPD,QAASE,OAAO,MAAK;eAC9Bf,EAAAA,gBAAAA,IAAIU,OAAO,sBAAXV,uBAAAA,cAAagB,OAAO,qBAApBhB,qBAAsBiB,MAAM,MAAK;QACxC,OAAOjB,IAAIkB,mBAAmB,MAAM,CAACT;IACvC,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEO,SAASb,gBACdG,GAAW,EACXoB,UAA8B,EAC9BC,KAyBC;QAyCkBD,qCACCA;IAxCpB,wEAAwE;IACxE,IAAI,OAAOE,QAAQC,GAAG,CAACC,cAAc,KAAK,UAAU;QAClD,OAAO,EAAE;IACX;IAEA,MAAM,EAAEC,MAAM,EAAEC,IAAI,EAAE,GAAGN,cAAc,CAAC;IAExC,MAAMO,UAAkC;QACtCC,aAAaN,QAAQC,GAAG,CAACC,cAAc;QACvCK,aAAaP,QAAQQ,OAAO;QAC5BC,YAAYV,MAAMU,UAAU;QAC5BC,UAAUX,MAAMW,QAAQ;QACxBC,YAAYZ,MAAMY,UAAU;QAC5BC,gBAAgBb,MAAMa,cAAc;QACpCC,eAAef,WAAWgB,YAAY,KAAK;QAC3CC,aAAa;QACbC,kBAAkB,QAAOlB,8BAAAA,WAAYmB,OAAO,MAAK;QACjDxC,gBAAgBA,eAAeC;QAC/BwC,cAAc,CAAC,CAACf;QAChBgB,oBAAoB,CAAC,CAAChB;QACtBiB,iBAAiB,CAAC,EAACtB,8BAAAA,WAAYuB,QAAQ;QACvCC,aAAa,CAAC,CAAClB;QACfmB,SAASnB,CAAAA,wBAAAA,KAAMmB,OAAO,IAAGnB,KAAKmB,OAAO,CAACzC,IAAI,CAAC,OAAO;QAClD0C,oBAAoBpB,CAAAA,wBAAAA,KAAMqB,OAAO,IAAGrB,KAAKqB,OAAO,CAAC7B,MAAM,GAAG;QAC1D8B,wBAAwB,CAACtB,OAAO,OAAOA,KAAKuB,eAAe,KAAK;QAChEC,mBAAmBzB,CAAAA,0BAAAA,OAAQsB,OAAO,IAAGtB,OAAOsB,OAAO,CAAC7B,MAAM,GAAG;QAC7DiC,0BAA0B1B,CAAAA,0BAAAA,OAAQ2B,cAAc,IAC5C3B,OAAO2B,cAAc,CAAClC,MAAM,GAC5B;QACJmC,YAAY5B,CAAAA,0BAAAA,OAAQ4B,UAAU,IAAG5B,OAAO4B,UAAU,CAACjD,IAAI,CAAC,OAAO;QAC/DkD,WAAW,EAAE7B,0BAAAA,OAAQ8B,MAAM;QAC3BC,cAAc/B,CAAAA,0BAAAA,OAAQgC,OAAO,IAAGhC,OAAOgC,OAAO,CAACrD,IAAI,CAAC,OAAO;QAC3DsD,kBAAkBtC,CAAAA,8BAAAA,WAAYuC,MAAM,KAAI;QACxCC,sBAAsB,CAAC,EAACxC,8BAAAA,WAAYyC,aAAa;QACjDC,iBAAiB,CAAC,EAAC1C,8BAAAA,WAAY0C,eAAe;QAC9CC,gBAAgB1C,MAAM0C,cAAc,IAAI;QACxCC,WAAW3C,MAAM2C,SAAS,IAAI;QAC9BC,QAAQ5C,MAAM4C,MAAM;QACpBC,UAAU7C,MAAM6C,QAAQ;QACxBC,iBAAiB/C,EAAAA,sCAAAA,WAAWgD,YAAY,CAACC,UAAU,qBAAlCjD,oCAAoCkD,MAAM,KAAI;QAC/DC,kBAAkBnD,EAAAA,uCAAAA,WAAWgD,YAAY,CAACC,UAAU,qBAAlCjD,qCAAoCoD,OAAO,KAAI;IACnE;IACA,OAAO;QAAC;YAAEC,WAAW3E;YAAe6B;QAAQ;KAAE;AAChD"}

1
node_modules/next/dist/telemetry/flush-and-exit.d.ts generated vendored Normal file
View File

@ -0,0 +1 @@
export declare function flushAndExit(code: number): Promise<void>;

20
node_modules/next/dist/telemetry/flush-and-exit.js generated vendored Normal file
View File

@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "flushAndExit", {
enumerable: true,
get: function() {
return flushAndExit;
}
});
const _shared = require("../trace/shared");
async function flushAndExit(code) {
let telemetry = _shared.traceGlobals.get("telemetry");
if (telemetry) {
await telemetry.flush();
}
process.exit(code);
}
//# sourceMappingURL=flush-and-exit.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/telemetry/flush-and-exit.ts"],"names":["flushAndExit","code","telemetry","traceGlobals","get","flush","process","exit"],"mappings":";;;;+BAEsBA;;;eAAAA;;;wBAFO;AAEtB,eAAeA,aAAaC,IAAY;IAC7C,IAAIC,YAAYC,oBAAY,CAACC,GAAG,CAAC;IAGjC,IAAIF,WAAW;QACb,MAAMA,UAAUG,KAAK;IACvB;IACAC,QAAQC,IAAI,CAACN;AACf"}

1
node_modules/next/dist/telemetry/post-payload.d.ts generated vendored Normal file
View File

@ -0,0 +1 @@
export declare function _postPayload(endpoint: string, body: object, signal?: any): any;

44
node_modules/next/dist/telemetry/post-payload.js generated vendored Normal file
View File

@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "_postPayload", {
enumerable: true,
get: function() {
return _postPayload;
}
});
const _asyncretry = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/async-retry"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _postPayload(endpoint, body, signal) {
if (!signal && "timeout" in AbortSignal) {
signal = AbortSignal.timeout(5000);
}
return (0, _asyncretry.default)(()=>fetch(endpoint, {
method: "POST",
body: JSON.stringify(body),
headers: {
"content-type": "application/json"
},
signal
}).then((res)=>{
if (!res.ok) {
const err = new Error(res.statusText);
err.response = res;
throw err;
}
}), {
minTimeout: 500,
retries: 1,
factor: 1
}).catch(()=>{
// We swallow errors when telemetry cannot be sent
})// Ensure promise is voided
.then(()=>{}, ()=>{});
}
//# sourceMappingURL=post-payload.js.map

1
node_modules/next/dist/telemetry/post-payload.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/telemetry/post-payload.ts"],"names":["_postPayload","endpoint","body","signal","AbortSignal","timeout","retry","fetch","method","JSON","stringify","headers","then","res","ok","err","Error","statusText","response","minTimeout","retries","factor","catch"],"mappings":";;;;+BAEgBA;;;eAAAA;;;mEAFE;;;;;;AAEX,SAASA,aAAaC,QAAgB,EAAEC,IAAY,EAAEC,MAAY;IACvE,IAAI,CAACA,UAAU,aAAaC,aAAa;QACvCD,SAASC,YAAYC,OAAO,CAAC;IAC/B;IACA,OACEC,IAAAA,mBAAK,EACH,IACEC,MAAMN,UAAU;YACdO,QAAQ;YACRN,MAAMO,KAAKC,SAAS,CAACR;YACrBS,SAAS;gBAAE,gBAAgB;YAAmB;YAC9CR;QACF,GAAGS,IAAI,CAAC,CAACC;YACP,IAAI,CAACA,IAAIC,EAAE,EAAE;gBACX,MAAMC,MAAM,IAAIC,MAAMH,IAAII,UAAU;gBAClCF,IAAYG,QAAQ,GAAGL;gBACzB,MAAME;YACR;QACF,IACF;QAAEI,YAAY;QAAKC,SAAS;QAAGC,QAAQ;IAAE,GAExCC,KAAK,CAAC;IACL,kDAAkD;IACpD,EACA,2BAA2B;KAC1BV,IAAI,CACH,KAAO,GACP,KAAO;AAGf"}

1
node_modules/next/dist/telemetry/project-id.d.ts generated vendored Normal file
View File

@ -0,0 +1 @@
export declare function getRawProjectId(): Promise<string>;

48
node_modules/next/dist/telemetry/project-id.js generated vendored Normal file
View File

@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getRawProjectId", {
enumerable: true,
get: function() {
return getRawProjectId;
}
});
const _child_process = require("child_process");
// Q: Why does Next.js need a project ID? Why is it looking at my git remote?
// A:
// Next.js' telemetry is and always will be completely anonymous. Because of
// this, we need a way to differentiate different projects to track feature
// usage accurately. For example, to prevent a feature from appearing to be
// constantly `used` and then `unused` when switching between local projects.
// To reiterate,
// we **never** can read your actual git remote. The value is hashed one-way
// with random salt data, making it impossible for us to reverse or try to
// guess the remote by re-computing hashes.
async function _getProjectIdByGit() {
try {
let resolve, reject;
const promise = new Promise((res, rej)=>{
resolve = res;
reject = rej;
});
(0, _child_process.exec)(`git config --local --get remote.origin.url`, {
timeout: 1000,
windowsHide: true
}, (error, stdout)=>{
if (error) {
reject(error);
return;
}
resolve(stdout);
});
return String(await promise).trim();
} catch (_) {
return null;
}
}
async function getRawProjectId() {
return await _getProjectIdByGit() || process.env.REPOSITORY_URL || process.cwd();
}
//# sourceMappingURL=project-id.js.map

1
node_modules/next/dist/telemetry/project-id.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/telemetry/project-id.ts"],"names":["getRawProjectId","_getProjectIdByGit","resolve","reject","promise","Promise","res","rej","exec","timeout","windowsHide","error","stdout","String","trim","_","process","env","REPOSITORY_URL","cwd"],"mappings":";;;;+BA0CsBA;;;eAAAA;;;+BA1CD;AAErB,6EAA6E;AAC7E,KAAK;AACL,4EAA4E;AAC5E,2EAA2E;AAC3E,2EAA2E;AAC3E,6EAA6E;AAC7E,gBAAgB;AAChB,4EAA4E;AAC5E,0EAA0E;AAC1E,2CAA2C;AAE3C,eAAeC;IACb,IAAI;QACF,IAAIC,SAA2CC;QAC/C,MAAMC,UAAU,IAAIC,QAAyB,CAACC,KAAKC;YACjDL,UAAUI;YACVH,SAASI;QACX;QAEAC,IAAAA,mBAAI,EACF,CAAC,0CAA0C,CAAC,EAC5C;YACEC,SAAS;YACTC,aAAa;QACf,GACA,CAACC,OAAqBC;YACpB,IAAID,OAAO;gBACTR,OAAOQ;gBACP;YACF;YACAT,QAAQU;QACV;QAGF,OAAOC,OAAO,MAAMT,SAASU,IAAI;IACnC,EAAE,OAAOC,GAAG;QACV,OAAO;IACT;AACF;AAEO,eAAef;IACpB,OACE,AAAC,MAAMC,wBAAyBe,QAAQC,GAAG,CAACC,cAAc,IAAIF,QAAQG,GAAG;AAE7E"}

36
node_modules/next/dist/telemetry/storage.d.ts generated vendored Normal file
View File

@ -0,0 +1,36 @@
import type { BinaryLike } from 'crypto';
export type TelemetryEvent = {
eventName: string;
payload: object;
};
type RecordObject = {
isFulfilled: boolean;
isRejected: boolean;
value?: any;
reason?: any;
};
export declare class Telemetry {
readonly sessionId: string;
private conf;
private distDir;
private loadProjectId;
private NEXT_TELEMETRY_DISABLED;
private NEXT_TELEMETRY_DEBUG;
private queue;
constructor({ distDir }: {
distDir: string;
});
private notify;
get anonymousId(): string;
get salt(): string;
private get isDisabled();
setEnabled: (_enabled: boolean) => string | null;
get isEnabled(): boolean;
oneWayHash: (payload: BinaryLike) => string;
private getProjectId;
record: (_events: TelemetryEvent | TelemetryEvent[], deferred?: boolean) => Promise<RecordObject>;
flush: () => Promise<RecordObject[] | null>;
flushDetached: (mode: 'dev', dir: string) => void;
private submitRecord;
}
export {};

290
node_modules/next/dist/telemetry/storage.js generated vendored Normal file
View File

@ -0,0 +1,290 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Telemetry", {
enumerable: true,
get: function() {
return Telemetry;
}
});
const _picocolors = require("../lib/picocolors");
const _conf = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/conf"));
const _crypto = require("crypto");
const _isdocker = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/is-docker"));
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
const _anonymousmeta = require("./anonymous-meta");
const _ciinfo = /*#__PURE__*/ _interop_require_wildcard(require("./ci-info"));
const _postpayload = require("./post-payload");
const _projectid = require("./project-id");
const _ponyfill = require("next/dist/compiled/@edge-runtime/ponyfill");
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function") return null;
var cacheBabelInterop = new WeakMap();
var cacheNodeInterop = new WeakMap();
return (_getRequireWildcardCache = function(nodeInterop) {
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interop_require_wildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;
}
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
return {
default: obj
};
}
var cache = _getRequireWildcardCache(nodeInterop);
if (cache && cache.has(obj)) {
return cache.get(obj);
}
var newObj = {
__proto__: null
};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for(var key in obj){
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
newObj.default = obj;
if (cache) {
cache.set(obj, newObj);
}
return newObj;
}
// This is the key that stores whether or not telemetry is enabled or disabled.
const TELEMETRY_KEY_ENABLED = "telemetry.enabled";
// This is the key that specifies when the user was informed about anonymous
// telemetry collection.
const TELEMETRY_KEY_NOTIFY_DATE = "telemetry.notifiedAt";
// This is a quasi-persistent identifier used to dedupe recurring events. It's
// generated from random data and completely anonymous.
const TELEMETRY_KEY_ID = `telemetry.anonymousId`;
// This is the cryptographic salt that is included within every hashed value.
// This salt value is never sent to us, ensuring privacy and the one-way nature
// of the hash (prevents dictionary lookups of pre-computed hashes).
// See the `oneWayHash` function.
const TELEMETRY_KEY_SALT = `telemetry.salt`;
function getStorageDirectory(distDir) {
const isLikelyEphemeral = _ciinfo.isCI || (0, _isdocker.default)();
if (isLikelyEphemeral) {
return _path.default.join(distDir, "cache");
}
return undefined;
}
class Telemetry {
constructor({ distDir }){
this.notify = ()=>{
if (this.isDisabled || !this.conf) {
return;
}
// The end-user has already been notified about our telemetry integration. We
// don't need to constantly annoy them about it.
// We will re-inform users about the telemetry if significant changes are
// ever made.
if (this.conf.get(TELEMETRY_KEY_NOTIFY_DATE, "")) {
return;
}
this.conf.set(TELEMETRY_KEY_NOTIFY_DATE, Date.now().toString());
console.log(`${(0, _picocolors.magenta)((0, _picocolors.bold)("Attention"))}: Next.js now collects completely anonymous telemetry regarding usage.`);
console.log(`This information is used to shape Next.js' roadmap and prioritize features.`);
console.log(`You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:`);
console.log((0, _picocolors.cyan)("https://nextjs.org/telemetry"));
console.log();
};
this.setEnabled = (_enabled)=>{
const enabled = !!_enabled;
this.conf && this.conf.set(TELEMETRY_KEY_ENABLED, enabled);
return this.conf && this.conf.path;
};
this.oneWayHash = (payload)=>{
const hash = (0, _crypto.createHash)("sha256");
// Always prepend the payload value with salt. This ensures the hash is truly
// one-way.
hash.update(this.salt);
// Update is an append operation, not a replacement. The salt from the prior
// update is still present!
hash.update(payload);
return hash.digest("hex");
};
this.record = (_events, deferred)=>{
const prom = (deferred ? // flushDetached we can skip starting the initial
// submitRecord which will then be cancelled
new Promise((resolve)=>resolve({
isFulfilled: true,
isRejected: false,
value: _events
})) : this.submitRecord(_events)).then((value)=>({
isFulfilled: true,
isRejected: false,
value
})).catch((reason)=>({
isFulfilled: false,
isRejected: true,
reason
}))// Acts as `Promise#finally` because `catch` transforms the error
.then((res)=>{
// Clean up the event to prevent unbounded `Set` growth
if (!deferred) {
this.queue.delete(prom);
}
return res;
});
prom._events = Array.isArray(_events) ? _events : [
_events
];
prom._controller = prom._controller;
// Track this `Promise` so we can flush pending events
this.queue.add(prom);
return prom;
};
this.flush = async ()=>Promise.all(this.queue).catch(()=>null);
// writes current events to disk and spawns separate
// detached process to submit the records without blocking
// the main process from exiting
this.flushDetached = (mode, dir)=>{
const allEvents = [];
this.queue.forEach((item)=>{
try {
var _item__controller;
(_item__controller = item._controller) == null ? void 0 : _item__controller.abort();
allEvents.push(...item._events);
} catch (_) {
// if we fail to abort ignore this event
}
});
_fs.default.mkdirSync(this.distDir, {
recursive: true
});
_fs.default.writeFileSync(_path.default.join(this.distDir, "_events.json"), JSON.stringify(allEvents));
// Note: cross-spawn is not used here as it causes
// a new command window to appear when we don't want it to
const child_process = require("child_process");
// we use spawnSync when debugging to ensure logs are piped
// correctly to stdout/stderr
const spawn = this.NEXT_TELEMETRY_DEBUG ? child_process.spawnSync : child_process.spawn;
spawn(process.execPath, [
require.resolve("./detached-flush"),
mode,
dir
], {
detached: !this.NEXT_TELEMETRY_DEBUG,
windowsHide: true,
shell: false,
...this.NEXT_TELEMETRY_DEBUG ? {
stdio: "inherit"
} : {}
});
};
this.submitRecord = async (_events)=>{
let events;
if (Array.isArray(_events)) {
events = _events;
} else {
events = [
_events
];
}
if (events.length < 1) {
return Promise.resolve();
}
if (this.NEXT_TELEMETRY_DEBUG) {
// Print to standard error to simplify selecting the output
events.forEach(({ eventName, payload })=>console.error(`[telemetry] ` + JSON.stringify({
eventName,
payload
}, null, 2)));
// Do not send the telemetry data if debugging. Users may use this feature
// to preview what data would be sent.
return Promise.resolve();
}
// Skip recording telemetry if the feature is disabled
if (this.isDisabled) {
return Promise.resolve();
}
const context = {
anonymousId: this.anonymousId,
projectId: await this.getProjectId(),
sessionId: this.sessionId
};
const meta = (0, _anonymousmeta.getAnonymousMeta)();
const postController = new _ponyfill.AbortController();
const res = (0, _postpayload._postPayload)(`https://telemetry.nextjs.org/api/v1/record`, {
context,
meta,
events: events.map(({ eventName, payload })=>({
eventName,
fields: payload
}))
}, postController.signal);
res._controller = postController;
return res;
};
// Read in the constructor so that .env can be loaded before reading
const { NEXT_TELEMETRY_DISABLED, NEXT_TELEMETRY_DEBUG } = process.env;
this.NEXT_TELEMETRY_DISABLED = NEXT_TELEMETRY_DISABLED;
this.NEXT_TELEMETRY_DEBUG = NEXT_TELEMETRY_DEBUG;
this.distDir = distDir;
const storageDirectory = getStorageDirectory(distDir);
try {
// `conf` incorrectly throws a permission error during initialization
// instead of waiting for first use. We need to handle it, otherwise the
// process may crash.
this.conf = new _conf.default({
projectName: "nextjs",
cwd: storageDirectory
});
} catch (_) {
this.conf = null;
}
this.sessionId = (0, _crypto.randomBytes)(32).toString("hex");
this.queue = new Set();
this.notify();
}
get anonymousId() {
const val = this.conf && this.conf.get(TELEMETRY_KEY_ID);
if (val) {
return val;
}
const generated = (0, _crypto.randomBytes)(32).toString("hex");
this.conf && this.conf.set(TELEMETRY_KEY_ID, generated);
return generated;
}
get salt() {
const val = this.conf && this.conf.get(TELEMETRY_KEY_SALT);
if (val) {
return val;
}
const generated = (0, _crypto.randomBytes)(16).toString("hex");
this.conf && this.conf.set(TELEMETRY_KEY_SALT, generated);
return generated;
}
get isDisabled() {
if (!!this.NEXT_TELEMETRY_DISABLED || !this.conf) {
return true;
}
return this.conf.get(TELEMETRY_KEY_ENABLED, true) === false;
}
get isEnabled() {
return !this.NEXT_TELEMETRY_DISABLED && !!this.conf && this.conf.get(TELEMETRY_KEY_ENABLED, true) !== false;
}
async getProjectId() {
this.loadProjectId = this.loadProjectId || (0, _projectid.getRawProjectId)();
return this.oneWayHash(await this.loadProjectId);
}
}
//# sourceMappingURL=storage.js.map

1
node_modules/next/dist/telemetry/storage.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long