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

2
node_modules/next/dist/cli/next-build-args.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import arg from 'next/dist/compiled/arg/index.js';
export declare const validArgs: arg.Spec;

27
node_modules/next/dist/cli/next-build-args.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "validArgs", {
enumerable: true,
get: function() {
return validArgs;
}
});
const validArgs = {
// Types
"--help": Boolean,
"--profile": Boolean,
"--debug": Boolean,
"--no-lint": Boolean,
"--no-mangling": Boolean,
"--experimental-app-only": Boolean,
"--experimental-turbo": Boolean,
"--experimental-turbo-root": String,
"--build-mode": String,
// Aliases
"-h": "--help",
"-d": "--debug"
};
//# sourceMappingURL=next-build-args.js.map

1
node_modules/next/dist/cli/next-build-args.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/cli/next-build-args.ts"],"names":["validArgs","Boolean","String"],"mappings":";;;;+BAEaA;;;eAAAA;;;AAAN,MAAMA,YAAsB;IACjC,QAAQ;IACR,UAAUC;IACV,aAAaA;IACb,WAAWA;IACX,aAAaA;IACb,iBAAiBA;IACjB,2BAA2BA;IAC3B,wBAAwBA;IACxB,6BAA6BC;IAC7B,gBAAgBA;IAChB,UAAU;IACV,MAAM;IACN,MAAM;AACR"}

5
node_modules/next/dist/cli/next-build.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env node
import '../server/lib/cpu-profile';
import { CliCommand } from '../lib/commands';
declare const nextBuild: CliCommand;
export { nextBuild };

112
node_modules/next/dist/cli/next-build.js generated vendored Normal file
View File

@@ -0,0 +1,112 @@
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "nextBuild", {
enumerable: true,
get: function() {
return nextBuild;
}
});
require("../server/lib/cpu-profile");
const _fs = require("fs");
const _log = /*#__PURE__*/ _interop_require_wildcard(require("../build/output/log"));
const _build = /*#__PURE__*/ _interop_require_default(require("../build"));
const _utils = require("../server/lib/utils");
const _iserror = /*#__PURE__*/ _interop_require_default(require("../lib/is-error"));
const _getprojectdir = require("../lib/get-project-dir");
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 = {};
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;
}
const nextBuild = (args)=>{
if (args["--help"]) {
(0, _utils.printAndExit)(`
Description
Compiles the application for production deployment
Usage
$ next build <dir>
<dir> represents the directory of the Next.js application.
If no directory is provided, the current directory will be used.
Options
--profile Can be used to enable React Production Profiling
--no-lint Disable linting
--no-mangling Disable mangling
--experimental-app-only Only build 'app' routes
--experimental-turbo Enable experimental turbo mode
--help, -h Displays this message
`, 0);
}
if (args["--profile"]) {
_log.warn("Profiling is enabled. Note: This may affect performance");
}
if (args["--no-lint"]) {
_log.warn("Linting is disabled");
}
if (args["--no-mangling"]) {
_log.warn("Mangling is disabled. Note: This may affect performance and should only be used for debugging purposes");
}
const dir = (0, _getprojectdir.getProjectDir)(args._[0]);
// Check if the provided directory exists
if (!(0, _fs.existsSync)(dir)) {
(0, _utils.printAndExit)(`> No such directory exists as the project root: ${dir}`);
}
if (args["--experimental-turbo"]) {
process.env.TURBOPACK = "1";
}
return (0, _build.default)(dir, args["--profile"], args["--debug"] || process.env.NEXT_DEBUG_BUILD, !args["--no-lint"], args["--no-mangling"], args["--experimental-app-only"], !!process.env.TURBOPACK, args["--experimental-turbo-root"], args["--build-mode"] || "default").catch((err)=>{
console.error("");
if ((0, _iserror.default)(err) && (err.code === "INVALID_RESOLVE_ALIAS" || err.code === "WEBPACK_ERRORS" || err.code === "BUILD_OPTIMIZATION_FAILED" || err.code === "NEXT_EXPORT_ERROR" || err.code === "NEXT_STATIC_GEN_BAILOUT" || err.code === "EDGE_RUNTIME_UNSUPPORTED_API")) {
(0, _utils.printAndExit)(`> ${err.message}`);
} else {
console.error("> Build error occurred");
(0, _utils.printAndExit)(err);
}
});
};
//# sourceMappingURL=next-build.js.map

1
node_modules/next/dist/cli/next-build.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/cli/next-build.ts"],"names":["nextBuild","args","printAndExit","Log","warn","dir","getProjectDir","_","existsSync","process","env","TURBOPACK","build","NEXT_DEBUG_BUILD","catch","err","console","error","isError","code","message"],"mappings":";;;;;+BAsFSA;;;eAAAA;;;QApFF;oBACoB;6DACN;8DAEH;uBACW;gEACT;+BACU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9B,MAAMA,YAAwB,CAACC;IAC7B,IAAIA,IAAI,CAAC,SAAS,EAAE;QAClBC,IAAAA,mBAAY,EACV,CAAC;;;;;;;;;;;;;;;;;IAiBH,CAAC,EACC;IAEJ;IACA,IAAID,IAAI,CAAC,YAAY,EAAE;QACrBE,KAAIC,IAAI,CAAC;IACX;IACA,IAAIH,IAAI,CAAC,YAAY,EAAE;QACrBE,KAAIC,IAAI,CAAC;IACX;IACA,IAAIH,IAAI,CAAC,gBAAgB,EAAE;QACzBE,KAAIC,IAAI,CACN;IAEJ;IACA,MAAMC,MAAMC,IAAAA,4BAAa,EAACL,KAAKM,CAAC,CAAC,EAAE;IAEnC,yCAAyC;IACzC,IAAI,CAACC,IAAAA,cAAU,EAACH,MAAM;QACpBH,IAAAA,mBAAY,EAAC,CAAC,gDAAgD,EAAEG,IAAI,CAAC;IACvE;IAEA,IAAIJ,IAAI,CAAC,uBAAuB,EAAE;QAChCQ,QAAQC,GAAG,CAACC,SAAS,GAAG;IAC1B;IAEA,OAAOC,IAAAA,cAAK,EACVP,KACAJ,IAAI,CAAC,YAAY,EACjBA,IAAI,CAAC,UAAU,IAAIQ,QAAQC,GAAG,CAACG,gBAAgB,EAC/C,CAACZ,IAAI,CAAC,YAAY,EAClBA,IAAI,CAAC,gBAAgB,EACrBA,IAAI,CAAC,0BAA0B,EAC/B,CAAC,CAACQ,QAAQC,GAAG,CAACC,SAAS,EACvBV,IAAI,CAAC,4BAA4B,EACjCA,IAAI,CAAC,eAAe,IAAI,WACxBa,KAAK,CAAC,CAACC;QACPC,QAAQC,KAAK,CAAC;QACd,IACEC,IAAAA,gBAAO,EAACH,QACPA,CAAAA,IAAII,IAAI,KAAK,2BACZJ,IAAII,IAAI,KAAK,oBACbJ,IAAII,IAAI,KAAK,+BACbJ,IAAII,IAAI,KAAK,uBACbJ,IAAII,IAAI,KAAK,6BACbJ,IAAII,IAAI,KAAK,8BAA6B,GAC5C;YACAjB,IAAAA,mBAAY,EAAC,CAAC,EAAE,EAAEa,IAAIK,OAAO,CAAC,CAAC;QACjC,OAAO;YACLJ,QAAQC,KAAK,CAAC;YACdf,IAAAA,mBAAY,EAACa;QACf;IACF;AACF"}

2
node_modules/next/dist/cli/next-dev-args.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import arg from 'next/dist/compiled/arg/index.js';
export declare const validArgs: arg.Spec;

