main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

250
node_modules/next/dist/esm/build/output/index.js generated vendored Normal file
View File

@@ -0,0 +1,250 @@
import chalk from "next/dist/compiled/chalk";
import stripAnsi from "next/dist/compiled/strip-ansi";
import textTable from "next/dist/compiled/text-table";
import createStore from "next/dist/compiled/unistore";
import formatWebpackMessages from "../../client/dev/error-overlay/format-webpack-messages";
import { store as consoleStore } from "./store";
import { COMPILER_NAMES } from "../../shared/lib/constants";
export function startedDevelopmentServer(appUrl, bindAddr) {
consoleStore.setState({
appUrl,
bindAddr
});
}
export function formatAmpMessages(amp) {
let output = chalk.bold("Amp Validation") + "\n\n";
let messages = [];
const chalkError = chalk.red("error");
function ampError(page, error) {
messages.push([
page,
chalkError,
error.message,
error.specUrl || ""
]);
}
const chalkWarn = chalk.yellow("warn");
function ampWarn(page, warn) {
messages.push([
page,
chalkWarn,
warn.message,
warn.specUrl || ""
]);
}
for(const page in amp){
let { errors, warnings } = amp[page];
const devOnlyFilter = (err)=>err.code !== "DEV_MODE_ONLY";
errors = errors.filter(devOnlyFilter);
warnings = warnings.filter(devOnlyFilter);
if (!(errors.length || warnings.length)) {
continue;
}
if (errors.length) {
ampError(page, errors[0]);
for(let index = 1; index < errors.length; ++index){
ampError("", errors[index]);
}
}
if (warnings.length) {
ampWarn(errors.length ? "" : page, warnings[0]);
for(let index = 1; index < warnings.length; ++index){
ampWarn("", warnings[index]);
}
}
messages.push([
"",
"",
"",
""
]);
}
if (!messages.length) {
return "";
}
output += textTable(messages, {
align: [
"l",
"l",
"l",
"l"
],
stringLength (str) {
return stripAnsi(str).length;
}
});
return output;
}
const buildStore = createStore({
// @ts-expect-error initial value
client: {},
// @ts-expect-error initial value
server: {},
// @ts-expect-error initial value
edgeServer: {}
});
let buildWasDone = false;
let clientWasLoading = true;
let serverWasLoading = true;
let edgeServerWasLoading = false;
buildStore.subscribe((state)=>{
const { amp, client, server, edgeServer, trigger } = state;
const { appUrl } = consoleStore.getState();
if (client.loading || server.loading || (edgeServer == null ? void 0 : edgeServer.loading)) {
consoleStore.setState({
bootstrap: false,
appUrl: appUrl,
// If it takes more than 3 seconds to compile, mark it as loading status
loading: true,
trigger
}, true);
clientWasLoading = !buildWasDone && clientWasLoading || client.loading;
serverWasLoading = !buildWasDone && serverWasLoading || server.loading;
edgeServerWasLoading = !buildWasDone && edgeServerWasLoading || edgeServer.loading;
buildWasDone = false;
return;
}
buildWasDone = true;
let partialState = {
bootstrap: false,
appUrl: appUrl,
loading: false,
typeChecking: false,
totalModulesCount: (clientWasLoading ? client.totalModulesCount : 0) + (serverWasLoading ? server.totalModulesCount : 0) + (edgeServerWasLoading ? (edgeServer == null ? void 0 : edgeServer.totalModulesCount) || 0 : 0),
hasEdgeServer: !!edgeServer
};
if (client.errors && clientWasLoading) {
// Show only client errors
consoleStore.setState({
...partialState,
errors: client.errors,
warnings: null
}, true);
} else if (server.errors && serverWasLoading) {
consoleStore.setState({
...partialState,
errors: server.errors,
warnings: null
}, true);
} else if (edgeServer.errors && edgeServerWasLoading) {
consoleStore.setState({
...partialState,
errors: edgeServer.errors,
warnings: null
}, true);
} else {
// Show warnings from all of them
const warnings = [
...client.warnings || [],
...server.warnings || [],
...edgeServer.warnings || []
].concat(formatAmpMessages(amp) || []);
consoleStore.setState({
...partialState,
errors: null,
warnings: warnings.length === 0 ? null : warnings
}, true);
}
});
export function ampValidation(page, errors, warnings) {
const { amp } = buildStore.getState();
if (!(errors.length || warnings.length)) {
buildStore.setState({
amp: Object.keys(amp).filter((k)=>k !== page).sort()// eslint-disable-next-line no-sequences
.reduce((a, c)=>(a[c] = amp[c], a), {})
});
return;
}
const newAmp = {
...amp,
[page]: {
errors,
warnings
}
};
buildStore.setState({
amp: Object.keys(newAmp).sort()// eslint-disable-next-line no-sequences
.reduce((a, c)=>(a[c] = newAmp[c], a), {})
});
}
export function watchCompilers(client, server, edgeServer) {
buildStore.setState({
client: {
loading: true
},
server: {
loading: true
},
edgeServer: {
loading: true
},
trigger: "initial"
});
function tapCompiler(key, compiler, onEvent) {
compiler.hooks.invalid.tap(`NextJsInvalid-${key}`, ()=>{
onEvent({
loading: true
});
});
compiler.hooks.done.tap(`NextJsDone-${key}`, (stats)=>{
buildStore.setState({
amp: {}
});
const { errors, warnings } = formatWebpackMessages(stats.toJson({
preset: "errors-warnings",
moduleTrace: true
}));
const hasErrors = !!(errors == null ? void 0 : errors.length);
const hasWarnings = !!(warnings == null ? void 0 : warnings.length);
onEvent({
loading: false,
totalModulesCount: stats.compilation.modules.size,
errors: hasErrors ? errors : null,
warnings: hasWarnings ? warnings : null
});
});
}
tapCompiler(COMPILER_NAMES.client, client, (status)=>{
if (!status.loading && !buildStore.getState().server.loading && !buildStore.getState().edgeServer.loading && status.totalModulesCount > 0) {
buildStore.setState({
client: status,
trigger: undefined
});
} else {
buildStore.setState({
client: status
});
}
});
tapCompiler(COMPILER_NAMES.server, server, (status)=>{
if (!status.loading && !buildStore.getState().client.loading && !buildStore.getState().edgeServer.loading && status.totalModulesCount > 0) {
buildStore.setState({
server: status,
trigger: undefined
});
} else {
buildStore.setState({
server: status
});
}
});
tapCompiler(COMPILER_NAMES.edgeServer, edgeServer, (status)=>{
if (!status.loading && !buildStore.getState().client.loading && !buildStore.getState().server.loading && status.totalModulesCount > 0) {
buildStore.setState({
edgeServer: status,
trigger: undefined
});
} else {
buildStore.setState({
edgeServer: status
});
}
});
}
export function reportTrigger(trigger) {
buildStore.setState({
trigger
});
}
//# sourceMappingURL=index.js.map

