Initial boiler plate project
This commit is contained in:
14
node_modules/next/dist/cli/next-build.d.ts
generated
vendored
Normal file
14
node_modules/next/dist/cli/next-build.d.ts
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env node
|
||||
import '../server/lib/cpu-profile';
|
||||
type NextBuildOptions = {
|
||||
debug?: boolean;
|
||||
profile?: boolean;
|
||||
lint: boolean;
|
||||
mangling: boolean;
|
||||
experimentalDebugMemoryUsage: boolean;
|
||||
experimentalAppOnly?: boolean;
|
||||
experimentalTurbo?: boolean;
|
||||
experimentalBuildMode: 'default' | 'compile' | 'generate';
|
||||
};
|
||||
declare const nextBuild: (options: NextBuildOptions, directory?: string) => Promise<void>;
|
||||
export { nextBuild };
|
||||
70
node_modules/next/dist/cli/next-build.js
generated
vendored
Normal file
70
node_modules/next/dist/cli/next-build.js
generated
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
#!/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 _picocolors = require("../lib/picocolors");
|
||||
const _build = /*#__PURE__*/ _interop_require_default(require("../build"));
|
||||
const _log = require("../build/output/log");
|
||||
const _utils = require("../server/lib/utils");
|
||||
const _iserror = /*#__PURE__*/ _interop_require_default(require("../lib/is-error"));
|
||||
const _getprojectdir = require("../lib/get-project-dir");
|
||||
const _startup = require("../lib/memory/startup");
|
||||
const _shutdown = require("../lib/memory/shutdown");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
const nextBuild = (options, directory)=>{
|
||||
process.on("SIGTERM", ()=>process.exit(0));
|
||||
process.on("SIGINT", ()=>process.exit(0));
|
||||
const { debug, experimentalDebugMemoryUsage, profile, lint, mangling, experimentalAppOnly, experimentalTurbo, experimentalBuildMode } = options;
|
||||
if (!lint) {
|
||||
(0, _log.warn)("Linting is disabled.");
|
||||
}
|
||||
if (!mangling) {
|
||||
(0, _log.warn)("Mangling is disabled. Note: This may affect performance and should only be used for debugging purposes.");
|
||||
}
|
||||
if (profile) {
|
||||
(0, _log.warn)(`Profiling is enabled. ${(0, _picocolors.italic)("Note: This may affect performance.")}`);
|
||||
}
|
||||
if (experimentalDebugMemoryUsage) {
|
||||
process.env.EXPERIMENTAL_DEBUG_MEMORY_USAGE = "1";
|
||||
(0, _startup.enableMemoryDebuggingMode)();
|
||||
}
|
||||
const dir = (0, _getprojectdir.getProjectDir)(directory);
|
||||
// Check if the provided directory exists
|
||||
if (!(0, _fs.existsSync)(dir)) {
|
||||
(0, _utils.printAndExit)(`> No such directory exists as the project root: ${dir}`);
|
||||
}
|
||||
if (experimentalTurbo) {
|
||||
process.env.TURBOPACK = "1";
|
||||
}
|
||||
return (0, _build.default)(dir, profile, debug || Boolean(process.env.NEXT_DEBUG_BUILD), lint, !mangling, experimentalAppOnly, !!process.env.TURBOPACK, experimentalBuildMode).catch((err)=>{
|
||||
if (experimentalDebugMemoryUsage) {
|
||||
(0, _shutdown.disableMemoryDebuggingMode)();
|
||||
}
|
||||
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);
|
||||
}
|
||||
}).finally(()=>{
|
||||
if (experimentalDebugMemoryUsage) {
|
||||
(0, _shutdown.disableMemoryDebuggingMode)();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//# sourceMappingURL=next-build.js.map
|
||||
1
node_modules/next/dist/cli/next-build.js.map
generated
vendored
Normal file
1
node_modules/next/dist/cli/next-build.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/cli/next-build.ts"],"names":["nextBuild","options","directory","process","on","exit","debug","experimentalDebugMemoryUsage","profile","lint","mangling","experimentalAppOnly","experimentalTurbo","experimentalBuildMode","warn","italic","env","EXPERIMENTAL_DEBUG_MEMORY_USAGE","enableMemoryDebuggingMode","dir","getProjectDir","existsSync","printAndExit","TURBOPACK","build","Boolean","NEXT_DEBUG_BUILD","catch","err","disableMemoryDebuggingMode","console","error","isError","code","message","finally"],"mappings":";;;;;+BA4GSA;;;eAAAA;;;QA1GF;oBACoB;4BACJ;8DACL;qBACG;uBACQ;gEACT;+BACU;yBACY;0BACC;;;;;;AAa3C,MAAMA,YAAY,CAACC,SAA2BC;IAC5CC,QAAQC,EAAE,CAAC,WAAW,IAAMD,QAAQE,IAAI,CAAC;IACzCF,QAAQC,EAAE,CAAC,UAAU,IAAMD,QAAQE,IAAI,CAAC;IAExC,MAAM,EACJC,KAAK,EACLC,4BAA4B,EAC5BC,OAAO,EACPC,IAAI,EACJC,QAAQ,EACRC,mBAAmB,EACnBC,iBAAiB,EACjBC,qBAAqB,EACtB,GAAGZ;IAEJ,IAAI,CAACQ,MAAM;QACTK,IAAAA,SAAI,EAAC;IACP;IAEA,IAAI,CAACJ,UAAU;QACbI,IAAAA,SAAI,EACF;IAEJ;IAEA,IAAIN,SAAS;QACXM,IAAAA,SAAI,EACF,CAAC,sBAAsB,EAAEC,IAAAA,kBAAM,EAAC,sCAAsC,CAAC;IAE3E;IAEA,IAAIR,8BAA8B;QAChCJ,QAAQa,GAAG,CAACC,+BAA+B,GAAG;QAC9CC,IAAAA,kCAAyB;IAC3B;IAEA,MAAMC,MAAMC,IAAAA,4BAAa,EAAClB;IAE1B,yCAAyC;IACzC,IAAI,CAACmB,IAAAA,cAAU,EAACF,MAAM;QACpBG,IAAAA,mBAAY,EAAC,CAAC,gDAAgD,EAAEH,IAAI,CAAC;IACvE;IAEA,IAAIP,mBAAmB;QACrBT,QAAQa,GAAG,CAACO,SAAS,GAAG;IAC1B;IAEA,OAAOC,IAAAA,cAAK,EACVL,KACAX,SACAF,SAASmB,QAAQtB,QAAQa,GAAG,CAACU,gBAAgB,GAC7CjB,MACA,CAACC,UACDC,qBACA,CAAC,CAACR,QAAQa,GAAG,CAACO,SAAS,EACvBV,uBAECc,KAAK,CAAC,CAACC;QACN,IAAIrB,8BAA8B;YAChCsB,IAAAA,oCAA0B;QAC5B;QACAC,QAAQC,KAAK,CAAC;QACd,IACEC,IAAAA,gBAAO,EAACJ,QACPA,CAAAA,IAAIK,IAAI,KAAK,2BACZL,IAAIK,IAAI,KAAK,oBACbL,IAAIK,IAAI,KAAK,+BACbL,IAAIK,IAAI,KAAK,uBACbL,IAAIK,IAAI,KAAK,6BACbL,IAAIK,IAAI,KAAK,8BAA6B,GAC5C;YACAX,IAAAA,mBAAY,EAAC,CAAC,EAAE,EAAEM,IAAIM,OAAO,CAAC,CAAC;QACjC,OAAO;YACLJ,QAAQC,KAAK,CAAC;YACdT,IAAAA,mBAAY,EAACM;QACf;IACF,GACCO,OAAO,CAAC;QACP,IAAI5B,8BAA8B;YAChCsB,IAAAA,oCAA0B;QAC5B;IACF;AACJ"}
|
||||
15
node_modules/next/dist/cli/next-dev.d.ts
generated
vendored
Normal file
15
node_modules/next/dist/cli/next-dev.d.ts
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env node
|
||||
import '../server/lib/cpu-profile';
|
||||
type NextDevOptions = {
|
||||
turbo?: boolean;
|
||||
port: number;
|
||||
hostname?: string;
|
||||
experimentalHttps?: boolean;
|
||||
experimentalHttpsKey?: string;
|
||||
experimentalHttpsCert?: string;
|
||||
experimentalHttpsCa?: string;
|
||||
experimentalUploadTrace?: string;
|
||||
};
|
||||
type PortSource = 'cli' | 'default' | 'env';
|
||||
declare const nextDev: (options: NextDevOptions, portSource: PortSource, directory?: string) => Promise<void>;
|
||||
export { nextDev };
|
||||
291
node_modules/next/dist/cli/next-dev.js
generated
vendored
Normal file
291
node_modules/next/dist/cli/next-dev.js
generated
vendored
Normal file
@ -0,0 +1,291 @@
|
||||
#!/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_default(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 _child_process = require("child_process");
|
||||
const _getreservedport = require("../lib/helpers/get-reserved-port");
|
||||
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
||||
const _nodeevents = require("node:events");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interop_require_wildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {
|
||||
__proto__: null
|
||||
};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
let dir;
|
||||
let child;
|
||||
let config;
|
||||
let isTurboSession = false;
|
||||
let traceUploadUrl;
|
||||
let sessionStopHandled = false;
|
||||
let sessionStarted = Date.now();
|
||||
const handleSessionStop = async (signal)=>{
|
||||
if (child == null ? void 0 : child.pid) child.kill(signal ?? 0);
|
||||
if (sessionStopHandled) return;
|
||||
sessionStopHandled = true;
|
||||
if ((child == null ? void 0 : child.pid) && child.exitCode === null && child.signalCode === null) {
|
||||
await (0, _nodeevents.once)(child, "exit").catch(()=>{});
|
||||
}
|
||||
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",
|
||||
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("SIGKILL"));
|
||||
process.on("SIGTERM", ()=>handleSessionStop("SIGKILL"));
|
||||
// exit event must be synchronous
|
||||
process.on("exit", ()=>child == null ? void 0 : child.kill("SIGKILL"));
|
||||
const nextDev = async (options, portSource, directory)=>{
|
||||
dir = (0, _getprojectdir.getProjectDir)(process.env.NEXT_PRIVATE_DEV_DIR || directory);
|
||||
// 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 = options.port;
|
||||
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 = portSource === "default";
|
||||
// We do not set a default host value here to prevent breaking
|
||||
// some set-ups that rely on listening on other interfaces
|
||||
const host = options.hostname;
|
||||
config = await (0, _config.default)(_constants.PHASE_DEVELOPMENT_SERVER, dir);
|
||||
if (options.experimentalUploadTrace && !process.env.NEXT_TRACE_UPLOAD_DISABLED) {
|
||||
traceUploadUrl = options.experimentalUploadTrace;
|
||||
}
|
||||
// TODO: remove in the next major version
|
||||
if (config.analyticsId) {
|
||||
_log.warn(`\`config.analyticsId\` is deprecated and will be removed in next major version. Read more: https://nextjs.org/docs/messages/deprecated-analyticsid`);
|
||||
}
|
||||
const devServerOptions = {
|
||||
dir,
|
||||
port,
|
||||
allowRetry,
|
||||
isDev: true,
|
||||
hostname: host
|
||||
};
|
||||
if (options.turbo) {
|
||||
process.env.TURBOPACK = "1";
|
||||
}
|
||||
isTurboSession = !!process.env.TURBOPACK;
|
||||
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(startServerOptions) {
|
||||
return new Promise((resolve)=>{
|
||||
let resolved = false;
|
||||
const defaultEnv = _env.initialEnv || process.env;
|
||||
let NODE_OPTIONS = (0, _utils.getNodeOptionsWithoutInspect)();
|
||||
let nodeDebugType = (0, _utils.checkNodeDebugType)();
|
||||
const maxOldSpaceSize = (0, _utils.getMaxOldSpaceSize)();
|
||||
if (!maxOldSpaceSize && !process.env.NEXT_DISABLE_MEM_OVERRIDE) {
|
||||
const totalMem = _os.default.totalmem();
|
||||
const totalMemInMB = Math.floor(totalMem / 1024 / 1024);
|
||||
NODE_OPTIONS = `${NODE_OPTIONS} --max-old-space-size=${Math.floor(totalMemInMB * 0.5)}`;
|
||||
}
|
||||
if (nodeDebugType) {
|
||||
NODE_OPTIONS = `${NODE_OPTIONS} --${nodeDebugType}=${(0, _utils.getDebugPort)() + 1}`;
|
||||
}
|
||||
child = (0, _child_process.fork)(startServerPath, {
|
||||
stdio: "inherit",
|
||||
env: {
|
||||
...defaultEnv,
|
||||
TURBOPACK: process.env.TURBOPACK,
|
||||
NEXT_PRIVATE_WORKER: "1",
|
||||
NODE_EXTRA_CA_CERTS: startServerOptions.selfSignedCertificate ? startServerOptions.selfSignedCertificate.rootCA : defaultEnv.NODE_EXTRA_CA_CERTS,
|
||||
NODE_OPTIONS
|
||||
}
|
||||
});
|
||||
child.on("message", (msg)=>{
|
||||
if (msg && typeof msg === "object") {
|
||||
if (msg.nextWorkerReady) {
|
||||
child == null ? void 0 : child.send({
|
||||
nextWorkerOptions: startServerOptions
|
||||
});
|
||||
} else if (msg.nextServerReady && !resolved) {
|
||||
resolved = true;
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
});
|
||||
child.on("exit", async (code, signal)=>{
|
||||
if (sessionStopHandled || signal) {
|
||||
return;
|
||||
}
|
||||
if (code === _utils.RESTART_EXIT_CODE) {
|
||||
// Starting the dev server will overwrite the `.next/trace` file, so we
|
||||
// must upload the existing contents before restarting the server to
|
||||
// preserve the metrics.
|
||||
if (traceUploadUrl) {
|
||||
(0, _uploadtrace.default)({
|
||||
traceUploadUrl,
|
||||
mode: "dev",
|
||||
projectDir: dir,
|
||||
distDir: config.distDir,
|
||||
sync: true
|
||||
});
|
||||
}
|
||||
return startServer(startServerOptions);
|
||||
}
|
||||
await handleSessionStop(signal);
|
||||
});
|
||||
});
|
||||
}
|
||||
const runDevServer = async (reboot)=>{
|
||||
try {
|
||||
if (!!options.experimentalHttps) {
|
||||
_log.warn("Self-signed certificates are currently an experimental feature, use with caution.");
|
||||
let certificate;
|
||||
const key = options.experimentalHttpsKey;
|
||||
const cert = options.experimentalHttpsCert;
|
||||
const rootCA = options.experimentalHttpsCa;
|
||||
if (key && cert) {
|
||||
certificate = {
|
||||
key: _path.default.resolve(key),
|
||||
cert: _path.default.resolve(cert),
|
||||
rootCA: rootCA ? _path.default.resolve(rootCA) : undefined
|
||||
};
|
||||
} 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 runDevServer(false);
|
||||
};
|
||||
|
||||
//# sourceMappingURL=next-dev.js.map
|
||||
1
node_modules/next/dist/cli/next-dev.js.map
generated
vendored
Normal file
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.d.ts
generated
vendored
Normal file
2
node_modules/next/dist/cli/next-export.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
declare const nextExport: () => never;
|
||||
export { nextExport };
|
||||
20
node_modules/next/dist/cli/next-export.js
generated
vendored
Normal file
20
node_modules/next/dist/cli/next-export.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "nextExport", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return nextExport;
|
||||
}
|
||||
});
|
||||
const _picocolors = require("../lib/picocolors");
|
||||
const _log = require("../build/output/log");
|
||||
const nextExport = ()=>{
|
||||
(0, _log.error)(`
|
||||
\`next export\` has been removed in favor of 'output: export' in next.config.js.\nLearn more: ${(0, _picocolors.cyan)("https://nextjs.org/docs/app/building-your-application/deploying/static-exports")}
|
||||
`);
|
||||
process.exit(1);
|
||||
};
|
||||
|
||||
//# sourceMappingURL=next-export.js.map
|
||||
1
node_modules/next/dist/cli/next-export.js.map
generated
vendored
Normal file
1
node_modules/next/dist/cli/next-export.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/cli/next-export.ts"],"names":["nextExport","error","cyan","process","exit"],"mappings":";;;;+BAaSA;;;eAAAA;;;4BAbY;qBACC;AAEtB,MAAMA,aAAa;IACjBC,IAAAA,UAAK,EAAC,CAAC;kGACyF,EAAEC,IAAAA,gBAAI,EAClG,kFACA;EACJ,CAAC;IAEDC,QAAQC,IAAI,CAAC;AACf"}
|
||||
11
node_modules/next/dist/cli/next-info.d.ts
generated
vendored
Normal file
11
node_modules/next/dist/cli/next-info.d.ts
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env node
|
||||
type NextInfoOptions = {
|
||||
verbose?: boolean;
|
||||
};
|
||||
/**
|
||||
* 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: (options: NextInfoOptions) => Promise<void>;
|
||||
export { nextInfo };
|
||||
471
node_modules/next/dist/cli/next-info.js
generated
vendored
Normal file
471
node_modules/next/dist/cli/next-info.js
generated
vendored
Normal file
@ -0,0 +1,471 @@
|
||||
#!/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 _picocolors = require("../lib/picocolors");
|
||||
const _constants = require("../shared/lib/constants");
|
||||
const _config = /*#__PURE__*/ _interop_require_default(require("../server/config"));
|
||||
const _getregistry = require("../lib/helpers/get-registry");
|
||||
const _parseversioninfo = require("../server/dev/parse-version-info");
|
||||
const _VersionStalenessInfo = require("../client/components/react-dev-overlay/internal/components/VersionStalenessInfo/VersionStalenessInfo");
|
||||
const _log = require("../build/output/log");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function getPackageVersion(packageName) {
|
||||
try {
|
||||
return require(`${packageName}/package.json`).version;
|
||||
} catch {
|
||||
return "N/A";
|
||||
}
|
||||
}
|
||||
async function getNextConfig() {
|
||||
var _config_experimental;
|
||||
const config = await (0, _config.default)(_constants.PHASE_INFO, process.cwd());
|
||||
return {
|
||||
output: config.output ?? "N/A",
|
||||
experimental: {
|
||||
useWasmBinary: (_config_experimental = config.experimental) == null ? void 0 : _config_experimental.useWasmBinary
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* 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";
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Collect basic next.js installation information and print it to stdout.
|
||||
*/ async function printInfo() {
|
||||
const installedRelease = getPackageVersion("next");
|
||||
const nextConfig = await getNextConfig();
|
||||
let stalenessWithTitle = "";
|
||||
let title = "";
|
||||
let versionInfo;
|
||||
try {
|
||||
const registry = (0, _getregistry.getRegistry)();
|
||||
const res = await fetch(`${registry}-/package/next/dist-tags`);
|
||||
const tags = await res.json();
|
||||
versionInfo = (0, _parseversioninfo.parseVersionInfo)({
|
||||
installed: installedRelease,
|
||||
latest: tags.latest,
|
||||
canary: tags.canary
|
||||
});
|
||||
title = (0, _VersionStalenessInfo.getStaleness)(versionInfo).title;
|
||||
if (title) {
|
||||
stalenessWithTitle = ` // ${title}`;
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(`${(0, _picocolors.yellow)((0, _picocolors.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.
|
||||
\nLearn more: ${(0, _picocolors.cyan)("https://nextjs.org/docs/messages/opening-an-issue")}`);
|
||||
}
|
||||
const cpuCores = _os.default.cpus().length;
|
||||
console.log(`
|
||||
Operating System:
|
||||
Platform: ${_os.default.platform()}
|
||||
Arch: ${_os.default.arch()}
|
||||
Version: ${_os.default.version()}
|
||||
Available memory (MB): ${Math.ceil(_os.default.totalmem() / 1024 / 1024)}
|
||||
Available CPU cores: ${cpuCores > 0 ? cpuCores : "N/A"}
|
||||
Binaries:
|
||||
Node: ${process.versions.node}
|
||||
npm: ${getBinaryVersion("npm")}
|
||||
Yarn: ${getBinaryVersion("yarn")}
|
||||
pnpm: ${getBinaryVersion("pnpm")}
|
||||
Relevant Packages:
|
||||
next: ${installedRelease}${stalenessWithTitle}
|
||||
eslint-config-next: ${getPackageVersion("eslint-config-next")}
|
||||
react: ${getPackageVersion("react")}
|
||||
react-dom: ${getPackageVersion("react-dom")}
|
||||
typescript: ${getPackageVersion("typescript")}
|
||||
Next.js Config:
|
||||
output: ${nextConfig.output}`);
|
||||
if (versionInfo == null ? void 0 : versionInfo.staleness.startsWith("stale")) {
|
||||
(0, _log.warn)(`${title}
|
||||
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`);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 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 printVerboseInfo() {
|
||||
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 {
|
||||
var _nextConfig_experimental;
|
||||
let nextConfig = await getNextConfig();
|
||||
const { loadBindings } = require("../build/swc");
|
||||
const bindings = await loadBindings((_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.useWasmBinary);
|
||||
// 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${(0, _picocolors.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 (options)=>{
|
||||
if (options.verbose) {
|
||||
await printVerboseInfo();
|
||||
} else {
|
||||
await printInfo();
|
||||
}
|
||||
};
|
||||
|
||||
//# sourceMappingURL=next-info.js.map
|
||||
1
node_modules/next/dist/cli/next-info.js.map
generated
vendored
Normal file
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
26
node_modules/next/dist/cli/next-lint.d.ts
generated
vendored
Normal file
26
node_modules/next/dist/cli/next-lint.d.ts
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env node
|
||||
type NextLintOptions = {
|
||||
cache: boolean;
|
||||
cacheLocation?: string;
|
||||
cacheStrategy: string;
|
||||
config?: string;
|
||||
dir?: string[];
|
||||
errorOnUnmatchedPattern?: boolean;
|
||||
ext: string[];
|
||||
file?: string[];
|
||||
fix?: boolean;
|
||||
fixType?: string;
|
||||
format?: string;
|
||||
ignore: boolean;
|
||||
ignorePath?: string;
|
||||
inlineConfig: boolean;
|
||||
maxWarnings: number;
|
||||
outputFile?: string;
|
||||
quiet?: boolean;
|
||||
reportUnusedDisableDirectivesSeverity: 'error' | 'off' | 'warn';
|
||||
resolvePluginsRelativeTo?: string;
|
||||
rulesdir?: string;
|
||||
strict?: boolean;
|
||||
};
|
||||
declare const nextLint: (options: NextLintOptions, directory?: string) => Promise<void>;
|
||||
export { nextLint };
|
||||
127
node_modules/next/dist/cli/next-lint.js
generated
vendored
Normal file
127
node_modules/next/dist/cli/next-lint.js
generated
vendored
Normal file
@ -0,0 +1,127 @@
|
||||
#!/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 _config = /*#__PURE__*/ _interop_require_default(require("../server/config"));
|
||||
const _utils = require("../server/lib/utils");
|
||||
const _storage = require("../telemetry/storage");
|
||||
const _picocolors = require("../lib/picocolors");
|
||||
const _constants = require("../lib/constants");
|
||||
const _runLintCheck = require("../lib/eslint/runLintCheck");
|
||||
const _compileerror = require("../lib/compile-error");
|
||||
const _constants1 = require("../shared/lib/constants");
|
||||
const _events = require("../telemetry/events");
|
||||
const _getprojectdir = require("../lib/get-project-dir");
|
||||
const _findpagesdir = require("../lib/find-pages-dir");
|
||||
const _verifytypescriptsetup = require("../lib/verify-typescript-setup");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
const eslintOptions = (options, defaultCacheLocation)=>({
|
||||
overrideConfigFile: options.config || null,
|
||||
extensions: options.ext ?? [],
|
||||
resolvePluginsRelativeTo: options.resolvePluginsRelativeTo || null,
|
||||
rulePaths: options.rulesdir ?? [],
|
||||
fix: options.fix ?? false,
|
||||
fixTypes: options.fixType ?? null,
|
||||
ignorePath: options.ignorePath || null,
|
||||
ignore: options.ignore,
|
||||
allowInlineConfig: options.inlineConfig,
|
||||
reportUnusedDisableDirectives: options.reportUnusedDisableDirectivesSeverity || null,
|
||||
cache: options.cache,
|
||||
cacheLocation: options.cacheLocation || defaultCacheLocation,
|
||||
cacheStrategy: options.cacheStrategy,
|
||||
errorOnUnmatchedPattern: options.errorOnUnmatchedPattern ?? false
|
||||
});
|
||||
const nextLint = async (options, directory)=>{
|
||||
var _nextConfig_eslint;
|
||||
const baseDir = (0, _getprojectdir.getProjectDir)(directory);
|
||||
// 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 = options.file ?? [];
|
||||
const dirs = options.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(options.quiet);
|
||||
const maxWarnings = options.maxWarnings;
|
||||
const formatter = options.format || null;
|
||||
const strict = Boolean(options.strict);
|
||||
const outputFile = options.outputFile || 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(options, defaultCacheLocation),
|
||||
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)((0, _picocolors.green)("✔ No ESLint warnings or errors"), 0);
|
||||
} else {
|
||||
// this makes sure we exit 1 after the error from line 116
|
||||
// in packages/next/src/lib/eslint/runLintCheck
|
||||
process.exit(1);
|
||||
}
|
||||
}).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
1
node_modules/next/dist/cli/next-lint.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/cli/next-lint.ts"],"names":["nextLint","eslintOptions","options","defaultCacheLocation","overrideConfigFile","config","extensions","ext","resolvePluginsRelativeTo","rulePaths","rulesdir","fix","fixTypes","fixType","ignorePath","ignore","allowInlineConfig","inlineConfig","reportUnusedDisableDirectives","reportUnusedDisableDirectivesSeverity","cache","cacheLocation","cacheStrategy","errorOnUnmatchedPattern","directory","nextConfig","baseDir","getProjectDir","existsSync","printAndExit","loadConfig","PHASE_PRODUCTION_BUILD","files","file","dirs","dir","eslint","filesToLint","pathsToLint","length","ESLINT_DEFAULT_DIRS","reduce","res","d","currDir","join","push","reportErrorsOnly","Boolean","quiet","maxWarnings","formatter","format","strict","outputFile","distDir","pagesDir","appDir","findPagesDir","verifyTypeScriptSetup","intentDirs","filter","typeCheckPreflight","tsconfigPath","typescript","disableStaticImages","images","hasAppDir","hasPagesDir","runLintCheck","lintDuringBuild","then","lintResults","lintOutput","output","eventInfo","telemetry","Telemetry","record","eventLintCheckCompleted","buildLint","flush","isError","CompileError","green","process","exit","catch","err","message"],"mappings":"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"}
|
||||
9
node_modules/next/dist/cli/next-start.d.ts
generated
vendored
Normal file
9
node_modules/next/dist/cli/next-start.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env node
|
||||
import '../server/lib/cpu-profile';
|
||||
type NextStartOptions = {
|
||||
port: number;
|
||||
hostname?: string;
|
||||
keepAliveTimeout?: number;
|
||||
};
|
||||
declare const nextStart: (options: NextStartOptions, directory?: string) => Promise<void>;
|
||||
export { nextStart };
|
||||
34
node_modules/next/dist/cli/next-start.js
generated
vendored
Normal file
34
node_modules/next/dist/cli/next-start.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
#!/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 (options, directory)=>{
|
||||
const dir = (0, _getprojectdir.getProjectDir)(directory);
|
||||
const host = options.hostname;
|
||||
const port = options.port;
|
||||
let keepAliveTimeout = options.keepAliveTimeout;
|
||||
if ((0, _getreservedport.isPortIsReserved)(port)) {
|
||||
(0, _utils.printAndExit)((0, _getreservedport.getReservedPortExplanation)(port), 1);
|
||||
}
|
||||
await (0, _startserver.startServer)({
|
||||
dir,
|
||||
isDev: false,
|
||||
hostname: host,
|
||||
port,
|
||||
keepAliveTimeout
|
||||
});
|
||||
};
|
||||
|
||||
//# sourceMappingURL=next-start.js.map
|
||||
1
node_modules/next/dist/cli/next-start.js.map
generated
vendored
Normal file
1
node_modules/next/dist/cli/next-start.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/cli/next-start.ts"],"names":["nextStart","options","directory","dir","getProjectDir","host","hostname","port","keepAliveTimeout","isPortIsReserved","printAndExit","getReservedPortExplanation","startServer","isDev"],"mappings":";;;;;+BAoCSA;;;eAAAA;;;QAlCF;6BACqB;uBACC;+BACC;iCAIvB;AAQP,MAAMA,YAAY,OAAOC,SAA2BC;IAClD,MAAMC,MAAMC,IAAAA,4BAAa,EAACF;IAC1B,MAAMG,OAAOJ,QAAQK,QAAQ;IAC7B,MAAMC,OAAON,QAAQM,IAAI;IACzB,IAAIC,mBAAmBP,QAAQO,gBAAgB;IAE/C,IAAIC,IAAAA,iCAAgB,EAACF,OAAO;QAC1BG,IAAAA,mBAAY,EAACC,IAAAA,2CAA0B,EAACJ,OAAO;IACjD;IAEA,MAAMK,IAAAA,wBAAW,EAAC;QAChBT;QACAU,OAAO;QACPP,UAAUD;QACVE;QACAC;IACF;AACF"}
|
||||
7
node_modules/next/dist/cli/next-telemetry.d.ts
generated
vendored
Normal file
7
node_modules/next/dist/cli/next-telemetry.d.ts
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
type NextTelemetryOptions = {
|
||||
enable?: boolean;
|
||||
disable?: boolean;
|
||||
};
|
||||
declare const nextTelemetry: (options: NextTelemetryOptions, arg: string) => void;
|
||||
export { nextTelemetry };
|
||||
43
node_modules/next/dist/cli/next-telemetry.js
generated
vendored
Normal file
43
node_modules/next/dist/cli/next-telemetry.js
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env node
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "nextTelemetry", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return nextTelemetry;
|
||||
}
|
||||
});
|
||||
const _picocolors = require("../lib/picocolors");
|
||||
const _storage = require("../telemetry/storage");
|
||||
const telemetry = new _storage.Telemetry({
|
||||
distDir: process.cwd()
|
||||
});
|
||||
let isEnabled = telemetry.isEnabled;
|
||||
const nextTelemetry = (options, arg)=>{
|
||||
if (options.enable || arg === "enable") {
|
||||
telemetry.setEnabled(true);
|
||||
isEnabled = true;
|
||||
console.log((0, _picocolors.cyan)("Success!"));
|
||||
} else if (options.disable || arg === "disable") {
|
||||
const path = telemetry.setEnabled(false);
|
||||
if (isEnabled) {
|
||||
console.log((0, _picocolors.cyan)(`Your preference has been saved${path ? ` to ${path}` : ""}.`));
|
||||
} else {
|
||||
console.log((0, _picocolors.yellow)(`Next.js' telemetry collection is already disabled.`));
|
||||
}
|
||||
isEnabled = false;
|
||||
} else {
|
||||
console.log((0, _picocolors.bold)("Next.js Telemetry"));
|
||||
}
|
||||
console.log(`\nStatus: ${isEnabled ? (0, _picocolors.bold)((0, _picocolors.green)("Enabled")) : (0, _picocolors.bold)((0, _picocolors.red)("Disabled"))}`);
|
||||
if (isEnabled) {
|
||||
console.log("\nNext.js telemetry is completely anonymous. Thank you for participating!");
|
||||
} else {
|
||||
console.log(`\nYou have opted-out of Next.js' anonymous telemetry program.\nNo data will be collected from your machine.`);
|
||||
}
|
||||
console.log(`\nLearn more: ${(0, _picocolors.cyan)("https://nextjs.org/telemetry")}`);
|
||||
};
|
||||
|
||||
//# sourceMappingURL=next-telemetry.js.map
|
||||
1
node_modules/next/dist/cli/next-telemetry.js.map
generated
vendored
Normal file
1
node_modules/next/dist/cli/next-telemetry.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/cli/next-telemetry.ts"],"names":["nextTelemetry","telemetry","Telemetry","distDir","process","cwd","isEnabled","options","arg","enable","setEnabled","console","log","cyan","disable","path","yellow","bold","green","red"],"mappings":";;;;;+BAoDSA;;;eAAAA;;;4BAlDsC;yBACrB;AAO1B,MAAMC,YAAY,IAAIC,kBAAS,CAAC;IAAEC,SAASC,QAAQC,GAAG;AAAG;AACzD,IAAIC,YAAYL,UAAUK,SAAS;AAEnC,MAAMN,gBAAgB,CAACO,SAA+BC;IACpD,IAAID,QAAQE,MAAM,IAAID,QAAQ,UAAU;QACtCP,UAAUS,UAAU,CAAC;QACrBJ,YAAY;QAEZK,QAAQC,GAAG,CAACC,IAAAA,gBAAI,EAAC;IACnB,OAAO,IAAIN,QAAQO,OAAO,IAAIN,QAAQ,WAAW;QAC/C,MAAMO,OAAOd,UAAUS,UAAU,CAAC;QAElC,IAAIJ,WAAW;YACbK,QAAQC,GAAG,CACTC,IAAAA,gBAAI,EAAC,CAAC,8BAA8B,EAAEE,OAAO,CAAC,IAAI,EAAEA,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;QAEtE,OAAO;YACLJ,QAAQC,GAAG,CAACI,IAAAA,kBAAM,EAAC,CAAC,kDAAkD,CAAC;QACzE;QAEAV,YAAY;IACd,OAAO;QACLK,QAAQC,GAAG,CAACK,IAAAA,gBAAI,EAAC;IACnB;IAEAN,QAAQC,GAAG,CACT,CAAC,UAAU,EAAEN,YAAYW,IAAAA,gBAAI,EAACC,IAAAA,iBAAK,EAAC,cAAcD,IAAAA,gBAAI,EAACE,IAAAA,eAAG,EAAC,aAAa,CAAC;IAG3E,IAAIb,WAAW;QACbK,QAAQC,GAAG,CACT;IAEJ,OAAO;QACLD,QAAQC,GAAG,CACT,CAAC,2GAA2G,CAAC;IAEjH;IAEAD,QAAQC,GAAG,CAAC,CAAC,cAAc,EAAEC,IAAAA,gBAAI,EAAC,gCAAgC,CAAC;AACrE"}
|
||||
Reference in New Issue
Block a user