32
node_modules/next/dist/cli/next-dev-args.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "validArgs", {
enumerable: true,
get: function() {
return validArgs;
}
});
const validArgs = {
// Types
"--help": Boolean,
"--port": Number,
"--hostname": String,
"--turbo": Boolean,
"--experimental-https": Boolean,
"--experimental-https-key": String,
"--experimental-https-cert": String,
"--experimental-test-proxy": Boolean,
"--experimental-upload-trace": String,
// To align current messages with native binary.
// Will need to adjust subcommand later.
"--show-all": Boolean,
"--root": String,
// Aliases
"-h": "--help",
"-p": "--port",
"-H": "--hostname"
};
//# sourceMappingURL=next-dev-args.js.map

1
node_modules/next/dist/cli/next-dev-args.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/cli/next-dev-args.ts"],"names":["validArgs","Boolean","Number","String"],"mappings":";;;;+BAEaA;;;eAAAA;;;AAAN,MAAMA,YAAsB;IACjC,QAAQ;IACR,UAAUC;IACV,UAAUC;IACV,cAAcC;IACd,WAAWF;IACX,wBAAwBA;IACxB,4BAA4BE;IAC5B,6BAA6BA;IAC7B,6BAA6BF;IAC7B,+BAA+BE;IAE/B,gDAAgD;IAChD,wCAAwC;IACxC,cAAcF;IACd,UAAUE;IAEV,UAAU;IACV,MAAM;IACN,MAAM;IACN,MAAM;AACR"}

5
node_modules/next/dist/cli/next-dev.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env node
import '../server/lib/cpu-profile';
import { CliCommand } from '../lib/commands';
declare const nextDev: CliCommand;
export { nextDev };

302
node_modules/next/dist/cli/next-dev.js generated vendored Normal file
View File

@@ -0,0 +1,302 @@
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "nextDev", {
enumerable: true,
get: function() {
return nextDev;
}
});
require("../server/lib/cpu-profile");
const _utils = require("../server/lib/utils");
const _log = /*#__PURE__*/ _interop_require_wildcard(require("../build/output/log"));
const _getprojectdir = require("../lib/get-project-dir");
const _constants = require("../shared/lib/constants");
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
const _shared = require("../trace/shared");
const _storage = require("../telemetry/storage");
const _config = /*#__PURE__*/ _interop_require_wildcard(require("../server/config"));
const _findpagesdir = require("../lib/find-pages-dir");
const _fileexists = require("../lib/file-exists");
const _getnpxcommand = require("../lib/helpers/get-npx-command");
const _mkcert = require("../lib/mkcert");
const _uploadtrace = /*#__PURE__*/ _interop_require_default(require("../trace/upload-trace"));
const _env = require("@next/env");
const _trace = require("../trace");
const _turbopackwarning = require("../lib/turbopack-warning");
const _child_process = require("child_process");
const _setupserverworker = require("../server/lib/setup-server-worker");
const _getreservedport = require("../lib/helpers/get-reserved-port");
const _needsexperimentalreact = require("../lib/needs-experimental-react");
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 = {};
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 dir;
let child;
let config;
let isTurboSession = false;
let traceUploadUrl;
let sessionStopHandled = false;
let sessionStarted = Date.now();
const handleSessionStop = async (signal)=>{
if (child) {
child.kill(signal || 0);
}
if (sessionStopHandled) return;
sessionStopHandled = true;
try {
const { eventCliSessionStopped } = require("../telemetry/events/session-stopped");
config = config || await (0, _config.default)(_constants.PHASE_DEVELOPMENT_SERVER, dir);
let telemetry = _shared.traceGlobals.get("telemetry") || new _storage.Telemetry({
distDir: _path.default.join(dir, config.distDir)
});
let pagesDir = !!_shared.traceGlobals.get("pagesDir");
let appDir = !!_shared.traceGlobals.get("appDir");
if (typeof _shared.traceGlobals.get("pagesDir") === "undefined" || typeof _shared.traceGlobals.get("appDir") === "undefined") {
const pagesResult = (0, _findpagesdir.findPagesDir)(dir);
appDir = !!pagesResult.appDir;
pagesDir = !!pagesResult.pagesDir;
}
telemetry.record(eventCliSessionStopped({
cliCommand: "dev",
turboFlag: isTurboSession,
durationMilliseconds: Date.now() - sessionStarted,
pagesDir,
appDir
}), true);
telemetry.flushDetached("dev", dir);
} catch (_) {
// errors here aren't actionable so don't add
// noise to the output
}
if (traceUploadUrl) {
(0, _uploadtrace.default)({
traceUploadUrl,
mode: "dev",
isTurboSession,
projectDir: dir,
distDir: config.distDir
});
}
// ensure we re-enable the terminal cursor before exiting
// the program, or the cursor could remain hidden
process.stdout.write("\x1b[?25h");
process.stdout.write("\n");
process.exit(0);
};
process.on("SIGINT", ()=>handleSessionStop("SIGINT"));
process.on("SIGTERM", ()=>handleSessionStop("SIGTERM"));
const nextDev = async (args)=>{
if (args["--help"]) {
console.log(`
Description
Starts the application in development mode (hot-code reloading, error
reporting, etc.)
Usage
$ next dev <dir> -p <port number>
<dir> represents the directory of the Next.js application.
If no directory is provided, the current directory will be used.
Options
--port, -p A port number on which to start the application
--hostname, -H Hostname on which to start the application (default: 0.0.0.0)
--experimental-upload-trace=<trace-url> [EXPERIMENTAL] Report a subset of the debugging trace to a remote http url. Includes sensitive data. Disabled by default and url must be provided.
--help, -h Displays this message
`);
process.exit(0);
}
dir = (0, _getprojectdir.getProjectDir)(process.env.NEXT_PRIVATE_DEV_DIR || args._[0]);
// Check if pages dir exists and warn if not
if (!await (0, _fileexists.fileExists)(dir, _fileexists.FileType.Directory)) {
(0, _utils.printAndExit)(`> No such directory exists as the project root: ${dir}`);
}
async function preflight(skipOnReboot) {
const { getPackageVersion, getDependencies } = await Promise.resolve(require("../lib/get-package-version"));
const [sassVersion, nodeSassVersion] = await Promise.all([
getPackageVersion({
cwd: dir,
name: "sass"
}),
getPackageVersion({
cwd: dir,
name: "node-sass"
})
]);
if (sassVersion && nodeSassVersion) {
_log.warn("Your project has both `sass` and `node-sass` installed as dependencies, but should only use one or the other. " + "Please remove the `node-sass` dependency from your project. " + " Read more: https://nextjs.org/docs/messages/duplicate-sass");
}
if (!skipOnReboot) {
const { dependencies, devDependencies } = await getDependencies({
cwd: dir
});
// Warn if @next/font is installed as a dependency. Ignore `workspace:*` to not warn in the Next.js monorepo.
if (dependencies["@next/font"] || devDependencies["@next/font"] && devDependencies["@next/font"] !== "workspace:*") {
const command = (0, _getnpxcommand.getNpxCommand)(dir);
_log.warn("Your project has `@next/font` installed as a dependency, please use the built-in `next/font` instead. " + "The `@next/font` package will be removed in Next.js 14. " + `You can migrate by running \`${command} @next/codemod@latest built-in-next-font .\`. Read more: https://nextjs.org/docs/messages/built-in-next-font`);
}
}
}
const port = (0, _utils.getPort)(args);
if ((0, _getreservedport.isPortIsReserved)(port)) {
(0, _utils.printAndExit)((0, _getreservedport.getReservedPortExplanation)(port), 1);
}
// If neither --port nor PORT were specified, it's okay to retry new ports.
const allowRetry = args["--port"] === undefined && process.env.PORT === undefined;
// We do not set a default host value here to prevent breaking
// some set-ups that rely on listening on other interfaces
const host = args["--hostname"];
const { loadedEnvFiles } = (0, _env.loadEnvConfig)(dir, true, console, false);
let expFeatureInfo = [];
config = await (0, _config.default)(_constants.PHASE_DEVELOPMENT_SERVER, dir, {
onLoadUserConfig (userConfig) {
const userNextConfigExperimental = (0, _config.getEnabledExperimentalFeatures)(userConfig.experimental);
expFeatureInfo = userNextConfigExperimental.sort((a, b)=>a.length - b.length);
}
});
process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = (0, _needsexperimentalreact.needsExperimentalReact)(config) ? "experimental" : "next";
// we need to reset env if we are going to create
// the worker process with the esm loader so that the
// initial env state is correct
let envInfo = [];
if (loadedEnvFiles.length > 0) {
envInfo = loadedEnvFiles.map((f)=>f.path);
}
const isExperimentalTestProxy = args["--experimental-test-proxy"];
if (args["--experimental-upload-trace"]) {
traceUploadUrl = args["--experimental-upload-trace"];
}
const devServerOptions = {
dir,
port,
allowRetry,
isDev: true,
hostname: host,
isExperimentalTestProxy,
envInfo,
expFeatureInfo
};
if (args["--turbo"]) {
process.env.TURBOPACK = "1";
}
if (process.env.TURBOPACK) {
await (0, _turbopackwarning.validateTurboNextConfig)({
isCustomTurbopack: !!process.env.__INTERNAL_CUSTOM_TURBOPACK_BINDINGS,
...devServerOptions,
isDev: true
});
}
const distDir = _path.default.join(dir, config.distDir ?? ".next");
(0, _shared.setGlobal)("phase", _constants.PHASE_DEVELOPMENT_SERVER);
(0, _shared.setGlobal)("distDir", distDir);
const startServerPath = require.resolve("../server/lib/start-server");
async function startServer(options) {
return new Promise((resolve)=>{
let resolved = false;
child = (0, _child_process.fork)(startServerPath, {
stdio: "inherit",
env: {
..._env.initialEnv || process.env,
TURBOPACK: process.env.TURBOPACK,
NEXT_PRIVATE_WORKER: "1"
}
});
child.on("message", (msg)=>{
if (msg && typeof msg === "object") {
if (msg.nextWorkerReady) {
child == null ? void 0 : child.send({
nextWorkerOptions: options
});
} else if (msg.nextServerReady && !resolved) {
resolved = true;
resolve();
}
}
});
child.on("exit", async (code, signal)=>{
if (sessionStopHandled || signal) {
return;
}
if (code === _setupserverworker.RESTART_EXIT_CODE) {
return startServer(options);
}
await handleSessionStop(signal);
});
});
}
const runDevServer = async (reboot)=>{
try {
if (!!args["--experimental-https"]) {
_log.warn("Self-signed certificates are currently an experimental feature, use at your own risk.");
let certificate;
if (args["--experimental-https-key"] && args["--experimental-https-cert"]) {
certificate = {
key: _path.default.resolve(args["--experimental-https-key"]),
cert: _path.default.resolve(args["--experimental-https-cert"])
};
} else {
certificate = await (0, _mkcert.createSelfSignedCertificate)(host);
}
await startServer({
...devServerOptions,
selfSignedCertificate: certificate
});
} else {
await startServer(devServerOptions);
}
await preflight(reboot);
} catch (err) {
console.error(err);
process.exit(1);
}
};
await (0, _trace.trace)("start-dev-server").traceAsyncFn(async (_)=>{
await runDevServer(false);
});
};
//# sourceMappingURL=next-dev.js.map