1
node_modules/next/dist/esm/build/output/index.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

61
node_modules/next/dist/esm/build/output/log.js generated vendored Normal file
View File

@@ -0,0 +1,61 @@
import chalk from "../../lib/chalk";
export const prefixes = {
wait: chalk.white(chalk.bold("○")),
error: chalk.red(chalk.bold("X")),
warn: chalk.yellow(chalk.bold("⚠")),
ready: chalk.bold("▲"),
info: chalk.white(chalk.bold(" ")),
event: chalk.green(chalk.bold("✓")),
trace: chalk.magenta(chalk.bold("\xbb"))
};
const LOGGING_METHOD = {
log: "log",
warn: "warn",
error: "error"
};
function prefixedLog(prefixType, ...message) {
if ((message[0] === "" || message[0] === undefined) && message.length === 1) {
message.shift();
}
const consoleMethod = prefixType in LOGGING_METHOD ? LOGGING_METHOD[prefixType] : "log";
const prefix = prefixes[prefixType];
// If there's no message, don't print the prefix but a new line
if (message.length === 0) {
console[consoleMethod]("");
} else {
console[consoleMethod](" " + prefix, ...message);
}
}
export function bootstrap(...message) {
console.log(" ", ...message);
}
export function wait(...message) {
prefixedLog("wait", ...message);
}
export function error(...message) {
prefixedLog("error", ...message);
}
export function warn(...message) {
prefixedLog("warn", ...message);
}
export function ready(...message) {
prefixedLog("ready", ...message);
}
export function info(...message) {
prefixedLog("info", ...message);
}
export function event(...message) {
prefixedLog("event", ...message);
}
export function trace(...message) {
prefixedLog("trace", ...message);
}
const warnOnceMessages = new Set();
export function warnOnce(...message) {
if (!warnOnceMessages.has(message[0])) {
warnOnceMessages.add(message.join(" "));
warn(...message);
}
}
//# sourceMappingURL=log.js.map

1
node_modules/next/dist/esm/build/output/log.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/build/output/log.ts"],"names":["chalk","prefixes","wait","white","bold","error","red","warn","yellow","ready","info","event","green","trace","magenta","LOGGING_METHOD","log","prefixedLog","prefixType","message","undefined","length","shift","consoleMethod","prefix","console","bootstrap","warnOnceMessages","Set","warnOnce","has","add","join"],"mappings":"AAAA,OAAOA,WAAW,kBAAiB;AAEnC,OAAO,MAAMC,WAAW;IACtBC,MAAMF,MAAMG,KAAK,CAACH,MAAMI,IAAI,CAAC;IAC7BC,OAAOL,MAAMM,GAAG,CAACN,MAAMI,IAAI,CAAC;IAC5BG,MAAMP,MAAMQ,MAAM,CAACR,MAAMI,IAAI,CAAC;IAC9BK,OAAOT,MAAMI,IAAI,CAAC;IAClBM,M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B,IAAIC;AAC7B,OAAO,SAASC,SAAS,GAAGV,OAAc;IACxC,IAAI,CAACQ,iBAAiBG,GAAG,CAACX,OAAO,CAAC,EAAE,GAAG;QACrCQ,iBAAiBI,GAAG,CAACZ,QAAQa,IAAI,CAAC;QAElCzB,QAAQY;IACV;AACF"}

