inital commit

This commit is contained in:
2026-01-01 15:25:19 +05:30
commit f0ae49465a
36361 changed files with 4894111 additions and 0 deletions

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

@@ -0,0 +1,88 @@
import type { TelemetryPlugin } from '../../build/webpack/plugins/telemetry-plugin/telemetry-plugin';
import type { SWC_TARGET_TRIPLE } from '../../build/webpack/plugins/telemetry-plugin/telemetry-plugin';
import type { UseCacheTrackerKey } from '../../build/webpack/plugins/telemetry-plugin/use-cache-tracker-utils';
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/dynamicIO' | 'experimental/optimizeCss' | 'experimental/ppr' | 'swcLoader' | 'swcRelay' | 'swcStyledComponents' | 'swcReactRemoveProperties' | 'swcExperimentalDecorators' | 'swcRemoveConsole' | 'swcImportSource' | 'swcEmotion' | `swc/target/${SWC_TARGET_TRIPLE}` | 'turbotrace' | 'build-lint' | 'vercelImageGeneration' | 'transpilePackages' | 'skipMiddlewareUrlNormalize' | 'skipTrailingSlashRedirect' | 'modularizeImports' | 'esmExternals' | 'webpackPlugins' | UseCacheTrackerKey;
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

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
export declare const eventNameErrorFeedback = "NEXT_ERROR_FEEDBACK";
export type EventErrorFeedback = {
errorCode: string;
wasHelpful: boolean;
};
/**
* Records telemetry for error feedback.
*
* @example
* ```ts
* telemetry.record(eventErrorFeedback({
* errorCode: 'E1',
* wasHelpful: true
* }))
* ```
*/
export declare function eventErrorFeedback(event: EventErrorFeedback): {
eventName: string;
payload: EventErrorFeedback;
};