1
node_modules/next/dist/cli/next-dev.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/next/dist/cli/next-export-args.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import arg from 'next/dist/compiled/arg/index.js';
export declare const validArgs: arg.Spec;

23
node_modules/next/dist/cli/next-export-args.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "validArgs", {
enumerable: true,
get: function() {
return validArgs;
}
});
const validArgs = {
// Types
"--help": Boolean,
"--silent": Boolean,
"--outdir": String,
"--threads": Number,
// Aliases
"-h": "--help",
"-o": "--outdir",
"-s": "--silent"
};
//# sourceMappingURL=next-export-args.js.map

1
node_modules/next/dist/cli/next-export-args.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/cli/next-export-args.ts"],"names":["validArgs","Boolean","String","Number"],"mappings":";;;;+BAEaA;;;eAAAA;;;AAAN,MAAMA,YAAsB;IACjC,QAAQ;IACR,UAAUC;IACV,YAAYA;IACZ,YAAYC;IACZ,aAAaC;IAEb,UAAU;IACV,MAAM;IACN,MAAM;IACN,MAAM;AACR"}

4
node_modules/next/dist/cli/next-export.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env node
import { CliCommand } from '../lib/commands';
declare const nextExport: CliCommand;
export { nextExport };

116
node_modules/next/dist/cli/next-export.js generated vendored Normal file
View File

@@ -0,0 +1,116 @@
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "nextExport", {
enumerable: true,
get: function() {
return nextExport;
}
});
const _path = require("path");
const _fs = require("fs");
const _chalk = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/chalk"));
const _export = /*#__PURE__*/ _interop_require_wildcard(require("../export"));
const _log = /*#__PURE__*/ _interop_require_wildcard(require("../build/output/log"));
const _utils = require("../server/lib/utils");
const _trace = require("../trace");
const _getprojectdir = require("../lib/get-project-dir");
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 = {};
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;
}
const nextExport = (args)=>{
const nextExportCliSpan = (0, _trace.trace)("next-export-cli");
if (args["--help"]) {
console.log(`
Description
[DEPRECATED] Exports a static version of the application for production deployment
Usage
$ next export [options] <dir>
<dir> represents the directory of the Next.js application.
If no directory is provided, the current directory will be used.
Options
--outdir, -o Set the output dir (defaults to 'out')
--silent, -s Do not print any messages to console
--threads Max number of threads to use
--help, -h List this help
The "next export" command is deprecated in favor of "output: export" in next.config.js
Learn more: ${_chalk.default.cyan("https://nextjs.org/docs/advanced-features/static-html-export")}
`);
process.exit(0);
}
const dir = (0, _getprojectdir.getProjectDir)(args._[0]);
// Check if pages dir exists and warn if not
if (!(0, _fs.existsSync)(dir)) {
(0, _utils.printAndExit)(`> No such directory exists as the project root: ${dir}`);
}
const options = {
silent: args["--silent"] || false,
threads: args["--threads"],
outdir: args["--outdir"] ? (0, _path.resolve)(args["--outdir"]) : (0, _path.join)(dir, "out"),
hasOutdirFromCli: Boolean(args["--outdir"]),
isInvokedFromCli: true,
hasAppDir: false,
buildExport: false
};
(0, _export.default)(dir, options, nextExportCliSpan).then(()=>{
nextExportCliSpan.stop();
(0, _utils.printAndExit)(`Export successful. Files written to ${options.outdir}`, 0);
}).catch((err)=>{
nextExportCliSpan.stop();
if (err instanceof _export.ExportError || err.code === "NEXT_EXPORT_ERROR") {
_log.error(err.message);
} else {
console.error(err);
}
process.exit(1);
});
};
//# sourceMappingURL=next-export.js.map