118
node_modules/next/dist/esm/build/output/store.js generated vendored Normal file
View File

@@ -0,0 +1,118 @@
import createStore from "next/dist/compiled/unistore";
import stripAnsi from "next/dist/compiled/strip-ansi";
import { flushAllTraces } from "../../trace";
import { teardownCrashReporter, teardownHeapProfiler, teardownTraceSubscriber } from "../swc";
import * as Log from "./log";
const MAX_DURATION = 3 * 1000;
export const store = createStore({
appUrl: null,
bindAddr: null,
bootstrap: true
});
let lastStore = {
appUrl: null,
bindAddr: null,
bootstrap: true
};
function hasStoreChanged(nextStore) {
if ([
...new Set([
...Object.keys(lastStore),
...Object.keys(nextStore)
])
].every((key)=>Object.is(lastStore[key], nextStore[key]))) {
return false;
}
lastStore = nextStore;
return true;
}
let startTime = 0;
let trigger = "" // default, use empty string for trigger
;
let loadingLogTimer = null;
store.subscribe((state)=>{
if (!hasStoreChanged(state)) {
return;
}
if (state.bootstrap) {
return;
}
if (state.loading) {
if (state.trigger) {
trigger = state.trigger;
if (trigger !== "initial") {
if (!loadingLogTimer) {
// Only log compiling if compiled is not finished in 3 seconds
loadingLogTimer = setTimeout(()=>{
Log.wait(`compiling ${trigger} ...`);
}, MAX_DURATION);
}
}
}
if (startTime === 0) {
startTime = Date.now();
}
return;
}
if (state.errors) {
Log.error(state.errors[0]);
const cleanError = stripAnsi(state.errors[0]);
if (cleanError.indexOf("SyntaxError") > -1) {
const matches = cleanError.match(/\[.*\]=/);
if (matches) {
for (const match of matches){
const prop = (match.split("]").shift() || "").slice(1);
console.log(`AMP bind syntax [${prop}]='' is not supported in JSX, use 'data-amp-bind-${prop}' instead. https://nextjs.org/docs/messages/amp-bind-jsx-alt`);
}
return;
}
}
startTime = 0;
// Ensure traces are flushed after each compile in development mode
flushAllTraces();
teardownTraceSubscriber();
teardownHeapProfiler();
teardownCrashReporter();
return;
}
let timeMessage = "";
if (startTime) {
const time = Date.now() - startTime;
startTime = 0;
timeMessage = " " + (time > 2000 ? `in ${Math.round(time / 100) / 10}s` : `in ${time}ms`);
}
let modulesMessage = "";
if (state.totalModulesCount) {
modulesMessage = ` (${state.totalModulesCount} modules)`;
}
if (state.warnings) {
Log.warn(state.warnings.join("\n\n"));
// Ensure traces are flushed after each compile in development mode
flushAllTraces();
teardownTraceSubscriber();
teardownHeapProfiler();
teardownCrashReporter();
return;
}
if (state.typeChecking) {
Log.info(`bundled ${trigger}${timeMessage}${modulesMessage}, type checking...`);
return;
}
if (trigger === "initial") {
trigger = "";
} else {
if (loadingLogTimer) {
clearTimeout(loadingLogTimer);
loadingLogTimer = null;
}
Log.event(`Compiled${trigger ? " " + trigger : ""}${timeMessage}${modulesMessage}`);
trigger = "";
}
// Ensure traces are flushed after each compile in development mode
flushAllTraces();
teardownTraceSubscriber();
teardownHeapProfiler();
teardownCrashReporter();
});
//# sourceMappingURL=store.js.map

1
node_modules/next/dist/esm/build/output/store.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/build/output/store.ts"],"names":["createStore","stripAnsi","flushAllTraces","teardownCrashReporter","teardownHeapProfiler","teardownTraceSubscriber","Log","MAX_DURATION","store","appUrl","bindAddr","bootstrap","lastStore","hasStoreChanged","nextStore","Set","Object","keys","every","key","is","startTime","trigger","loadingLogTimer","subscribe","state","loading","setTimeout","wait","Date","now","errors","error","cleanError","indexOf","matches","match","prop","split","shift","slice","console","log","timeMessage","time","Math","round","modulesMessage","totalModulesCount","warnings","warn","join","typeChecking","info","clearTimeout","event"],"mappings":"AAAA,OAAOA,iBAAiB,8BAA6B;AACrD,OAAOC,eAAe,gCAA+B;AACrD,SAASC,cAAc,QAAQ,cAAa;AAC5C,SACEC,qBAAqB,EACrBC,oBAAoB,EACpBC,uBAAuB,QAClB,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