View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
eventErrorFeedback: null,
eventNameErrorFeedback: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
eventErrorFeedback: function() {
return eventErrorFeedback;
},
eventNameErrorFeedback: function() {
return eventNameErrorFeedback;
}
});
const eventNameErrorFeedback = 'NEXT_ERROR_FEEDBACK';
function eventErrorFeedback(event) {
return {
eventName: eventNameErrorFeedback,
payload: event
};
}
//# sourceMappingURL=error-feedback.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/telemetry/events/error-feedback.ts"],"sourcesContent":["export const eventNameErrorFeedback = 'NEXT_ERROR_FEEDBACK'\n\nexport type EventErrorFeedback = {\n errorCode: string\n wasHelpful: boolean\n}\n\n/**\n * Records telemetry for error feedback.\n *\n * @example\n * ```ts\n * telemetry.record(eventErrorFeedback({\n * errorCode: 'E1',\n * wasHelpful: true\n * }))\n * ```\n */\nexport function eventErrorFeedback(event: EventErrorFeedback): {\n eventName: string\n payload: EventErrorFeedback\n} {\n return {\n eventName: eventNameErrorFeedback,\n payload: event,\n }\n}\n"],"names":["eventErrorFeedback","eventNameErrorFeedback","event","eventName","payload"],"mappings":";;;;;;;;;;;;;;;IAkBgBA,kBAAkB;eAAlBA;;IAlBHC,sBAAsB;eAAtBA;;;AAAN,MAAMA,yBAAyB;AAkB/B,SAASD,mBAAmBE,KAAyB;IAI1D,OAAO;QACLC,WAAWF;QACXG,SAASF;IACX;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"],"sourcesContent":["export * from './version'\nexport * from './build'\nexport * from './plugins'\n"],"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"],"sourcesContent":["import findUp from 'next/dist/compiled/find-up'\n\nconst EVENT_PLUGIN_PRESENT = 'NEXT_PACKAGE_DETECTED'\ntype NextPluginsEvent = {\n eventName: string\n payload: {\n packageName: string\n packageVersion: string\n }\n}\n\nexport async function eventNextPlugins(\n dir: string\n): Promise<Array<NextPluginsEvent>> {\n try {\n const packageJsonPath = await findUp('package.json', { cwd: dir })\n if (!packageJsonPath) {\n return []\n }\n\n const { dependencies = {}, devDependencies = {} } = require(packageJsonPath)\n\n const deps = { ...devDependencies, ...dependencies }\n\n return Object.keys(deps).reduce(\n (events: NextPluginsEvent[], plugin: string): NextPluginsEvent[] => {\n const version = deps[plugin]\n // Don't add deps without a version set\n if (!version) {\n return events\n }\n\n events.push({\n eventName: EVENT_PLUGIN_PRESENT,\n payload: {\n packageName: plugin,\n packageVersion: version,\n },\n })\n\n return events\n },\n []\n )\n } catch (_) {\n return []\n }\n}\n"],"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 "15.2.4" !== 'string') {
return [];
}
const payload = {
nextVersion: "15.2.4",
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"],"sourcesContent":["const EVENT_VERSION = 'NEXT_CLI_SESSION_STOPPED'\n\nexport type EventCliSessionStopped = {\n cliCommand: string\n nextVersion: string\n nodeVersion: string\n turboFlag?: boolean | null\n durationMilliseconds?: number | null\n pagesDir?: boolean\n appDir?: boolean\n}\n\nexport function eventCliSessionStopped(\n event: Omit<EventCliSessionStopped, 'nextVersion' | 'nodeVersion'>\n): { eventName: string; payload: EventCliSessionStopped }[] {\n // This should be an invariant, if it fails our build tooling is broken.\n if (typeof process.env.__NEXT_VERSION !== 'string') {\n return []\n }\n\n const payload: EventCliSessionStopped = {\n nextVersion: process.env.__NEXT_VERSION,\n nodeVersion: process.version,\n cliCommand: event.cliCommand,\n durationMilliseconds: event.durationMilliseconds,\n ...(typeof event.turboFlag !== 'undefined'\n ? {\n turboFlag: !!event.turboFlag,\n }\n : {}),\n pagesDir: event.pagesDir,\n appDir: event.appDir,\n }\n return [{ eventName: EVENT_VERSION, payload }]\n}\n"],"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"],"sourcesContent":["import { traceGlobals } from '../../trace/shared'\nimport type { Telemetry } from '../storage'\n// @ts-ignore JSON\nimport { version as nextVersion, optionalDependencies } from 'next/package.json'\n\nconst EVENT_PLUGIN_PRESENT = 'NEXT_SWC_LOAD_FAILURE'\nexport type EventSwcLoadFailure = {\n eventName: string\n payload: {\n platform: string\n arch: string\n nodeVersion: string\n nextVersion: string\n wasm?: 'enabled' | 'fallback' | 'failed'\n glibcVersion?: string\n installedSwcPackages?: string\n nativeBindingsErrorCode?: string\n }\n}\n\nexport async function eventSwcLoadFailure(\n event?: EventSwcLoadFailure['payload']\n): Promise<void> {\n const telemetry: Telemetry | undefined = traceGlobals.get('telemetry')\n // can't continue if telemetry isn't set\n if (!telemetry) return\n\n let glibcVersion\n let installedSwcPackages\n\n try {\n // @ts-ignore\n glibcVersion = process.report?.getReport().header.glibcVersionRuntime\n } catch {}\n\n try {\n const pkgNames = Object.keys(optionalDependencies || {}).filter((pkg) =>\n pkg.startsWith('@next/swc')\n )\n const installedPkgs = []\n\n for (const pkg of pkgNames) {\n try {\n const { version } = require(`${pkg}/package.json`)\n installedPkgs.push(`${pkg}@${version}`)\n } catch {}\n }\n\n if (installedPkgs.length > 0) {\n installedSwcPackages = installedPkgs.sort().join(',')\n }\n } catch {}\n\n telemetry.record({\n eventName: EVENT_PLUGIN_PRESENT,\n payload: {\n nextVersion,\n glibcVersion,\n installedSwcPackages,\n arch: process.arch,\n platform: process.platform,\n nodeVersion: process.versions.node,\n wasm: event?.wasm,\n nativeBindingsErrorCode: event?.nativeBindingsErrorCode,\n },\n })\n // ensure this event is flushed before process exits\n await telemetry.flush()\n}\n"],"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,GAAGJ,IAAI,aAAa,CAAC;gBACjDE,cAAcG,IAAI,CAAC,GAAGL,IAAI,CAAC,EAAEG,SAAS;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"],"sourcesContent":["import findUp from 'next/dist/compiled/find-up'\nimport path from 'path'\nimport fs from 'fs'\nimport type { NextConfig } from '../../server/config-shared'\n\nconst EVENT_SWC_PLUGIN_PRESENT = 'NEXT_SWC_PLUGIN_DETECTED'\ntype SwcPluginsEvent = {\n eventName: string\n payload: {\n pluginName: string\n pluginVersion?: string\n }\n}\n\nexport async function eventSwcPlugins(\n dir: string,\n config: NextConfig\n): Promise<Array<SwcPluginsEvent>> {\n try {\n const packageJsonPath = await findUp('package.json', { cwd: dir })\n if (!packageJsonPath) {\n return []\n }\n\n const { dependencies = {}, devDependencies = {} } = require(packageJsonPath)\n\n const deps = { ...devDependencies, ...dependencies }\n const swcPluginPackages =\n config.experimental?.swcPlugins?.map(([name, _]) => name) ?? []\n\n return swcPluginPackages.map((plugin) => {\n // swc plugins can be non-npm pkgs with absolute path doesn't have version\n const version = deps[plugin] ?? undefined\n let pluginName = plugin\n if (fs.existsSync(pluginName)) {\n pluginName = path.basename(plugin, '.wasm')\n }\n\n return {\n eventName: EVENT_SWC_PLUGIN_PRESENT,\n payload: {\n pluginName: pluginName,\n pluginVersion: version,\n },\n }\n })\n } catch (_) {\n return []\n }\n}\n"],"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"}

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

@@ -0,0 +1,44 @@
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;
imageLocalPatternsCount: number | null;
imageQualities: string | 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;
reactCompiler: boolean;
reactCompilerCompilationMode: string | null;
reactCompilerPanicThreshold: string | 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' | 'imageLocalPatternsCount' | 'imageQualities' | 'imageSizes' | 'imageLoader' | 'imageFormats' | 'nextConfigOutput' | 'trailingSlashEnabled' | 'reactStrictMode' | 'staticStaleTime' | 'dynamicStaleTime' | 'reactCompiler' | 'reactCompilerCompilationMode' | 'reactCompilerPanicThreshold'>): {
eventName: string;
payload: EventCliSessionStarted;
}[];
export {};

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

@@ -0,0 +1,89 @@
"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, _nextConfig_experimental_reactCompiler, _nextConfig_experimental_reactCompiler1;
// This should be an invariant, if it fails our build tooling is broken.
if (typeof "15.2.4" !== 'string') {
return [];
}
const { images, i18n } = nextConfig || {};
const payload = {
nextVersion: "15.2.4",
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,
imageLocalPatternsCount: (images == null ? void 0 : images.localPatterns) ? images.localPatterns.length : null,
imageSizes: (images == null ? void 0 : images.imageSizes) ? images.imageSizes.join(',') : null,
imageQualities: (images == null ? void 0 : images.qualities) ? images.qualities.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,
reactCompiler: Boolean(nextConfig.experimental.reactCompiler),
reactCompilerCompilationMode: typeof nextConfig.experimental.reactCompiler !== 'boolean' ? ((_nextConfig_experimental_reactCompiler = nextConfig.experimental.reactCompiler) == null ? void 0 : _nextConfig_experimental_reactCompiler.compilationMode) ?? null : null,
reactCompilerPanicThreshold: typeof nextConfig.experimental.reactCompiler !== 'boolean' ? ((_nextConfig_experimental_reactCompiler1 = nextConfig.experimental.reactCompiler) == null ? void 0 : _nextConfig_experimental_reactCompiler1.panicThreshold) ?? null : null
};
return [
{
eventName: EVENT_VERSION,
payload
}
];
}
//# sourceMappingURL=version.js.map

File diff suppressed because one or more lines are too long