1
node_modules/next/dist/cli/next-export.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/cli/next-export.ts"],"names":["nextExport","args","nextExportCliSpan","trace","console","log","chalk","cyan","process","exit","dir","getProjectDir","_","existsSync","printAndExit","options","silent","threads","outdir","resolve","join","hasOutdirFromCli","Boolean","isInvokedFromCli","hasAppDir","buildExport","exportApp","then","stop","catch","err","ExportError","code","Log","error","message"],"mappings":";;;;;+BAuESA;;;eAAAA;;;sBAtEqB;oBACH;8DACT;gEACoC;6DACjC;uBACQ;uBAEP;+BACQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9B,MAAMA,aAAyB,CAACC;IAC9B,MAAMC,oBAAoBC,IAAAA,YAAK,EAAC;IAChC,IAAIF,IAAI,CAAC,SAAS,EAAE;QAClBG,QAAQC,GAAG,CAAC,CAAC;;;;;;;;;;;;;;;;;kBAiBC,EAAEC,cAAK,CAACC,IAAI,CACtB,gEACA;IACJ,CAAC;QACDC,QAAQC,IAAI,CAAC;IACf;IAEA,MAAMC,MAAMC,IAAAA,4BAAa,EAACV,KAAKW,CAAC,CAAC,EAAE;IAEnC,4CAA4C;IAC5C,IAAI,CAACC,IAAAA,cAAU,EAACH,MAAM;QACpBI,IAAAA,mBAAY,EAAC,CAAC,gDAAgD,EAAEJ,IAAI,CAAC;IACvE;IAEA,MAAMK,UAAyB;QAC7BC,QAAQf,IAAI,CAAC,WAAW,IAAI;QAC5BgB,SAAShB,IAAI,CAAC,YAAY;QAC1BiB,QAAQjB,IAAI,CAAC,WAAW,GAAGkB,IAAAA,aAAO,EAAClB,IAAI,CAAC,WAAW,IAAImB,IAAAA,UAAI,EAACV,KAAK;QACjEW,kBAAkBC,QAAQrB,IAAI,CAAC,WAAW;QAC1CsB,kBAAkB;QAClBC,WAAW;QACXC,aAAa;IACf;IAEAC,IAAAA,eAAS,EAAChB,KAAKK,SAASb,mBACrByB,IAAI,CAAC;QACJzB,kBAAkB0B,IAAI;QACtBd,IAAAA,mBAAY,EAAC,CAAC,oCAAoC,EAAEC,QAAQG,MAAM,CAAC,CAAC,EAAE;IACxE,GACCW,KAAK,CAAC,CAACC;QACN5B,kBAAkB0B,IAAI;QACtB,IAAIE,eAAeC,mBAAW,IAAID,IAAIE,IAAI,KAAK,qBAAqB;YAClEC,KAAIC,KAAK,CAACJ,IAAIK,OAAO;QACvB,OAAO;YACL/B,QAAQ8B,KAAK,CAACJ;QAChB;QACAtB,QAAQC,IAAI,CAAC;IACf;AACJ"}

5
node_modules/next/dist/cli/next-info-args.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import arg from 'next/dist/compiled/arg/index.js';
/**
* Supported CLI arguments.
*/
export declare const validArgs: arg.Spec;

20
node_modules/next/dist/cli/next-info-args.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "validArgs", {
enumerable: true,
get: function() {
return validArgs;
}
});
const validArgs = {
// Types
"--help": Boolean,
// Aliases
"-h": "--help",
// Detailed diagnostics
"--verbose": Boolean
};
//# sourceMappingURL=next-info-args.js.map

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

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/cli/next-info-args.ts"],"names":["validArgs","Boolean"],"mappings":";;;;+BAKaA;;;eAAAA;;;AAAN,MAAMA,YAAsB;IACjC,QAAQ;IACR,UAAUC;IACV,UAAU;IACV,MAAM;IACN,uBAAuB;IACvB,aAAaA;AACf"}

9
node_modules/next/dist/cli/next-info.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env node
import { CliCommand } from '../lib/commands';
/**
* Runs few scripts to collect system information to help with debugging next.js installation issues.
* There are 2 modes, by default it collects basic next.js installation with runtime information. If
* `--verbose` mode is enabled it'll try to collect, verify more data for next-swc installation and others.
*/
declare const nextInfo: CliCommand;
export { nextInfo };

468
node_modules/next/dist/cli/next-info.js generated vendored Normal file
View File

@@ -0,0 +1,468 @@
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "nextInfo", {
enumerable: true,
get: function() {
return nextInfo;
}
});
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
const _child_process = /*#__PURE__*/ _interop_require_default(require("child_process"));
const _chalk = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/chalk"));
const _constants = require("../shared/lib/constants");
const _config = /*#__PURE__*/ _interop_require_default(require("../server/config"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const { fetch } = require("next/dist/compiled/undici");
const dir = process.cwd();
function getPackageVersion(packageName) {
try {
return require(`${packageName}/package.json`).version;
} catch {
return "N/A";
}
}
async function getNextConfig() {
const config = await (0, _config.default)(_constants.PHASE_INFO, dir);
return {
output: config.output ?? "N/A"
};
}
/**
* Returns the version of the specified binary, by supplying `--version` argument.
* N/A if it fails to run the binary.
*/ function getBinaryVersion(binaryName) {
try {
return _child_process.default.execFileSync(binaryName, [
"--version"
]).toString().trim();
} catch {
return "N/A";
}
}
function printHelp() {
console.log(`
Description
Prints relevant details about the current system which can be used to report Next.js bugs
Usage
$ next info
Options
--help, -h Displays this message
--verbose Collect additional information for debugging
Learn more: ${_chalk.default.cyan("https://nextjs.org/docs/api-reference/cli#info")}`);
}
/**
* Collect basic next.js installation information and print it to stdout.
*/ async function printDefaultInfo() {
const installedRelease = getPackageVersion("next");
const nextConfig = await getNextConfig();
console.log(`
Operating System:
Platform: ${_os.default.platform()}
Arch: ${_os.default.arch()}
Version: ${_os.default.version()}
Binaries:
Node: ${process.versions.node}
npm: ${getBinaryVersion("npm")}
Yarn: ${getBinaryVersion("yarn")}
pnpm: ${getBinaryVersion("pnpm")}
Relevant Packages:
next: ${installedRelease}
eslint-config-next: ${getPackageVersion("eslint-config-next")}
react: ${getPackageVersion("react")}
react-dom: ${getPackageVersion("react-dom")}
typescript: ${getPackageVersion("typescript")}
Next.js Config:
output: ${nextConfig.output}
`);
try {
const res = await fetch("https://api.github.com/repos/vercel/next.js/releases");
const releases = await res.json();
const newestRelease = releases[0].tag_name.replace(/^v/, "");
if (installedRelease !== newestRelease) {
console.warn(`${_chalk.default.yellow(_chalk.default.bold("warn"))} - Latest canary version not detected, detected: "${installedRelease}", newest: "${newestRelease}".
Please try the latest canary version (\`npm install next@canary\`) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue`);
}
} catch (e) {
console.warn(`${_chalk.default.yellow(_chalk.default.bold("warn"))} - Failed to fetch latest canary version. (Reason: ${e.message}.)
Detected "${installedRelease}". Visit https://github.com/vercel/next.js/releases.
Make sure to try the latest canary version (eg.: \`npm install next@canary\`) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue`);
}
}
/**
* Using system-installed tools per each platform, trying to read shared dependencies of next-swc.
* This is mainly for debugging DLOPEN failure.
*
* We don't / can't install these tools by ourselves, will skip the check if we can't find them.
*/ async function runSharedDependencyCheck(tools, skipMessage) {
var _getSupportedArchTriples_currentPlatform;
const currentPlatform = _os.default.platform();
const spawn = require("next/dist/compiled/cross-spawn");
const { getSupportedArchTriples } = require("../build/swc");
const triples = ((_getSupportedArchTriples_currentPlatform = getSupportedArchTriples()[currentPlatform]) == null ? void 0 : _getSupportedArchTriples_currentPlatform[_os.default.arch()]) ?? [];
// First, check if system have a tool installed. We can't install these by our own.
const availableTools = [];
for (const tool of tools){
try {
const check = spawn.sync(tool.bin, tool.checkArgs);
if (check.status === 0) {
availableTools.push(tool);
}
} catch {
// ignore if existence check fails
}
}
if (availableTools.length === 0) {
return {
messages: skipMessage,
result: "skipped"
};
}
const outputs = [];
let result = "fail";
for (const triple of triples){
const triplePkgName = `@next/swc-${triple.platformArchABI}`;
let resolved;
try {
resolved = require.resolve(triplePkgName);
} catch (e) {
return {
messages: "Cannot find next-swc installation, skipping dependencies check",
result: "skipped"
};
}
for (const tool of availableTools){
const proc = spawn(tool.bin, [
...tool.args,
resolved
]);
outputs.push(`Running ${tool.bin} ------------- `);
// Captures output, doesn't matter if it fails or not since we'll forward both to output.
const procPromise = new Promise((resolve)=>{
proc.stdout.on("data", function(data) {
outputs.push(data);
});
proc.stderr.on("data", function(data) {
outputs.push(data);
});
proc.on("close", (c)=>resolve(c));
});
let code = await procPromise;
if (code === 0) {
result = "pass";
}
}
}
return {
output: outputs.join("\n"),
result
};
}
/**
* Collect additional diagnostics information.
*/ async function printVerbose() {
const fs = require("fs");
const currentPlatform = _os.default.platform();
if (currentPlatform !== "win32" && currentPlatform !== "linux" && currentPlatform !== "darwin") {
console.log("Unsupported platform, only win32, linux, darwin are supported.");
return;
}
// List of tasks to run.
const tasks = [
{
title: "Host system information",
scripts: {
default: async ()=>{
// Node.js diagnostic report contains basic information, i.e OS version, CPU architecture, etc.
// Only collect few addtional details here.
const isWsl = require("next/dist/compiled/is-wsl");
const ciInfo = require("next/dist/compiled/ci-info");
const isDocker = require("next/dist/compiled/is-docker");
const output = `
WSL: ${isWsl}
Docker: ${isDocker()}
CI: ${ciInfo.isCI ? ciInfo.name || "unknown" : "false"}
`;
return {
output,
result: "pass"
};
}
}
},
{
title: "Next.js installation",
scripts: {
default: async ()=>{
const installedRelease = getPackageVersion("next");
const nextConfig = await getNextConfig();
const output = `
Binaries:
Node: ${process.versions.node}
npm: ${getBinaryVersion("npm")}
Yarn: ${getBinaryVersion("yarn")}
pnpm: ${getBinaryVersion("pnpm")}
Relevant Packages:
next: ${installedRelease}
eslint-config-next: ${getPackageVersion("eslint-config-next")}
react: ${getPackageVersion("react")}
react-dom: ${getPackageVersion("react-dom")}
typescript: ${getPackageVersion("typescript")}
Next.js Config:
output: ${nextConfig.output}
`;
return {
output,
result: "pass"
};
}
}
},
{
title: "Node.js diagnostic report",
scripts: {
default: async ()=>{
var _process_report;
const report = (_process_report = process.report) == null ? void 0 : _process_report.getReport();
if (!report) {
return {
messages: "Node.js diagnostic report is not available.",
result: "fail"
};
}
const { header, javascriptHeap, sharedObjects } = report;
// Delete some fields potentially containing sensitive information.
header == null ? true : delete header.cwd;
header == null ? true : delete header.commandLine;
header == null ? true : delete header.host;
header == null ? true : delete header.cpus;
header == null ? true : delete header.networkInterfaces;
const reportSummary = {
header,
javascriptHeap,
sharedObjects
};
return {
output: JSON.stringify(reportSummary, null, 2),
result: "pass"
};
}
}
},
{
title: "next-swc installation",
scripts: {
default: async ()=>{
var _platformArchTriples_currentPlatform;
const output = [];
// First, try to load next-swc via loadBindings.
try {
const { loadBindings } = require("../build/swc");
const bindings = await loadBindings();
// Run arbitary function to verify the bindings are loaded correctly.
const target = bindings.getTargetTriple();
// We think next-swc is installed correctly if getTargetTriple returns.
return {
output: `next-swc is installed correctly for ${target}`,
result: "pass"
};
} catch (e) {
output.push(`loadBindings() failed: ${e.message}`);
}
const { platformArchTriples } = require("next/dist/compiled/@napi-rs/triples");
const triples = (_platformArchTriples_currentPlatform = platformArchTriples[currentPlatform]) == null ? void 0 : _platformArchTriples_currentPlatform[_os.default.arch()];
if (!triples || triples.length === 0) {
return {
messages: `No target triples found for ${currentPlatform} / ${_os.default.arch()}`,
result: "fail"
};
}
// Trying to manually resolve corresponding target triples to see if bindings are physically located.
const path = require("path");
let fallbackBindingsDirectory;
try {
const nextPath = path.dirname(require.resolve("next/package.json"));
fallbackBindingsDirectory = path.join(nextPath, "next-swc-fallback");
} catch (e) {
// Not able to locate next package from current running location, skipping fallback bindings check.
}
const tryResolve = (pkgName)=>{
try {
const resolved = require.resolve(pkgName);
const fileExists = fs.existsSync(resolved);
let loadError;
let loadSuccess;
try {
loadSuccess = !!require(resolved).getTargetTriple();
} catch (e) {
loadError = e.message;
}
output.push(`${pkgName} exists: ${fileExists} for the triple ${loadSuccess}`);
if (loadError) {
output.push(`${pkgName} load failed: ${loadError ?? "unknown"}`);
}
if (loadSuccess) {
return true;
}
} catch (e) {
output.push(`${pkgName} resolve failed: ${e.message ?? "unknown"}`);
}
return false;
};
for (const triple of triples){
const triplePkgName = `@next/swc-${triple.platformArchABI}`;
// Check installed optional dependencies. This is the normal way package being installed.
// For the targets have multiple triples (gnu / musl), if any of them loads successfully, we consider as installed.
if (tryResolve(triplePkgName)) {
break;
}
// Check if fallback binaries are installed.
if (!fallbackBindingsDirectory) {
continue;
}
tryResolve(path.join(fallbackBindingsDirectory, triplePkgName));
}
return {
output: output.join("\n"),
result: "pass"
};
}
}
},
{
// For the simplicity, we only check the correctly installed optional dependencies -
// as this is mainly for checking DLOPEN failure. If user hit MODULE_NOT_FOUND,
// expect above next-swc installation would give some hint instead.
title: "next-swc shared object dependencies",
scripts: {
linux: async ()=>{
const skipMessage = "This diagnostics uses system-installed tools (ldd) to check next-swc dependencies, but it is not found. Skipping dependencies check.";
return await runSharedDependencyCheck([
{
bin: "ldd",
checkArgs: [
"--help"
],
args: [
"--verbose"
]
}
], skipMessage);
},
win32: async ()=>{
const skipMessage = `This diagnostics uses system-installed tools (dumpbin.exe) to check next-swc dependencies, but it was not found in the path. Skipping dependencies check.
dumpbin (https://learn.microsoft.com/en-us/cpp/build/reference/dumpbin-reference) is a part of Microsoft VC toolset,
can be installed with Windows SDK, Windows Build tools or Visual Studio.
Please make sure you have one of them installed and dumpbin.exe is in the path.
`;
return await runSharedDependencyCheck([
{
bin: "dumpbin.exe",
checkArgs: [
"/summary"
],
args: [
"/imports"
]
}
], skipMessage);
},
darwin: async ()=>{
const skipMessage = "This diagnostics uses system-installed tools (otools, dyld_info) to check next-swc dependencies, but none of them are found. Skipping dependencies check.";
return await runSharedDependencyCheck([
{
bin: "otool",
checkArgs: [
"--version"
],
args: [
"-L"
]
},
{
bin: "dyld_info",
checkArgs: [],
args: []
}
], skipMessage);
}
}
}
];
// Collected output after running all tasks.
const report = [];
console.log("\n");
for (const task of tasks){
if (task.targetPlatform && task.targetPlatform !== currentPlatform) {
report.push({
title: task.title,
result: {
messages: undefined,
output: `[SKIPPED (${_os.default.platform()} / ${task.targetPlatform})] ${task.title}`,
result: "skipped"
}
});
continue;
}
const taskScript = task.scripts[currentPlatform] ?? task.scripts.default;
let taskResult;
try {
taskResult = await taskScript();
} catch (e) {
taskResult = {
messages: `Unexpected failure while running diagnostics: ${e.message}`,
result: "fail"
};
}
console.log(`- ${task.title}: ${taskResult.result}`);
if (taskResult.messages) {
console.log(` ${taskResult.messages}`);
}
report.push({
title: task.title,
result: taskResult
});
}
console.log(`\n${_chalk.default.bold("Generated diagnostics report")}`);
console.log(`\nPlease copy below report and paste it into your issue.`);
for (const { title, result } of report){
console.log(`\n### ${title}`);
if (result.messages) {
console.log(result.messages);
}
if (result.output) {
console.log(result.output);
}
}
}
/**
* Runs few scripts to collect system information to help with debugging next.js installation issues.
* There are 2 modes, by default it collects basic next.js installation with runtime information. If
* `--verbose` mode is enabled it'll try to collect, verify more data for next-swc installation and others.
*/ const nextInfo = async (args)=>{
if (args["--help"]) {
printHelp();
return;
}
if (!args["--verbose"]) {
await printDefaultInfo();
} else {
await printVerbose();
}
};
//# sourceMappingURL=next-info.js.map

1
node_modules/next/dist/cli/next-info.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/next/dist/cli/next-lint-args.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import arg from 'next/dist/compiled/arg/index.js';
export declare const validArgs: arg.Spec;

61
node_modules/next/dist/cli/next-lint-args.js generated vendored Normal file
View File

@@ -0,0 +1,61 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "validArgs", {
enumerable: true,
get: function() {
return validArgs;
}
});
const validEslintArgs = {
// Types
"--config": String,
"--ext": [
String
],
"--resolve-plugins-relative-to": String,
"--rulesdir": [
String
],
"--fix": Boolean,
"--fix-type": [
String
],
"--ignore-path": String,
"--no-ignore": Boolean,
"--quiet": Boolean,
"--max-warnings": Number,
"--no-inline-config": Boolean,
"--report-unused-disable-directives": String,
"--cache": Boolean,
"--no-cache": Boolean,
"--cache-location": String,
"--cache-strategy": String,
"--error-on-unmatched-pattern": Boolean,
"--format": String,
"--output-file": String,
// Aliases
"-c": "--config",
"-f": "--format",
"-o": "--output-file"
};
const validArgs = {
// Types
"--help": Boolean,
"--base-dir": String,
"--dir": [
String
],
"--file": [
String
],
"--strict": Boolean,
// Aliases
"-h": "--help",
"-b": "--base-dir",
"-d": "--dir",
...validEslintArgs
};
//# sourceMappingURL=next-lint-args.js.map

1
node_modules/next/dist/cli/next-lint-args.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/cli/next-lint-args.ts"],"names":["validArgs","validEslintArgs","String","Boolean","Number"],"mappings":";;;;+BA8BaA;;;eAAAA;;;AA5Bb,MAAMC,kBAA4B;IAChC,QAAQ;IACR,YAAYC;IACZ,SAAS;QAACA;KAAO;IACjB,iCAAiCA;IACjC,cAAc;QAACA;KAAO;IACtB,SAASC;IACT,cAAc;QAACD;KAAO;IACtB,iBAAiBA;IACjB,eAAeC;IACf,WAAWA;IACX,kBAAkBC;IAClB,sBAAsBD;IACtB,sCAAsCD;IACtC,WAAWC;IACX,cAAcA;IACd,oBAAoBD;IACpB,oBAAoBA;IACpB,gCAAgCC;IAChC,YAAYD;IACZ,iBAAiBA;IAEjB,UAAU;IACV,MAAM;IACN,MAAM;IACN,MAAM;AACR;AAEO,MAAMF,YAAsB;IACjC,QAAQ;IACR,UAAUG;IACV,cAAcD;IACd,SAAS;QAACA;KAAO;IACjB,UAAU;QAACA;KAAO;IAClB,YAAYC;IAEZ,UAAU;IACV,MAAM;IACN,MAAM;IACN,MAAM;IACN,GAAGF,eAAe;AACpB"}

4
node_modules/next/dist/cli/next-lint.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env node
import { CliCommand } from '../lib/commands';
declare const nextLint: CliCommand;
export { nextLint };

186
node_modules/next/dist/cli/next-lint.js generated vendored Normal file
View File

@@ -0,0 +1,186 @@
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "nextLint", {
enumerable: true,
get: function() {
return nextLint;
}
});
const _fs = require("fs");
const _path = require("path");
const _chalk = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/chalk"));
const _constants = require("../lib/constants");
const _runLintCheck = require("../lib/eslint/runLintCheck");
const _utils = require("../server/lib/utils");
const _storage = require("../telemetry/storage");
const _config = /*#__PURE__*/ _interop_require_default(require("../server/config"));
const _constants1 = require("../shared/lib/constants");
const _events = require("../telemetry/events");
const _compileerror = require("../lib/compile-error");
const _getprojectdir = require("../lib/get-project-dir");
const _findpagesdir = require("../lib/find-pages-dir");
const _verifyTypeScriptSetup = require("../lib/verifyTypeScriptSetup");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const eslintOptions = (args, defaultCacheLocation)=>({
overrideConfigFile: args["--config"] || null,
extensions: args["--ext"] ?? [
".js",
".mjs",
".cjs",
".jsx",
".ts",
".mts",
".cts",
".tsx"
],
resolvePluginsRelativeTo: args["--resolve-plugins-relative-to"] || null,
rulePaths: args["--rulesdir"] ?? [],
fix: args["--fix"] ?? false,
fixTypes: args["--fix-type"] ?? null,
ignorePath: args["--ignore-path"] || null,
ignore: !Boolean(args["--no-ignore"]),
allowInlineConfig: !Boolean(args["--no-inline-config"]),
reportUnusedDisableDirectives: args["--report-unused-disable-directives"] || null,
cache: !Boolean(args["--no-cache"]),
cacheLocation: args["--cache-location"] || defaultCacheLocation,
cacheStrategy: args["--cache-strategy"] || "metadata",
errorOnUnmatchedPattern: args["--error-on-unmatched-pattern"] ? Boolean(args["--error-on-unmatched-pattern"]) : false
});
const nextLint = async (args)=>{
var _nextConfig_eslint;
if (args["--help"]) {
(0, _utils.printAndExit)(`
Description
Run ESLint on every file in specified directories.
If not configured, ESLint will be set up for the first time.
Usage
$ next lint <baseDir> [options]
<baseDir> represents the directory of the Next.js application.
If no directory is provided, the current directory will be used.
Options
Basic configuration:
-h, --help List this help
-d, --dir Array Include directory, or directories, to run ESLint - default: 'pages', 'components', and 'lib'
--file Array Include file, or files, to run ESLint
-c, --config path::String Use this configuration file, overriding all other config options
--ext [String] Specify JavaScript file extensions - default: .js, .mjs, .cjs, .jsx, .ts, .mts, .cts, .tsx
--resolve-plugins-relative-to path::String A folder where plugins should be resolved from, CWD by default
Initial setup:
--strict Creates an .eslintrc.json file using the Next.js strict configuration (only possible if no .eslintrc.json file is present)
Specifying rules:
--rulesdir [path::String] Use additional rules from this directory
Fixing problems:
--fix Automatically fix problems
--fix-type Array Specify the types of fixes to apply (problem, suggestion, layout)
Ignoring files:
--ignore-path path::String Specify path of ignore file
--no-ignore Disable use of ignore files and patterns
Handling warnings:
--quiet Report errors only - default: false
--max-warnings Int Number of warnings to trigger nonzero exit code - default: -1
Output:
-o, --output-file path::String Specify file to write report to
-f, --format String Use a specific output format - default: Next.js custom formatter
Inline configuration comments:
--no-inline-config Prevent comments from changing config or rules
--report-unused-disable-directives Adds reported errors for unused eslint-disable directives ("error" | "warn" | "off")
Caching:
--no-cache Disable caching
--cache-location path::String Path to the cache file or directory - default: .eslintcache
--cache-strategy String Strategy to use for detecting changed files in the cache, either metadata or content - default: metadata
Miscellaneous:
--error-on-unmatched-pattern Show errors when any file patterns are unmatched - default: false
`, 0);
}
const baseDir = (0, _getprojectdir.getProjectDir)(args._[0]);
// Check if the provided directory exists
if (!(0, _fs.existsSync)(baseDir)) {
(0, _utils.printAndExit)(`> No such directory exists as the project root: ${baseDir}`);
}
const nextConfig = await (0, _config.default)(_constants1.PHASE_PRODUCTION_BUILD, baseDir);
const files = args["--file"] ?? [];
const dirs = args["--dir"] ?? ((_nextConfig_eslint = nextConfig.eslint) == null ? void 0 : _nextConfig_eslint.dirs);
const filesToLint = [
...dirs ?? [],
...files
];
const pathsToLint = (filesToLint.length ? filesToLint : _constants.ESLINT_DEFAULT_DIRS).reduce((res, d)=>{
const currDir = (0, _path.join)(baseDir, d);
if (!(0, _fs.existsSync)(currDir)) return res;
res.push(currDir);
return res;
}, []);
const reportErrorsOnly = Boolean(args["--quiet"]);
const maxWarnings = args["--max-warnings"] ?? -1;
const formatter = args["--format"] || null;
const strict = Boolean(args["--strict"]);
const outputFile = args["--output-file"] || null;
const distDir = (0, _path.join)(baseDir, nextConfig.distDir);
const defaultCacheLocation = (0, _path.join)(distDir, "cache", "eslint/");
const { pagesDir, appDir } = (0, _findpagesdir.findPagesDir)(baseDir);
await (0, _verifyTypeScriptSetup.verifyTypeScriptSetup)({
dir: baseDir,
distDir: nextConfig.distDir,
intentDirs: [
pagesDir,
appDir
].filter(Boolean),
typeCheckPreflight: false,
tsconfigPath: nextConfig.typescript.tsconfigPath,
disableStaticImages: nextConfig.images.disableStaticImages,
hasAppDir: !!appDir,
hasPagesDir: !!pagesDir
});
(0, _runLintCheck.runLintCheck)(baseDir, pathsToLint, {
lintDuringBuild: false,
eslintOptions: eslintOptions(args, defaultCacheLocation),
reportErrorsOnly: reportErrorsOnly,
maxWarnings,
formatter,
outputFile,
strict
}).then(async (lintResults)=>{
const lintOutput = typeof lintResults === "string" ? lintResults : lintResults == null ? void 0 : lintResults.output;
if (typeof lintResults !== "string" && (lintResults == null ? void 0 : lintResults.eventInfo)) {
const telemetry = new _storage.Telemetry({
distDir
});
telemetry.record((0, _events.eventLintCheckCompleted)({
...lintResults.eventInfo,
buildLint: false
}));
await telemetry.flush();
}
if (typeof lintResults !== "string" && (lintResults == null ? void 0 : lintResults.isError) && lintOutput) {
throw new _compileerror.CompileError(lintOutput);
}
if (lintOutput) {
(0, _utils.printAndExit)(lintOutput, 0);
} else if (lintResults && !lintOutput) {
(0, _utils.printAndExit)(_chalk.default.green("✔ No ESLint warnings or errors"), 0);
}
}).catch((err)=>{
(0, _utils.printAndExit)(err.message);
});
};
//# sourceMappingURL=next-lint.js.map

1
node_modules/next/dist/cli/next-lint.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/cli/next-lint.ts"],"names":["nextLint","eslintOptions","args","defaultCacheLocation","overrideConfigFile","extensions","resolvePluginsRelativeTo","rulePaths","fix","fixTypes","ignorePath","ignore","Boolean","allowInlineConfig","reportUnusedDisableDirectives","cache","cacheLocation","cacheStrategy","errorOnUnmatchedPattern","nextConfig","printAndExit","baseDir","getProjectDir","_","existsSync","loadConfig","PHASE_PRODUCTION_BUILD","files","dirs","eslint","filesToLint","pathsToLint","length","ESLINT_DEFAULT_DIRS","reduce","res","d","currDir","join","push","reportErrorsOnly","maxWarnings","formatter","strict","outputFile","distDir","pagesDir","appDir","findPagesDir","verifyTypeScriptSetup","dir","intentDirs","filter","typeCheckPreflight","tsconfigPath","typescript","disableStaticImages","images","hasAppDir","hasPagesDir","runLintCheck","lintDuringBuild","then","lintResults","lintOutput","output","eventInfo","telemetry","Telemetry","record","eventLintCheckCompleted","buildLint","flush","isError","CompileError","chalk","green","catch","err","message"],"mappings":"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"}

2
node_modules/next/dist/cli/next-start-args.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import arg from 'next/dist/compiled/arg/index.js';
export declare const validArgs: arg.Spec;

24
node_modules/next/dist/cli/next-start-args.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "validArgs", {
enumerable: true,
get: function() {
return validArgs;
}
});
const validArgs = {
// Types
"--help": Boolean,
"--port": Number,
"--hostname": String,
"--keepAliveTimeout": Number,
"--experimental-test-proxy": Boolean,
// Aliases
"-h": "--help",
"-p": "--port",
"-H": "--hostname"
};
//# sourceMappingURL=next-start-args.js.map

1
node_modules/next/dist/cli/next-start-args.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/cli/next-start-args.ts"],"names":["validArgs","Boolean","Number","String"],"mappings":";;;;+BAEaA;;;eAAAA;;;AAAN,MAAMA,YAAsB;IACjC,QAAQ;IACR,UAAUC;IACV,UAAUC;IACV,cAAcC;IACd,sBAAsBD;IACtB,6BAA6BD;IAE7B,UAAU;IACV,MAAM;IACN,MAAM;IACN,MAAM;AACR"}

5
node_modules/next/dist/cli/next-start.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env node
import '../server/lib/cpu-profile';
import { CliCommand } from '../lib/commands';
declare const nextStart: CliCommand;
export { nextStart };

60
node_modules/next/dist/cli/next-start.js generated vendored Normal file
View File

@@ -0,0 +1,60 @@
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "nextStart", {
enumerable: true,
get: function() {
return nextStart;
}
});
require("../server/lib/cpu-profile");
const _startserver = require("../server/lib/start-server");
const _utils = require("../server/lib/utils");
const _getprojectdir = require("../lib/get-project-dir");
const _getreservedport = require("../lib/helpers/get-reserved-port");
const nextStart = async (args)=>{
if (args["--help"]) {
console.log(`
Description
Starts the application in production mode.
The application should be compiled with \`next build\` first.
Usage
$ next start <dir> -p <port>
<dir> represents the directory of the Next.js application.
If no directory is provided, the current directory will be used.
Options
--port, -p A port number on which to start the application
--hostname, -H Hostname on which to start the application (default: 0.0.0.0)
--keepAliveTimeout Max milliseconds to wait before closing inactive connections
--help, -h Displays this message
`);
process.exit(0);
}
const dir = (0, _getprojectdir.getProjectDir)(args._[0]);
const host = args["--hostname"];
const port = (0, _utils.getPort)(args);
if ((0, _getreservedport.isPortIsReserved)(port)) {
(0, _utils.printAndExit)((0, _getreservedport.getReservedPortExplanation)(port), 1);
}
const isExperimentalTestProxy = args["--experimental-test-proxy"];
const keepAliveTimeoutArg = args["--keepAliveTimeout"];
if (typeof keepAliveTimeoutArg !== "undefined" && (Number.isNaN(keepAliveTimeoutArg) || !Number.isFinite(keepAliveTimeoutArg) || keepAliveTimeoutArg < 0)) {
(0, _utils.printAndExit)(`Invalid --keepAliveTimeout, expected a non negative number but received "${keepAliveTimeoutArg}"`, 1);
}
const keepAliveTimeout = keepAliveTimeoutArg ? Math.ceil(keepAliveTimeoutArg) : undefined;
await (0, _startserver.startServer)({
dir,
isDev: false,
isExperimentalTestProxy,
hostname: host,
port,
keepAliveTimeout
});
};
//# sourceMappingURL=next-start.js.map

1
node_modules/next/dist/cli/next-start.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/cli/next-start.ts"],"names":["nextStart","args","console","log","process","exit","dir","getProjectDir","_","host","port","getPort","isPortIsReserved","printAndExit","getReservedPortExplanation","isExperimentalTestProxy","keepAliveTimeoutArg","Number","isNaN","isFinite","keepAliveTimeout","Math","ceil","undefined","startServer","isDev","hostname"],"mappings":";;;;;+BAuESA;;;eAAAA;;;QArEF;6BACqB;uBACU;+BACR;iCAKvB;AAEP,MAAMA,YAAwB,OAAOC;IACnC,IAAIA,IAAI,CAAC,SAAS,EAAE;QAClBC,QAAQC,GAAG,CAAC,CAAC;;;;;;;;;;;;;;;;IAgBb,CAAC;QACDC,QAAQC,IAAI,CAAC;IACf;IAEA,MAAMC,MAAMC,IAAAA,4BAAa,EAACN,KAAKO,CAAC,CAAC,EAAE;IACnC,MAAMC,OAAOR,IAAI,CAAC,aAAa;IAC/B,MAAMS,OAAOC,IAAAA,cAAO,EAACV;IAErB,IAAIW,IAAAA,iCAAgB,EAACF,OAAO;QAC1BG,IAAAA,mBAAY,EAACC,IAAAA,2CAA0B,EAACJ,OAAO;IACjD;IAEA,MAAMK,0BAA0Bd,IAAI,CAAC,4BAA4B;IAEjE,MAAMe,sBAA0Cf,IAAI,CAAC,qBAAqB;IAC1E,IACE,OAAOe,wBAAwB,eAC9BC,CAAAA,OAAOC,KAAK,CAACF,wBACZ,CAACC,OAAOE,QAAQ,CAACH,wBACjBA,sBAAsB,CAAA,GACxB;QACAH,IAAAA,mBAAY,EACV,CAAC,yEAAyE,EAAEG,oBAAoB,CAAC,CAAC,EAClG;IAEJ;IAEA,MAAMI,mBAAmBJ,sBACrBK,KAAKC,IAAI,CAACN,uBACVO;IAEJ,MAAMC,IAAAA,wBAAW,EAAC;QAChBlB;QACAmB,OAAO;QACPV;QACAW,UAAUjB;QACVC;QACAU;IACF;AACF"}

2
node_modules/next/dist/cli/next-telemetry-args.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import arg from 'next/dist/compiled/arg/index.js';
export declare const validArgs: arg.Spec;

20
node_modules/next/dist/cli/next-telemetry-args.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "validArgs", {
enumerable: true,
get: function() {
return validArgs;
}
});
const validArgs = {
// Types
"--enable": Boolean,
"--disable": Boolean,
"--help": Boolean,
// Aliases
"-h": "--help"
};
//# sourceMappingURL=next-telemetry-args.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/cli/next-telemetry-args.ts"],"names":["validArgs","Boolean"],"mappings":";;;;+BAEaA;;;eAAAA;;;AAAN,MAAMA,YAAsB;IACjC,QAAQ;IACR,YAAYC;IACZ,aAAaA;IACb,UAAUA;IACV,UAAU;IACV,MAAM;AACR"}

4
node_modules/next/dist/cli/next-telemetry.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env node
import { CliCommand } from '../lib/commands';
declare const nextTelemetry: CliCommand;
export { nextTelemetry };

73
node_modules/next/dist/cli/next-telemetry.js generated vendored Normal file
View File

@@ -0,0 +1,73 @@
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "nextTelemetry", {
enumerable: true,
get: function() {
return nextTelemetry;
}
});
const _chalk = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/chalk"));
const _storage = require("../telemetry/storage");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const nextTelemetry = (args)=>{
if (args["--help"]) {
console.log(`
Description
Allows you to control Next.js' telemetry collection
Usage
$ next telemetry [enable/disable]
You may pass the 'enable' or 'disable' argument to turn Next.js' telemetry collection on or off.
Options
--enable Enables Next.js' telemetry collection
--disable Disables Next.js' telemetry collection
--help, -h Displays this message
Learn more: ${_chalk.default.cyan("https://nextjs.org/telemetry")}
`);
return;
}
const telemetry = new _storage.Telemetry({
distDir: process.cwd()
});
let isEnabled = telemetry.isEnabled;
if (args["--enable"] || args._[0] === "enable") {
telemetry.setEnabled(true);
console.log(_chalk.default.cyan("Success!"));
console.log();
isEnabled = true;
} else if (args["--disable"] || args._[0] === "disable") {
const path = telemetry.setEnabled(false);
if (isEnabled) {
console.log(_chalk.default.cyan(`Your preference has been saved${path ? ` to ${path}` : ""}.`));
} else {
console.log(_chalk.default.yellow(`Next.js' telemetry collection is already disabled.`));
}
console.log();
isEnabled = false;
} else {
console.log(_chalk.default.bold("Next.js Telemetry"));
console.log();
}
console.log(`Status: ${isEnabled ? _chalk.default.bold.green("Enabled") : _chalk.default.bold.red("Disabled")}`);
console.log();
if (isEnabled) {
console.log(`Next.js telemetry is completely anonymous. Thank you for participating!`);
} else {
console.log(`You have opted-out of Next.js' anonymous telemetry program.`);
console.log(`No data will be collected from your machine.`);
}
console.log(`Learn more: https://nextjs.org/telemetry`);
console.log();
};
//# sourceMappingURL=next-telemetry.js.map

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

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/cli/next-telemetry.ts"],"names":["nextTelemetry","args","console","log","chalk","cyan","telemetry","Telemetry","distDir","process","cwd","isEnabled","_","setEnabled","path","yellow","bold","green","red"],"mappings":";;;;;+BA+ESA;;;eAAAA;;;8DA9ES;yBAEQ;;;;;;AAE1B,MAAMA,gBAA4B,CAACC;IACjC,IAAIA,IAAI,CAAC,SAAS,EAAE;QAClBC,QAAQC,GAAG,CACT,CAAC;;;;;;;;;;;;;;kBAcW,EAAEC,cAAK,CAACC,IAAI,CAAC,gCAAgC;IAC3D,CAAC;QAED;IACF;IAEA,MAAMC,YAAY,IAAIC,kBAAS,CAAC;QAAEC,SAASC,QAAQC,GAAG;IAAG;IAEzD,IAAIC,YAAYL,UAAUK,SAAS;IAEnC,IAAIV,IAAI,CAAC,WAAW,IAAIA,KAAKW,CAAC,CAAC,EAAE,KAAK,UAAU;QAC9CN,UAAUO,UAAU,CAAC;QACrBX,QAAQC,GAAG,CAACC,cAAK,CAACC,IAAI,CAAC;QACvBH,QAAQC,GAAG;QAEXQ,YAAY;IACd,OAAO,IAAIV,IAAI,CAAC,YAAY,IAAIA,KAAKW,CAAC,CAAC,EAAE,KAAK,WAAW;QACvD,MAAME,OAAOR,UAAUO,UAAU,CAAC;QAClC,IAAIF,WAAW;YACbT,QAAQC,GAAG,CACTC,cAAK,CAACC,IAAI,CACR,CAAC,8BAA8B,EAAES,OAAO,CAAC,IAAI,EAAEA,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;QAGnE,OAAO;YACLZ,QAAQC,GAAG,CACTC,cAAK,CAACW,MAAM,CAAC,CAAC,kDAAkD,CAAC;QAErE;QACAb,QAAQC,GAAG;QAEXQ,YAAY;IACd,OAAO;QACLT,QAAQC,GAAG,CAACC,cAAK,CAACY,IAAI,CAAC;QACvBd,QAAQC,GAAG;IACb;IAEAD,QAAQC,GAAG,CACT,CAAC,QAAQ,EACPQ,YAAYP,cAAK,CAACY,IAAI,CAACC,KAAK,CAAC,aAAab,cAAK,CAACY,IAAI,CAACE,GAAG,CAAC,YAC1D,CAAC;IAEJhB,QAAQC,GAAG;IAEX,IAAIQ,WAAW;QACbT,QAAQC,GAAG,CACT,CAAC,uEAAuE,CAAC;IAE7E,OAAO;QACLD,QAAQC,GAAG,CAAC,CAAC,2DAA2D,CAAC;QACzED,QAAQC,GAAG,CAAC,CAAC,4CAA4C,CAAC;IAC5D;IAEAD,QAAQC,GAAG,CAAC,CAAC,wCAAwC,CAAC;IACtDD,QAAQC,GAAG;AACb"}