Initial boiler plate project
This commit is contained in:
23
node_modules/next/dist/build/analysis/extract-const-value.d.ts
generated
vendored
Normal file
23
node_modules/next/dist/build/analysis/extract-const-value.d.ts
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
import type { Module } from '@swc/core';
|
||||
export declare class NoSuchDeclarationError extends Error {
|
||||
}
|
||||
export declare class UnsupportedValueError extends Error {
|
||||
/** @example `config.runtime[0].value` */
|
||||
path?: string;
|
||||
constructor(message: string, paths?: string[]);
|
||||
}
|
||||
/**
|
||||
* Extracts the value of an exported const variable named `exportedName`
|
||||
* (e.g. "export const config = { runtime: 'edge' }") from swc's AST.
|
||||
* The value must be one of (or throws UnsupportedValueError):
|
||||
* - string
|
||||
* - boolean
|
||||
* - number
|
||||
* - null
|
||||
* - undefined
|
||||
* - array containing values listed in this list
|
||||
* - object containing values listed in this list
|
||||
*
|
||||
* Throws NoSuchDeclarationError if the declaration is not found.
|
||||
*/
|
||||
export declare function extractExportedConstValue(module: Module, exportedName: string): any;
|
||||
200
node_modules/next/dist/build/analysis/extract-const-value.js
generated
vendored
Normal file
200
node_modules/next/dist/build/analysis/extract-const-value.js
generated
vendored
Normal file
@ -0,0 +1,200 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
NoSuchDeclarationError: null,
|
||||
UnsupportedValueError: null,
|
||||
extractExportedConstValue: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
NoSuchDeclarationError: function() {
|
||||
return NoSuchDeclarationError;
|
||||
},
|
||||
UnsupportedValueError: function() {
|
||||
return UnsupportedValueError;
|
||||
},
|
||||
extractExportedConstValue: function() {
|
||||
return extractExportedConstValue;
|
||||
}
|
||||
});
|
||||
class NoSuchDeclarationError extends Error {
|
||||
}
|
||||
function isExportDeclaration(node) {
|
||||
return node.type === "ExportDeclaration";
|
||||
}
|
||||
function isVariableDeclaration(node) {
|
||||
return node.type === "VariableDeclaration";
|
||||
}
|
||||
function isIdentifier(node) {
|
||||
return node.type === "Identifier";
|
||||
}
|
||||
function isBooleanLiteral(node) {
|
||||
return node.type === "BooleanLiteral";
|
||||
}
|
||||
function isNullLiteral(node) {
|
||||
return node.type === "NullLiteral";
|
||||
}
|
||||
function isStringLiteral(node) {
|
||||
return node.type === "StringLiteral";
|
||||
}
|
||||
function isNumericLiteral(node) {
|
||||
return node.type === "NumericLiteral";
|
||||
}
|
||||
function isArrayExpression(node) {
|
||||
return node.type === "ArrayExpression";
|
||||
}
|
||||
function isObjectExpression(node) {
|
||||
return node.type === "ObjectExpression";
|
||||
}
|
||||
function isKeyValueProperty(node) {
|
||||
return node.type === "KeyValueProperty";
|
||||
}
|
||||
function isRegExpLiteral(node) {
|
||||
return node.type === "RegExpLiteral";
|
||||
}
|
||||
function isTemplateLiteral(node) {
|
||||
return node.type === "TemplateLiteral";
|
||||
}
|
||||
class UnsupportedValueError extends Error {
|
||||
constructor(message, paths){
|
||||
super(message);
|
||||
// Generating "path" that looks like "config.runtime[0].value"
|
||||
let codePath;
|
||||
if (paths) {
|
||||
codePath = "";
|
||||
for (const path of paths){
|
||||
if (path[0] === "[") {
|
||||
// "array" + "[0]"
|
||||
codePath += path;
|
||||
} else {
|
||||
if (codePath === "") {
|
||||
codePath = path;
|
||||
} else {
|
||||
// "object" + ".key"
|
||||
codePath += `.${path}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.path = codePath;
|
||||
}
|
||||
}
|
||||
function extractValue(node, path) {
|
||||
if (isNullLiteral(node)) {
|
||||
return null;
|
||||
} else if (isBooleanLiteral(node)) {
|
||||
// e.g. true / false
|
||||
return node.value;
|
||||
} else if (isStringLiteral(node)) {
|
||||
// e.g. "abc"
|
||||
return node.value;
|
||||
} else if (isNumericLiteral(node)) {
|
||||
// e.g. 123
|
||||
return node.value;
|
||||
} else if (isRegExpLiteral(node)) {
|
||||
// e.g. /abc/i
|
||||
return new RegExp(node.pattern, node.flags);
|
||||
} else if (isIdentifier(node)) {
|
||||
switch(node.value){
|
||||
case "undefined":
|
||||
return undefined;
|
||||
default:
|
||||
throw new UnsupportedValueError(`Unknown identifier "${node.value}"`, path);
|
||||
}
|
||||
} else if (isArrayExpression(node)) {
|
||||
// e.g. [1, 2, 3]
|
||||
const arr = [];
|
||||
for(let i = 0, len = node.elements.length; i < len; i++){
|
||||
const elem = node.elements[i];
|
||||
if (elem) {
|
||||
if (elem.spread) {
|
||||
// e.g. [ ...a ]
|
||||
throw new UnsupportedValueError("Unsupported spread operator in the Array Expression", path);
|
||||
}
|
||||
arr.push(extractValue(elem.expression, path && [
|
||||
...path,
|
||||
`[${i}]`
|
||||
]));
|
||||
} else {
|
||||
// e.g. [1, , 2]
|
||||
// ^^
|
||||
arr.push(undefined);
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
} else if (isObjectExpression(node)) {
|
||||
// e.g. { a: 1, b: 2 }
|
||||
const obj = {};
|
||||
for (const prop of node.properties){
|
||||
if (!isKeyValueProperty(prop)) {
|
||||
// e.g. { ...a }
|
||||
throw new UnsupportedValueError("Unsupported spread operator in the Object Expression", path);
|
||||
}
|
||||
let key;
|
||||
if (isIdentifier(prop.key)) {
|
||||
// e.g. { a: 1, b: 2 }
|
||||
key = prop.key.value;
|
||||
} else if (isStringLiteral(prop.key)) {
|
||||
// e.g. { "a": 1, "b": 2 }
|
||||
key = prop.key.value;
|
||||
} else {
|
||||
throw new UnsupportedValueError(`Unsupported key type "${prop.key.type}" in the Object Expression`, path);
|
||||
}
|
||||
obj[key] = extractValue(prop.value, path && [
|
||||
...path,
|
||||
key
|
||||
]);
|
||||
}
|
||||
return obj;
|
||||
} else if (isTemplateLiteral(node)) {
|
||||
// e.g. `abc`
|
||||
if (node.expressions.length !== 0) {
|
||||
// TODO: should we add support for `${'e'}d${'g'}'e'`?
|
||||
throw new UnsupportedValueError("Unsupported template literal with expressions", path);
|
||||
}
|
||||
// When TemplateLiteral has 0 expressions, the length of quasis is always 1.
|
||||
// Because when parsing TemplateLiteral, the parser yields the first quasi,
|
||||
// then the first expression, then the next quasi, then the next expression, etc.,
|
||||
// until the last quasi.
|
||||
// Thus if there is no expression, the parser ends at the frst and also last quasis
|
||||
//
|
||||
// A "cooked" interpretation where backslashes have special meaning, while a
|
||||
// "raw" interpretation where backslashes do not have special meaning
|
||||
// https://exploringjs.com/impatient-js/ch_template-literals.html#template-strings-cooked-vs-raw
|
||||
const [{ cooked, raw }] = node.quasis;
|
||||
return cooked ?? raw;
|
||||
} else {
|
||||
throw new UnsupportedValueError(`Unsupported node type "${node.type}"`, path);
|
||||
}
|
||||
}
|
||||
function extractExportedConstValue(module1, exportedName) {
|
||||
for (const moduleItem of module1.body){
|
||||
if (!isExportDeclaration(moduleItem)) {
|
||||
continue;
|
||||
}
|
||||
const declaration = moduleItem.declaration;
|
||||
if (!isVariableDeclaration(declaration)) {
|
||||
continue;
|
||||
}
|
||||
if (declaration.kind !== "const") {
|
||||
continue;
|
||||
}
|
||||
for (const decl of declaration.declarations){
|
||||
if (isIdentifier(decl.id) && decl.id.value === exportedName && decl.init) {
|
||||
return extractValue(decl.init, [
|
||||
exportedName
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new NoSuchDeclarationError();
|
||||
}
|
||||
|
||||
//# sourceMappingURL=extract-const-value.js.map
|
||||
1
node_modules/next/dist/build/analysis/extract-const-value.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/analysis/extract-const-value.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/build/analysis/extract-const-value.ts"],"names":["NoSuchDeclarationError","UnsupportedValueError","extractExportedConstValue","Error","isExportDeclaration","node","type","isVariableDeclaration","isIdentifier","isBooleanLiteral","isNullLiteral","isStringLiteral","isNumericLiteral","isArrayExpression","isObjectExpression","isKeyValueProperty","isRegExpLiteral","isTemplateLiteral","constructor","message","paths","codePath","path","extractValue","value","RegExp","pattern","flags","undefined","arr","i","len","elements","length","elem","spread","push","expression","obj","prop","properties","key","expressions","cooked","raw","quasis","module","exportedName","moduleItem","body","declaration","kind","decl","declarations","id","init"],"mappings":"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"}
|
||||
58
node_modules/next/dist/build/analysis/get-page-static-info.d.ts
generated
vendored
Normal file
58
node_modules/next/dist/build/analysis/get-page-static-info.d.ts
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
import type { NextConfig } from '../../server/config-shared';
|
||||
import type { RouteHas } from '../../lib/load-custom-routes';
|
||||
import type { ServerRuntime } from 'next/types';
|
||||
import type { RSCMeta } from '../webpack/loaders/get-module-build-info';
|
||||
import { PAGE_TYPES } from '../../lib/page-types';
|
||||
export interface MiddlewareConfigParsed extends Omit<MiddlewareConfig, 'matcher'> {
|
||||
matchers?: MiddlewareMatcher[];
|
||||
}
|
||||
/**
|
||||
* This interface represents the exported `config` object in a `middleware.ts` file.
|
||||
*
|
||||
* Read more: [Next.js Docs: Middleware `config` object](https://nextjs.org/docs/app/api-reference/file-conventions/middleware#config-object-optional)
|
||||
*/
|
||||
export interface MiddlewareConfig {
|
||||
/**
|
||||
* Read more: [Next.js Docs: Middleware `matcher`](https://nextjs.org/docs/app/api-reference/file-conventions/middleware#matcher),
|
||||
* [Next.js Docs: Middleware matching paths](https://nextjs.org/docs/app/building-your-application/routing/middleware#matching-paths)
|
||||
*/
|
||||
matcher?: string | string[] | MiddlewareMatcher[];
|
||||
unstable_allowDynamicGlobs?: string[];
|
||||
regions?: string[] | string;
|
||||
}
|
||||
export interface MiddlewareMatcher {
|
||||
regexp: string;
|
||||
locale?: false;
|
||||
has?: RouteHas[];
|
||||
missing?: RouteHas[];
|
||||
originalSource: string;
|
||||
}
|
||||
export interface PageStaticInfo {
|
||||
runtime?: ServerRuntime;
|
||||
preferredRegion?: string | string[];
|
||||
ssg?: boolean;
|
||||
ssr?: boolean;
|
||||
rsc?: RSCModuleType;
|
||||
generateStaticParams?: boolean;
|
||||
middleware?: MiddlewareConfigParsed;
|
||||
amp?: boolean | 'hybrid';
|
||||
extraConfig?: Record<string, any>;
|
||||
}
|
||||
export type RSCModuleType = 'server' | 'client';
|
||||
export declare function getRSCModuleInformation(source: string, isReactServerLayer: boolean): RSCMeta;
|
||||
export declare function getMiddlewareMatchers(matcherOrMatchers: unknown, nextConfig: NextConfig): MiddlewareMatcher[];
|
||||
export declare function isDynamicMetadataRoute(pageFilePath: string): Promise<boolean>;
|
||||
/**
|
||||
* For a given pageFilePath and nextConfig, if the config supports it, this
|
||||
* function will read the file and return the runtime that should be used.
|
||||
* It will look into the file content only if the page *requires* a runtime
|
||||
* to be specified, that is, when gSSP or gSP is used.
|
||||
* Related discussion: https://github.com/vercel/next.js/discussions/34179
|
||||
*/
|
||||
export declare function getPageStaticInfo(params: {
|
||||
pageFilePath: string;
|
||||
nextConfig: Partial<NextConfig>;
|
||||
isDev?: boolean;
|
||||
page?: string;
|
||||
pageType: PAGE_TYPES;
|
||||
}): Promise<PageStaticInfo>;
|
||||
494
node_modules/next/dist/build/analysis/get-page-static-info.js
generated
vendored
Normal file
494
node_modules/next/dist/build/analysis/get-page-static-info.js
generated
vendored
Normal file
@ -0,0 +1,494 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
getMiddlewareMatchers: null,
|
||||
getPageStaticInfo: null,
|
||||
getRSCModuleInformation: null,
|
||||
isDynamicMetadataRoute: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
getMiddlewareMatchers: function() {
|
||||
return getMiddlewareMatchers;
|
||||
},
|
||||
getPageStaticInfo: function() {
|
||||
return getPageStaticInfo;
|
||||
},
|
||||
getRSCModuleInformation: function() {
|
||||
return getRSCModuleInformation;
|
||||
},
|
||||
isDynamicMetadataRoute: function() {
|
||||
return isDynamicMetadataRoute;
|
||||
}
|
||||
});
|
||||
const _fs = require("fs");
|
||||
const _lrucache = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/lru-cache"));
|
||||
const _picomatch = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/picomatch"));
|
||||
const _extractconstvalue = require("./extract-const-value");
|
||||
const _parsemodule = require("./parse-module");
|
||||
const _log = /*#__PURE__*/ _interop_require_wildcard(require("../output/log"));
|
||||
const _constants = require("../../lib/constants");
|
||||
const _loadcustomroutes = require("../../lib/load-custom-routes");
|
||||
const _trytoparsepath = require("../../lib/try-to-parse-path");
|
||||
const _isapiroute = require("../../lib/is-api-route");
|
||||
const _isedgeruntime = require("../../lib/is-edge-runtime");
|
||||
const _constants1 = require("../../shared/lib/constants");
|
||||
const _pagetypes = require("../../lib/page-types");
|
||||
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;
|
||||
}
|
||||
// TODO: migrate preferredRegion here
|
||||
// Don't forget to update the next-types-plugin file as well
|
||||
const AUTHORIZED_EXTRA_ROUTER_PROPS = [
|
||||
"maxDuration"
|
||||
];
|
||||
const CLIENT_MODULE_LABEL = /\/\* __next_internal_client_entry_do_not_use__ ([^ ]*) (cjs|auto) \*\//;
|
||||
const ACTION_MODULE_LABEL = /\/\* __next_internal_action_entry_do_not_use__ (\{[^}]+\}) \*\//;
|
||||
const CLIENT_DIRECTIVE = "use client";
|
||||
const SERVER_ACTION_DIRECTIVE = "use server";
|
||||
function getRSCModuleInformation(source, isReactServerLayer) {
|
||||
var _clientInfoMatch_;
|
||||
const actionsJson = source.match(ACTION_MODULE_LABEL);
|
||||
const actions = actionsJson ? Object.values(JSON.parse(actionsJson[1])) : undefined;
|
||||
const clientInfoMatch = source.match(CLIENT_MODULE_LABEL);
|
||||
const isClientRef = !!clientInfoMatch;
|
||||
if (!isReactServerLayer) {
|
||||
return {
|
||||
type: _constants1.RSC_MODULE_TYPES.client,
|
||||
actions,
|
||||
isClientRef
|
||||
};
|
||||
}
|
||||
const clientRefs = clientInfoMatch == null ? void 0 : (_clientInfoMatch_ = clientInfoMatch[1]) == null ? void 0 : _clientInfoMatch_.split(",");
|
||||
const clientEntryType = clientInfoMatch == null ? void 0 : clientInfoMatch[2];
|
||||
const type = clientRefs ? _constants1.RSC_MODULE_TYPES.client : _constants1.RSC_MODULE_TYPES.server;
|
||||
return {
|
||||
type,
|
||||
actions,
|
||||
clientRefs,
|
||||
clientEntryType,
|
||||
isClientRef
|
||||
};
|
||||
}
|
||||
const warnedInvalidValueMap = {
|
||||
runtime: new Map(),
|
||||
preferredRegion: new Map()
|
||||
};
|
||||
function warnInvalidValue(pageFilePath, key, message) {
|
||||
if (warnedInvalidValueMap[key].has(pageFilePath)) return;
|
||||
_log.warn(`Next.js can't recognize the exported \`${key}\` field in "${pageFilePath}" as ${message}.` + "\n" + "The default runtime will be used instead.");
|
||||
warnedInvalidValueMap[key].set(pageFilePath, true);
|
||||
}
|
||||
/**
|
||||
* Receives a parsed AST from SWC and checks if it belongs to a module that
|
||||
* requires a runtime to be specified. Those are:
|
||||
* - Modules with `export function getStaticProps | getServerSideProps`
|
||||
* - Modules with `export { getStaticProps | getServerSideProps } <from ...>`
|
||||
* - Modules with `export const runtime = ...`
|
||||
*/ function checkExports(swcAST, pageFilePath) {
|
||||
const exportsSet = new Set([
|
||||
"getStaticProps",
|
||||
"getServerSideProps",
|
||||
"generateImageMetadata",
|
||||
"generateSitemaps",
|
||||
"generateStaticParams"
|
||||
]);
|
||||
if (Array.isArray(swcAST == null ? void 0 : swcAST.body)) {
|
||||
try {
|
||||
let runtime;
|
||||
let preferredRegion;
|
||||
let ssr = false;
|
||||
let ssg = false;
|
||||
let generateImageMetadata = false;
|
||||
let generateSitemaps = false;
|
||||
let generateStaticParams = false;
|
||||
let extraProperties = new Set();
|
||||
let directives = new Set();
|
||||
let hasLeadingNonDirectiveNode = false;
|
||||
for (const node of swcAST.body){
|
||||
var _node_declaration, _node_declaration1, _node_declaration_identifier, _node_declaration2;
|
||||
// There should be no non-string literals nodes before directives
|
||||
if (node.type === "ExpressionStatement" && node.expression.type === "StringLiteral") {
|
||||
if (!hasLeadingNonDirectiveNode) {
|
||||
const directive = node.expression.value;
|
||||
if (CLIENT_DIRECTIVE === directive) {
|
||||
directives.add("client");
|
||||
}
|
||||
if (SERVER_ACTION_DIRECTIVE === directive) {
|
||||
directives.add("server");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
hasLeadingNonDirectiveNode = true;
|
||||
}
|
||||
if (node.type === "ExportDeclaration" && ((_node_declaration = node.declaration) == null ? void 0 : _node_declaration.type) === "VariableDeclaration") {
|
||||
var _node_declaration3;
|
||||
for (const declaration of (_node_declaration3 = node.declaration) == null ? void 0 : _node_declaration3.declarations){
|
||||
if (declaration.id.value === "runtime") {
|
||||
runtime = declaration.init.value;
|
||||
} else if (declaration.id.value === "preferredRegion") {
|
||||
if (declaration.init.type === "ArrayExpression") {
|
||||
const elements = [];
|
||||
for (const element of declaration.init.elements){
|
||||
const { expression } = element;
|
||||
if (expression.type !== "StringLiteral") {
|
||||
continue;
|
||||
}
|
||||
elements.push(expression.value);
|
||||
}
|
||||
preferredRegion = elements;
|
||||
} else {
|
||||
preferredRegion = declaration.init.value;
|
||||
}
|
||||
} else {
|
||||
extraProperties.add(declaration.id.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (node.type === "ExportDeclaration" && ((_node_declaration1 = node.declaration) == null ? void 0 : _node_declaration1.type) === "FunctionDeclaration" && exportsSet.has((_node_declaration_identifier = node.declaration.identifier) == null ? void 0 : _node_declaration_identifier.value)) {
|
||||
const id = node.declaration.identifier.value;
|
||||
ssg = id === "getStaticProps";
|
||||
ssr = id === "getServerSideProps";
|
||||
generateImageMetadata = id === "generateImageMetadata";
|
||||
generateSitemaps = id === "generateSitemaps";
|
||||
generateStaticParams = id === "generateStaticParams";
|
||||
}
|
||||
if (node.type === "ExportDeclaration" && ((_node_declaration2 = node.declaration) == null ? void 0 : _node_declaration2.type) === "VariableDeclaration") {
|
||||
var _node_declaration_declarations_, _node_declaration4;
|
||||
const id = (_node_declaration4 = node.declaration) == null ? void 0 : (_node_declaration_declarations_ = _node_declaration4.declarations[0]) == null ? void 0 : _node_declaration_declarations_.id.value;
|
||||
if (exportsSet.has(id)) {
|
||||
ssg = id === "getStaticProps";
|
||||
ssr = id === "getServerSideProps";
|
||||
generateImageMetadata = id === "generateImageMetadata";
|
||||
generateSitemaps = id === "generateSitemaps";
|
||||
generateStaticParams = id === "generateStaticParams";
|
||||
}
|
||||
}
|
||||
if (node.type === "ExportNamedDeclaration") {
|
||||
const values = node.specifiers.map((specifier)=>{
|
||||
var _specifier_orig, _specifier_orig1;
|
||||
return specifier.type === "ExportSpecifier" && ((_specifier_orig = specifier.orig) == null ? void 0 : _specifier_orig.type) === "Identifier" && ((_specifier_orig1 = specifier.orig) == null ? void 0 : _specifier_orig1.value);
|
||||
});
|
||||
for (const value of values){
|
||||
if (!ssg && value === "getStaticProps") ssg = true;
|
||||
if (!ssr && value === "getServerSideProps") ssr = true;
|
||||
if (!generateImageMetadata && value === "generateImageMetadata") generateImageMetadata = true;
|
||||
if (!generateSitemaps && value === "generateSitemaps") generateSitemaps = true;
|
||||
if (!generateStaticParams && value === "generateStaticParams") generateStaticParams = true;
|
||||
if (!runtime && value === "runtime") warnInvalidValue(pageFilePath, "runtime", "it was not assigned to a string literal");
|
||||
if (!preferredRegion && value === "preferredRegion") warnInvalidValue(pageFilePath, "preferredRegion", "it was not assigned to a string literal or an array of string literals");
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
ssr,
|
||||
ssg,
|
||||
runtime,
|
||||
preferredRegion,
|
||||
generateImageMetadata,
|
||||
generateSitemaps,
|
||||
generateStaticParams,
|
||||
extraProperties,
|
||||
directives
|
||||
};
|
||||
} catch (err) {}
|
||||
}
|
||||
return {
|
||||
ssg: false,
|
||||
ssr: false,
|
||||
runtime: undefined,
|
||||
preferredRegion: undefined,
|
||||
generateImageMetadata: false,
|
||||
generateSitemaps: false,
|
||||
generateStaticParams: false,
|
||||
extraProperties: undefined,
|
||||
directives: undefined
|
||||
};
|
||||
}
|
||||
async function tryToReadFile(filePath, shouldThrow) {
|
||||
try {
|
||||
return await _fs.promises.readFile(filePath, {
|
||||
encoding: "utf8"
|
||||
});
|
||||
} catch (error) {
|
||||
if (shouldThrow) {
|
||||
error.message = `Next.js ERROR: Failed to read file ${filePath}:\n${error.message}`;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getMiddlewareMatchers(matcherOrMatchers, nextConfig) {
|
||||
let matchers = [];
|
||||
if (Array.isArray(matcherOrMatchers)) {
|
||||
matchers = matcherOrMatchers;
|
||||
} else {
|
||||
matchers.push(matcherOrMatchers);
|
||||
}
|
||||
const { i18n } = nextConfig;
|
||||
const originalSourceMap = new Map();
|
||||
let routes = matchers.map((m)=>{
|
||||
let middleware = typeof m === "string" ? {
|
||||
source: m
|
||||
} : m;
|
||||
if (middleware) {
|
||||
originalSourceMap.set(middleware, middleware.source);
|
||||
}
|
||||
return middleware;
|
||||
});
|
||||
// check before we process the routes and after to ensure
|
||||
// they are still valid
|
||||
(0, _loadcustomroutes.checkCustomRoutes)(routes, "middleware");
|
||||
routes = routes.map((r)=>{
|
||||
let { source } = r;
|
||||
const isRoot = source === "/";
|
||||
if ((i18n == null ? void 0 : i18n.locales) && r.locale !== false) {
|
||||
source = `/:nextInternalLocale((?!_next/)[^/.]{1,})${isRoot ? "" : source}`;
|
||||
}
|
||||
source = `/:nextData(_next/data/[^/]{1,})?${source}${isRoot ? `(${nextConfig.i18n ? "|\\.json|" : ""}/?index|/?index\\.json)?` : "(.json)?"}`;
|
||||
if (nextConfig.basePath) {
|
||||
source = `${nextConfig.basePath}${source}`;
|
||||
}
|
||||
r.source = source;
|
||||
return r;
|
||||
});
|
||||
(0, _loadcustomroutes.checkCustomRoutes)(routes, "middleware");
|
||||
return routes.map((r)=>{
|
||||
const { source, ...rest } = r;
|
||||
const parsedPage = (0, _trytoparsepath.tryToParsePath)(source);
|
||||
if (parsedPage.error || !parsedPage.regexStr) {
|
||||
throw new Error(`Invalid source: ${source}`);
|
||||
}
|
||||
const originalSource = originalSourceMap.get(r);
|
||||
return {
|
||||
...rest,
|
||||
regexp: parsedPage.regexStr,
|
||||
originalSource: originalSource || source
|
||||
};
|
||||
});
|
||||
}
|
||||
function getMiddlewareConfig(pageFilePath, config, nextConfig) {
|
||||
const result = {};
|
||||
if (config.matcher) {
|
||||
result.matchers = getMiddlewareMatchers(config.matcher, nextConfig);
|
||||
}
|
||||
if (typeof config.regions === "string" || Array.isArray(config.regions)) {
|
||||
result.regions = config.regions;
|
||||
} else if (typeof config.regions !== "undefined") {
|
||||
_log.warn(`The \`regions\` config was ignored: config must be empty, a string or an array of strings. (${pageFilePath})`);
|
||||
}
|
||||
if (config.unstable_allowDynamic) {
|
||||
result.unstable_allowDynamicGlobs = Array.isArray(config.unstable_allowDynamic) ? config.unstable_allowDynamic : [
|
||||
config.unstable_allowDynamic
|
||||
];
|
||||
for (const glob of result.unstable_allowDynamicGlobs ?? []){
|
||||
try {
|
||||
(0, _picomatch.default)(glob);
|
||||
} catch (err) {
|
||||
throw new Error(`${pageFilePath} exported 'config.unstable_allowDynamic' contains invalid pattern '${glob}': ${err.message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
const apiRouteWarnings = new _lrucache.default({
|
||||
max: 250
|
||||
});
|
||||
function warnAboutExperimentalEdge(apiRoute) {
|
||||
if (process.env.NODE_ENV === "production" && process.env.NEXT_PRIVATE_BUILD_WORKER === "1") {
|
||||
return;
|
||||
}
|
||||
if (apiRouteWarnings.has(apiRoute)) {
|
||||
return;
|
||||
}
|
||||
_log.warn(apiRoute ? `${apiRoute} provided runtime 'experimental-edge'. It can be updated to 'edge' instead.` : `You are using an experimental edge runtime, the API might change.`);
|
||||
apiRouteWarnings.set(apiRoute, 1);
|
||||
}
|
||||
const warnedUnsupportedValueMap = new _lrucache.default({
|
||||
max: 250
|
||||
});
|
||||
function warnAboutUnsupportedValue(pageFilePath, page, error) {
|
||||
if (warnedUnsupportedValueMap.has(pageFilePath)) {
|
||||
return;
|
||||
}
|
||||
_log.warn(`Next.js can't recognize the exported \`config\` field in ` + (page ? `route "${page}"` : `"${pageFilePath}"`) + ":\n" + error.message + (error.path ? ` at "${error.path}"` : "") + ".\n" + "The default config will be used instead.\n" + "Read More - https://nextjs.org/docs/messages/invalid-page-config");
|
||||
warnedUnsupportedValueMap.set(pageFilePath, true);
|
||||
}
|
||||
async function isDynamicMetadataRoute(pageFilePath) {
|
||||
const fileContent = await tryToReadFile(pageFilePath, true) || "";
|
||||
if (/generateImageMetadata|generateSitemaps/.test(fileContent)) {
|
||||
const swcAST = await (0, _parsemodule.parseModule)(pageFilePath, fileContent);
|
||||
const exportsInfo = checkExports(swcAST, pageFilePath);
|
||||
return !!(exportsInfo.generateImageMetadata || exportsInfo.generateSitemaps);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
async function getPageStaticInfo(params) {
|
||||
const { isDev, pageFilePath, nextConfig, page, pageType } = params;
|
||||
const fileContent = await tryToReadFile(pageFilePath, !isDev) || "";
|
||||
if (/(?<!(_jsx|jsx-))runtime|preferredRegion|getStaticProps|getServerSideProps|generateStaticParams|export const/.test(fileContent)) {
|
||||
const swcAST = await (0, _parsemodule.parseModule)(pageFilePath, fileContent);
|
||||
const { ssg, ssr, runtime, preferredRegion, generateStaticParams, extraProperties, directives } = checkExports(swcAST, pageFilePath);
|
||||
const rscInfo = getRSCModuleInformation(fileContent, true);
|
||||
const rsc = rscInfo.type;
|
||||
// default / failsafe value for config
|
||||
let config// TODO: type this as unknown
|
||||
;
|
||||
try {
|
||||
config = (0, _extractconstvalue.extractExportedConstValue)(swcAST, "config");
|
||||
} catch (e) {
|
||||
if (e instanceof _extractconstvalue.UnsupportedValueError) {
|
||||
warnAboutUnsupportedValue(pageFilePath, page, e);
|
||||
}
|
||||
// `export config` doesn't exist, or other unknown error thrown by swc, silence them
|
||||
}
|
||||
const extraConfig = {};
|
||||
if (extraProperties && pageType === _pagetypes.PAGE_TYPES.APP) {
|
||||
for (const prop of extraProperties){
|
||||
if (!AUTHORIZED_EXTRA_ROUTER_PROPS.includes(prop)) continue;
|
||||
try {
|
||||
extraConfig[prop] = (0, _extractconstvalue.extractExportedConstValue)(swcAST, prop);
|
||||
} catch (e) {
|
||||
if (e instanceof _extractconstvalue.UnsupportedValueError) {
|
||||
warnAboutUnsupportedValue(pageFilePath, page, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (pageType === _pagetypes.PAGE_TYPES.PAGES) {
|
||||
for(const key in config){
|
||||
if (!AUTHORIZED_EXTRA_ROUTER_PROPS.includes(key)) continue;
|
||||
extraConfig[key] = config[key];
|
||||
}
|
||||
}
|
||||
if (pageType === _pagetypes.PAGE_TYPES.APP) {
|
||||
if (config) {
|
||||
let message = `Page config in ${pageFilePath} is deprecated. Replace \`export const config=…\` with the following:`;
|
||||
if (config.runtime) {
|
||||
message += `\n - \`export const runtime = ${JSON.stringify(config.runtime)}\``;
|
||||
}
|
||||
if (config.regions) {
|
||||
message += `\n - \`export const preferredRegion = ${JSON.stringify(config.regions)}\``;
|
||||
}
|
||||
message += `\nVisit https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config for more information.`;
|
||||
if (isDev) {
|
||||
_log.warnOnce(message);
|
||||
} else {
|
||||
throw new Error(message);
|
||||
}
|
||||
config = {};
|
||||
}
|
||||
}
|
||||
if (!config) config = {};
|
||||
// We use `export const config = { runtime: '...' }` to specify the page runtime for pages/.
|
||||
// In the new app directory, we prefer to use `export const runtime = '...'`
|
||||
// and deprecate the old way. To prevent breaking changes for `pages`, we use the exported config
|
||||
// as the fallback value.
|
||||
let resolvedRuntime;
|
||||
if (pageType === _pagetypes.PAGE_TYPES.APP) {
|
||||
resolvedRuntime = runtime;
|
||||
} else {
|
||||
resolvedRuntime = runtime || config.runtime;
|
||||
}
|
||||
if (typeof resolvedRuntime !== "undefined" && resolvedRuntime !== _constants.SERVER_RUNTIME.nodejs && !(0, _isedgeruntime.isEdgeRuntime)(resolvedRuntime)) {
|
||||
const options = Object.values(_constants.SERVER_RUNTIME).join(", ");
|
||||
const message = typeof resolvedRuntime !== "string" ? `The \`runtime\` config must be a string. Please leave it empty or choose one of: ${options}` : `Provided runtime "${resolvedRuntime}" is not supported. Please leave it empty or choose one of: ${options}`;
|
||||
if (isDev) {
|
||||
_log.error(message);
|
||||
} else {
|
||||
throw new Error(message);
|
||||
}
|
||||
}
|
||||
const requiresServerRuntime = ssr || ssg || pageType === _pagetypes.PAGE_TYPES.APP;
|
||||
const isAnAPIRoute = (0, _isapiroute.isAPIRoute)(page == null ? void 0 : page.replace(/^(?:\/src)?\/pages\//, "/"));
|
||||
resolvedRuntime = (0, _isedgeruntime.isEdgeRuntime)(resolvedRuntime) || requiresServerRuntime ? resolvedRuntime : undefined;
|
||||
if (resolvedRuntime === _constants.SERVER_RUNTIME.experimentalEdge) {
|
||||
warnAboutExperimentalEdge(isAnAPIRoute ? page : null);
|
||||
}
|
||||
if (resolvedRuntime === _constants.SERVER_RUNTIME.edge && pageType === _pagetypes.PAGE_TYPES.PAGES && page && !isAnAPIRoute) {
|
||||
const message = `Page ${page} provided runtime 'edge', the edge runtime for rendering is currently experimental. Use runtime 'experimental-edge' instead.`;
|
||||
if (isDev) {
|
||||
_log.error(message);
|
||||
} else {
|
||||
throw new Error(message);
|
||||
}
|
||||
}
|
||||
const middlewareConfig = getMiddlewareConfig(page ?? "middleware/edge API route", config, nextConfig);
|
||||
if (pageType === _pagetypes.PAGE_TYPES.APP && (directives == null ? void 0 : directives.has("client")) && generateStaticParams) {
|
||||
throw new Error(`Page "${page}" cannot use both "use client" and export function "generateStaticParams()".`);
|
||||
}
|
||||
return {
|
||||
ssr,
|
||||
ssg,
|
||||
rsc,
|
||||
generateStaticParams,
|
||||
amp: config.amp || false,
|
||||
...middlewareConfig && {
|
||||
middleware: middlewareConfig
|
||||
},
|
||||
...resolvedRuntime && {
|
||||
runtime: resolvedRuntime
|
||||
},
|
||||
preferredRegion,
|
||||
extraConfig
|
||||
};
|
||||
}
|
||||
return {
|
||||
ssr: false,
|
||||
ssg: false,
|
||||
rsc: _constants1.RSC_MODULE_TYPES.server,
|
||||
generateStaticParams: false,
|
||||
amp: false,
|
||||
runtime: undefined
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=get-page-static-info.js.map
|
||||
1
node_modules/next/dist/build/analysis/get-page-static-info.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/analysis/get-page-static-info.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
node_modules/next/dist/build/analysis/parse-module.d.ts
generated
vendored
Normal file
5
node_modules/next/dist/build/analysis/parse-module.d.ts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
/**
|
||||
* Parses a module with SWC using an LRU cache where the parsed module will
|
||||
* be indexed by a sha of its content holding up to 500 entries.
|
||||
*/
|
||||
export declare const parseModule: (_: string, content: string) => Promise<any>;
|
||||
27
node_modules/next/dist/build/analysis/parse-module.js
generated
vendored
Normal file
27
node_modules/next/dist/build/analysis/parse-module.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "parseModule", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return parseModule;
|
||||
}
|
||||
});
|
||||
const _lrucache = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/lru-cache"));
|
||||
const _withpromisecache = require("../../lib/with-promise-cache");
|
||||
const _crypto = require("crypto");
|
||||
const _swc = require("../swc");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
const parseModule = (0, _withpromisecache.withPromiseCache)(new _lrucache.default({
|
||||
max: 500
|
||||
}), async (filename, content)=>(0, _swc.parse)(content, {
|
||||
isModule: "unknown",
|
||||
filename
|
||||
}).catch(()=>null), (_, content)=>(0, _crypto.createHash)("sha1").update(content).digest("hex"));
|
||||
|
||||
//# sourceMappingURL=parse-module.js.map
|
||||
1
node_modules/next/dist/build/analysis/parse-module.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/analysis/parse-module.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/build/analysis/parse-module.ts"],"names":["parseModule","withPromiseCache","LRUCache","max","filename","content","parse","isModule","catch","_","createHash","update","digest"],"mappings":";;;;+BASaA;;;eAAAA;;;iEATQ;kCACY;wBACN;qBACL;;;;;;AAMf,MAAMA,cAAcC,IAAAA,kCAAgB,EACzC,IAAIC,iBAAQ,CAAc;IAAEC,KAAK;AAAI,IACrC,OAAOC,UAAkBC,UACvBC,IAAAA,UAAK,EAACD,SAAS;QAAEE,UAAU;QAAWH;IAAS,GAAGI,KAAK,CAAC,IAAM,OAChE,CAACC,GAAGJ,UAAYK,IAAAA,kBAAU,EAAC,QAAQC,MAAM,CAACN,SAASO,MAAM,CAAC"}
|
||||
10
node_modules/next/dist/build/babel/loader/get-config.d.ts
generated
vendored
Normal file
10
node_modules/next/dist/build/babel/loader/get-config.d.ts
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
import type { NextBabelLoaderOptions, NextJsLoaderContext } from './types';
|
||||
type BabelConfig = any;
|
||||
export default function getConfig(this: NextJsLoaderContext, { source, target, loaderOptions, filename, inputSourceMap, }: {
|
||||
source: string;
|
||||
loaderOptions: NextBabelLoaderOptions;
|
||||
target: string;
|
||||
filename: string;
|
||||
inputSourceMap?: object | null;
|
||||
}): BabelConfig;
|
||||
export {};
|
||||
335
node_modules/next/dist/build/babel/loader/get-config.js
generated
vendored
Normal file
335
node_modules/next/dist/build/babel/loader/get-config.js
generated
vendored
Normal file
@ -0,0 +1,335 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return getConfig;
|
||||
}
|
||||
});
|
||||
const _fs = require("fs");
|
||||
const _json5 = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/json5"));
|
||||
const _core = require("next/dist/compiled/babel/core");
|
||||
const _corelibconfig = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/babel/core-lib-config"));
|
||||
const _util = require("./util");
|
||||
const _log = /*#__PURE__*/ _interop_require_wildcard(require("../../output/log"));
|
||||
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;
|
||||
}
|
||||
const nextDistPath = /(next[\\/]dist[\\/]shared[\\/]lib)|(next[\\/]dist[\\/]client)|(next[\\/]dist[\\/]pages)/;
|
||||
const fileExtensionRegex = /\.([a-z]+)$/;
|
||||
function getCacheCharacteristics(loaderOptions, source, filename) {
|
||||
var _fileExtensionRegex_exec;
|
||||
const { isServer, pagesDir } = loaderOptions;
|
||||
const isPageFile = filename.startsWith(pagesDir);
|
||||
const isNextDist = nextDistPath.test(filename);
|
||||
const hasModuleExports = source.indexOf("module.exports") !== -1;
|
||||
const fileExt = ((_fileExtensionRegex_exec = fileExtensionRegex.exec(filename)) == null ? void 0 : _fileExtensionRegex_exec[1]) || "unknown";
|
||||
return {
|
||||
isServer,
|
||||
isPageFile,
|
||||
isNextDist,
|
||||
hasModuleExports,
|
||||
fileExt
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Return an array of Babel plugins, conditioned upon loader options and
|
||||
* source file characteristics.
|
||||
*/ function getPlugins(loaderOptions, cacheCharacteristics) {
|
||||
const { isServer, isPageFile, isNextDist, hasModuleExports } = cacheCharacteristics;
|
||||
const { hasReactRefresh, development } = loaderOptions;
|
||||
const applyCommonJsItem = hasModuleExports ? (0, _core.createConfigItem)(require("../plugins/commonjs"), {
|
||||
type: "plugin"
|
||||
}) : null;
|
||||
const reactRefreshItem = hasReactRefresh ? (0, _core.createConfigItem)([
|
||||
require("next/dist/compiled/react-refresh/babel"),
|
||||
{
|
||||
skipEnvCheck: true
|
||||
}
|
||||
], {
|
||||
type: "plugin"
|
||||
}) : null;
|
||||
const pageConfigItem = !isServer && isPageFile ? (0, _core.createConfigItem)([
|
||||
require("../plugins/next-page-config")
|
||||
], {
|
||||
type: "plugin"
|
||||
}) : null;
|
||||
const disallowExportAllItem = !isServer && isPageFile ? (0, _core.createConfigItem)([
|
||||
require("../plugins/next-page-disallow-re-export-all-exports")
|
||||
], {
|
||||
type: "plugin"
|
||||
}) : null;
|
||||
const transformDefineItem = (0, _core.createConfigItem)([
|
||||
require.resolve("next/dist/compiled/babel/plugin-transform-define"),
|
||||
{
|
||||
"process.env.NODE_ENV": development ? "development" : "production",
|
||||
"typeof window": isServer ? "undefined" : "object",
|
||||
"process.browser": isServer ? false : true
|
||||
},
|
||||
"next-js-transform-define-instance"
|
||||
], {
|
||||
type: "plugin"
|
||||
});
|
||||
const nextSsgItem = !isServer && isPageFile ? (0, _core.createConfigItem)([
|
||||
require.resolve("../plugins/next-ssg-transform")
|
||||
], {
|
||||
type: "plugin"
|
||||
}) : null;
|
||||
const commonJsItem = isNextDist ? (0, _core.createConfigItem)(require("next/dist/compiled/babel/plugin-transform-modules-commonjs"), {
|
||||
type: "plugin"
|
||||
}) : null;
|
||||
const nextFontUnsupported = (0, _core.createConfigItem)([
|
||||
require("../plugins/next-font-unsupported")
|
||||
], {
|
||||
type: "plugin"
|
||||
});
|
||||
return [
|
||||
reactRefreshItem,
|
||||
pageConfigItem,
|
||||
disallowExportAllItem,
|
||||
applyCommonJsItem,
|
||||
transformDefineItem,
|
||||
nextSsgItem,
|
||||
commonJsItem,
|
||||
nextFontUnsupported
|
||||
].filter(Boolean);
|
||||
}
|
||||
const isJsonFile = /\.(json|babelrc)$/;
|
||||
const isJsFile = /\.js$/;
|
||||
/**
|
||||
* While this function does block execution while reading from disk, it
|
||||
* should not introduce any issues. The function is only invoked when
|
||||
* generating a fresh config, and only a small handful of configs should
|
||||
* be generated during compilation.
|
||||
*/ function getCustomBabelConfig(configFilePath) {
|
||||
if (isJsonFile.exec(configFilePath)) {
|
||||
const babelConfigRaw = (0, _fs.readFileSync)(configFilePath, "utf8");
|
||||
return _json5.default.parse(babelConfigRaw);
|
||||
} else if (isJsFile.exec(configFilePath)) {
|
||||
return require(configFilePath);
|
||||
}
|
||||
throw new Error("The Next.js Babel loader does not support .mjs or .cjs config files.");
|
||||
}
|
||||
let babelConfigWarned = false;
|
||||
/**
|
||||
* Check if custom babel configuration from user only contains options that
|
||||
* can be migrated into latest Next.js features supported by SWC.
|
||||
*
|
||||
* This raises soft warning messages only, not making any errors yet.
|
||||
*/ function checkCustomBabelConfigDeprecation(config) {
|
||||
if (!config || Object.keys(config).length === 0) {
|
||||
return;
|
||||
}
|
||||
const { plugins, presets, ...otherOptions } = config;
|
||||
if (Object.keys(otherOptions ?? {}).length > 0) {
|
||||
return;
|
||||
}
|
||||
if (babelConfigWarned) {
|
||||
return;
|
||||
}
|
||||
babelConfigWarned = true;
|
||||
const isPresetReadyToDeprecate = !presets || presets.length === 0 || presets.length === 1 && presets[0] === "next/babel";
|
||||
const pluginReasons = [];
|
||||
const unsupportedPlugins = [];
|
||||
if (Array.isArray(plugins)) {
|
||||
for (const plugin of plugins){
|
||||
const pluginName = Array.isArray(plugin) ? plugin[0] : plugin;
|
||||
// [NOTE]: We cannot detect if the user uses babel-plugin-macro based transform plugins,
|
||||
// such as `styled-components/macro` in here.
|
||||
switch(pluginName){
|
||||
case "styled-components":
|
||||
case "babel-plugin-styled-components":
|
||||
pluginReasons.push(`\t- 'styled-components' can be enabled via 'compiler.styledComponents' in 'next.config.js'`);
|
||||
break;
|
||||
case "@emotion/babel-plugin":
|
||||
pluginReasons.push(`\t- '@emotion/babel-plugin' can be enabled via 'compiler.emotion' in 'next.config.js'`);
|
||||
break;
|
||||
case "babel-plugin-relay":
|
||||
pluginReasons.push(`\t- 'babel-plugin-relay' can be enabled via 'compiler.relay' in 'next.config.js'`);
|
||||
break;
|
||||
case "react-remove-properties":
|
||||
pluginReasons.push(`\t- 'react-remove-properties' can be enabled via 'compiler.reactRemoveProperties' in 'next.config.js'`);
|
||||
break;
|
||||
case "transform-remove-console":
|
||||
pluginReasons.push(`\t- 'transform-remove-console' can be enabled via 'compiler.removeConsole' in 'next.config.js'`);
|
||||
break;
|
||||
default:
|
||||
unsupportedPlugins.push(pluginName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isPresetReadyToDeprecate && unsupportedPlugins.length === 0) {
|
||||
_log.warn(`It looks like there is a custom Babel configuration that can be removed${pluginReasons.length > 0 ? ":" : "."}`);
|
||||
if (pluginReasons.length > 0) {
|
||||
_log.warn(`Next.js supports the following features natively: `);
|
||||
_log.warn(pluginReasons.join(""));
|
||||
_log.warn(`For more details configuration options, please refer https://nextjs.org/docs/architecture/nextjs-compiler#supported-features`);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Generate a new, flat Babel config, ready to be handed to Babel-traverse.
|
||||
* This config should have no unresolved overrides, presets, etc.
|
||||
*/ function getFreshConfig(cacheCharacteristics, loaderOptions, target, filename, inputSourceMap) {
|
||||
let { isServer, pagesDir, development, hasJsxRuntime, configFile, srcDir } = loaderOptions;
|
||||
let customConfig = configFile ? getCustomBabelConfig(configFile) : undefined;
|
||||
checkCustomBabelConfigDeprecation(customConfig);
|
||||
let options = {
|
||||
babelrc: false,
|
||||
cloneInputAst: false,
|
||||
filename,
|
||||
inputSourceMap: inputSourceMap || undefined,
|
||||
// Set the default sourcemap behavior based on Webpack's mapping flag,
|
||||
// but allow users to override if they want.
|
||||
sourceMaps: loaderOptions.sourceMaps === undefined ? this.sourceMap : loaderOptions.sourceMaps,
|
||||
// Ensure that Webpack will get a full absolute path in the sourcemap
|
||||
// so that it can properly map the module back to its internal cached
|
||||
// modules.
|
||||
sourceFileName: filename,
|
||||
plugins: [
|
||||
...getPlugins(loaderOptions, cacheCharacteristics),
|
||||
...(customConfig == null ? void 0 : customConfig.plugins) || []
|
||||
],
|
||||
// target can be provided in babelrc
|
||||
target: isServer ? undefined : customConfig == null ? void 0 : customConfig.target,
|
||||
// env can be provided in babelrc
|
||||
env: customConfig == null ? void 0 : customConfig.env,
|
||||
presets: (()=>{
|
||||
// If presets is defined the user will have next/babel in their babelrc
|
||||
if (customConfig == null ? void 0 : customConfig.presets) {
|
||||
return customConfig.presets;
|
||||
}
|
||||
// If presets is not defined the user will likely have "env" in their babelrc
|
||||
if (customConfig) {
|
||||
return undefined;
|
||||
}
|
||||
// If no custom config is provided the default is to use next/babel
|
||||
return [
|
||||
"next/babel"
|
||||
];
|
||||
})(),
|
||||
overrides: loaderOptions.overrides,
|
||||
caller: {
|
||||
name: "next-babel-turbo-loader",
|
||||
supportsStaticESM: true,
|
||||
supportsDynamicImport: true,
|
||||
// Provide plugins with insight into webpack target.
|
||||
// https://github.com/babel/babel-loader/issues/787
|
||||
target: target,
|
||||
// Webpack 5 supports TLA behind a flag. We enable it by default
|
||||
// for Babel, and then webpack will throw an error if the experimental
|
||||
// flag isn't enabled.
|
||||
supportsTopLevelAwait: true,
|
||||
isServer,
|
||||
srcDir,
|
||||
pagesDir,
|
||||
isDev: development,
|
||||
hasJsxRuntime,
|
||||
...loaderOptions.caller
|
||||
}
|
||||
};
|
||||
// Babel does strict checks on the config so undefined is not allowed
|
||||
if (typeof options.target === "undefined") {
|
||||
delete options.target;
|
||||
}
|
||||
Object.defineProperty(options.caller, "onWarning", {
|
||||
enumerable: false,
|
||||
writable: false,
|
||||
value: (reason)=>{
|
||||
if (!(reason instanceof Error)) {
|
||||
reason = new Error(reason);
|
||||
}
|
||||
this.emitWarning(reason);
|
||||
}
|
||||
});
|
||||
const loadedOptions = (0, _core.loadOptions)(options);
|
||||
const config = (0, _util.consumeIterator)((0, _corelibconfig.default)(loadedOptions));
|
||||
return config;
|
||||
}
|
||||
/**
|
||||
* Each key returned here corresponds with a Babel config that can be shared.
|
||||
* The conditions of permissible sharing between files is dependent on specific
|
||||
* file attributes and Next.js compiler states: `CharacteristicsGermaneToCaching`.
|
||||
*/ function getCacheKey(cacheCharacteristics) {
|
||||
const { isServer, isPageFile, isNextDist, hasModuleExports, fileExt } = cacheCharacteristics;
|
||||
const flags = 0 | (isServer ? 1 : 0) | (isPageFile ? 2 : 0) | (isNextDist ? 4 : 0) | (hasModuleExports ? 8 : 0);
|
||||
return fileExt + flags;
|
||||
}
|
||||
const configCache = new Map();
|
||||
const configFiles = new Set();
|
||||
function getConfig({ source, target, loaderOptions, filename, inputSourceMap }) {
|
||||
const cacheCharacteristics = getCacheCharacteristics(loaderOptions, source, filename);
|
||||
if (loaderOptions.configFile) {
|
||||
// Ensures webpack invalidates the cache for this loader when the config file changes
|
||||
this.addDependency(loaderOptions.configFile);
|
||||
}
|
||||
const cacheKey = getCacheKey(cacheCharacteristics);
|
||||
if (configCache.has(cacheKey)) {
|
||||
const cachedConfig = configCache.get(cacheKey);
|
||||
return {
|
||||
...cachedConfig,
|
||||
options: {
|
||||
...cachedConfig.options,
|
||||
cwd: loaderOptions.cwd,
|
||||
root: loaderOptions.cwd,
|
||||
filename,
|
||||
sourceFileName: filename
|
||||
}
|
||||
};
|
||||
}
|
||||
if (loaderOptions.configFile && !configFiles.has(loaderOptions.configFile)) {
|
||||
configFiles.add(loaderOptions.configFile);
|
||||
_log.info(`Using external babel configuration from ${loaderOptions.configFile}`);
|
||||
}
|
||||
const freshConfig = getFreshConfig.call(this, cacheCharacteristics, loaderOptions, target, filename, inputSourceMap);
|
||||
configCache.set(cacheKey, freshConfig);
|
||||
return freshConfig;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=get-config.js.map
|
||||
1
node_modules/next/dist/build/babel/loader/get-config.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/babel/loader/get-config.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/next/dist/build/babel/loader/index.d.ts
generated
vendored
Normal file
3
node_modules/next/dist/build/babel/loader/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import type { NextJsLoaderContext } from './types';
|
||||
declare const nextBabelLoaderOuter: (this: NextJsLoaderContext, inputSource: string, inputSourceMap: object | null | undefined) => void;
|
||||
export default nextBabelLoaderOuter;
|
||||
38
node_modules/next/dist/build/babel/loader/index.js
generated
vendored
Normal file
38
node_modules/next/dist/build/babel/loader/index.js
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
const _transform = /*#__PURE__*/ _interop_require_default(require("./transform"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
async function nextBabelLoader(parentTrace, inputSource, inputSourceMap) {
|
||||
const filename = this.resourcePath;
|
||||
const target = this.target;
|
||||
const loaderOptions = parentTrace.traceChild("get-options")// @ts-ignore TODO: remove ignore once webpack 5 types are used
|
||||
.traceFn(()=>this.getOptions());
|
||||
const loaderSpanInner = parentTrace.traceChild("next-babel-turbo-transform");
|
||||
const { code: transformedSource, map: outputSourceMap } = loaderSpanInner.traceFn(()=>_transform.default.call(this, inputSource, inputSourceMap, loaderOptions, filename, target, loaderSpanInner));
|
||||
return [
|
||||
transformedSource,
|
||||
outputSourceMap
|
||||
];
|
||||
}
|
||||
const nextBabelLoaderOuter = function nextBabelLoaderOuter(inputSource, inputSourceMap) {
|
||||
const callback = this.async();
|
||||
const loaderSpan = this.currentTraceSpan.traceChild("next-babel-turbo-loader");
|
||||
loaderSpan.traceAsyncFn(()=>nextBabelLoader.call(this, loaderSpan, inputSource, inputSourceMap)).then(([transformedSource, outputSourceMap])=>callback == null ? void 0 : callback(null, transformedSource, outputSourceMap || inputSourceMap), (err)=>{
|
||||
callback == null ? void 0 : callback(err);
|
||||
});
|
||||
};
|
||||
const _default = nextBabelLoaderOuter;
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/next/dist/build/babel/loader/index.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/babel/loader/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/build/babel/loader/index.ts"],"names":["nextBabelLoader","parentTrace","inputSource","inputSourceMap","filename","resourcePath","target","loaderOptions","traceChild","traceFn","getOptions","loaderSpanInner","code","transformedSource","map","outputSourceMap","transform","call","nextBabelLoaderOuter","callback","async","loaderSpan","currentTraceSpan","traceAsyncFn","then","err"],"mappings":";;;;+BAuDA;;;eAAA;;;kEAtDsB;;;;;;AAGtB,eAAeA,gBAEbC,WAAiB,EACjBC,WAAmB,EACnBC,cAAyC;IAEzC,MAAMC,WAAW,IAAI,CAACC,YAAY;IAClC,MAAMC,SAAS,IAAI,CAACA,MAAM;IAC1B,MAAMC,gBAAgBN,YACnBO,UAAU,CAAC,cACZ,+DAA+D;KAC9DC,OAAO,CAAC,IAAM,IAAI,CAACC,UAAU;IAEhC,MAAMC,kBAAkBV,YAAYO,UAAU,CAAC;IAC/C,MAAM,EAAEI,MAAMC,iBAAiB,EAAEC,KAAKC,eAAe,EAAE,GACrDJ,gBAAgBF,OAAO,CAAC,IACtBO,kBAAS,CAACC,IAAI,CACZ,IAAI,EACJf,aACAC,gBACAI,eACAH,UACAE,QACAK;IAIN,OAAO;QAACE;QAAmBE;KAAgB;AAC7C;AAEA,MAAMG,uBAAuB,SAASA,qBAEpChB,WAAmB,EACnBC,cAAyC;IAEzC,MAAMgB,WAAW,IAAI,CAACC,KAAK;IAE3B,MAAMC,aAAa,IAAI,CAACC,gBAAgB,CAACd,UAAU,CAAC;IACpDa,WACGE,YAAY,CAAC,IACZvB,gBAAgBiB,IAAI,CAAC,IAAI,EAAEI,YAAYnB,aAAaC,iBAErDqB,IAAI,CACH,CAAC,CAACX,mBAAmBE,gBAAqB,GACxCI,4BAAAA,SAAW,MAAMN,mBAAmBE,mBAAmBZ,iBACzD,CAACsB;QACCN,4BAAAA,SAAWM;IACb;AAEN;MAEA,WAAeP"}
|
||||
14
node_modules/next/dist/build/babel/loader/transform.d.ts
generated
vendored
Normal file
14
node_modules/next/dist/build/babel/loader/transform.d.ts
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import type { Span } from '../../../trace';
|
||||
import type { NextJsLoaderContext } from './types';
|
||||
export default function transform(this: NextJsLoaderContext, source: string, inputSourceMap: object | null | undefined, loaderOptions: any, filename: string, target: string, parentSpan: Span): {
|
||||
code: string;
|
||||
map: {
|
||||
version: number;
|
||||
sources: string[];
|
||||
names: string[];
|
||||
sourceRoot?: string | undefined;
|
||||
sourcesContent?: string[] | undefined;
|
||||
mappings: string;
|
||||
file: string;
|
||||
} | null;
|
||||
};
|
||||
97
node_modules/next/dist/build/babel/loader/transform.js
generated
vendored
Normal file
97
node_modules/next/dist/build/babel/loader/transform.js
generated
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
/*
|
||||
* Partially adapted from @babel/core (MIT license).
|
||||
*/ "use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return transform;
|
||||
}
|
||||
});
|
||||
const _traverse = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/babel/traverse"));
|
||||
const _generator = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/babel/generator"));
|
||||
const _corelibnormalizefile = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/babel/core-lib-normalize-file"));
|
||||
const _corelibnormalizeopts = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/babel/core-lib-normalize-opts"));
|
||||
const _corelibblockhoistplugin = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/babel/core-lib-block-hoist-plugin"));
|
||||
const _corelibpluginpass = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/babel/core-lib-plugin-pass"));
|
||||
const _getconfig = /*#__PURE__*/ _interop_require_default(require("./get-config"));
|
||||
const _util = require("./util");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function getTraversalParams(file, pluginPairs) {
|
||||
const passPairs = [];
|
||||
const passes = [];
|
||||
const visitors = [];
|
||||
for (const plugin of pluginPairs.concat((0, _corelibblockhoistplugin.default)())){
|
||||
const pass = new _corelibpluginpass.default(file, plugin.key, plugin.options);
|
||||
passPairs.push([
|
||||
plugin,
|
||||
pass
|
||||
]);
|
||||
passes.push(pass);
|
||||
visitors.push(plugin.visitor);
|
||||
}
|
||||
return {
|
||||
passPairs,
|
||||
passes,
|
||||
visitors
|
||||
};
|
||||
}
|
||||
function invokePluginPre(file, passPairs) {
|
||||
for (const [{ pre }, pass] of passPairs){
|
||||
if (pre) {
|
||||
pre.call(pass, file);
|
||||
}
|
||||
}
|
||||
}
|
||||
function invokePluginPost(file, passPairs) {
|
||||
for (const [{ post }, pass] of passPairs){
|
||||
if (post) {
|
||||
post.call(pass, file);
|
||||
}
|
||||
}
|
||||
}
|
||||
function transformAstPass(file, pluginPairs, parentSpan) {
|
||||
const { passPairs, passes, visitors } = getTraversalParams(file, pluginPairs);
|
||||
invokePluginPre(file, passPairs);
|
||||
const visitor = _traverse.default.visitors.merge(visitors, passes, // @ts-ignore - the exported types are incorrect here
|
||||
file.opts.wrapPluginVisitorMethod);
|
||||
parentSpan.traceChild("babel-turbo-traverse").traceFn(()=>(0, _traverse.default)(file.ast, visitor, file.scope));
|
||||
invokePluginPost(file, passPairs);
|
||||
}
|
||||
function transformAst(file, babelConfig, parentSpan) {
|
||||
for (const pluginPairs of babelConfig.passes){
|
||||
transformAstPass(file, pluginPairs, parentSpan);
|
||||
}
|
||||
}
|
||||
function transform(source, inputSourceMap, loaderOptions, filename, target, parentSpan) {
|
||||
const getConfigSpan = parentSpan.traceChild("babel-turbo-get-config");
|
||||
const babelConfig = _getconfig.default.call(this, {
|
||||
source,
|
||||
loaderOptions,
|
||||
inputSourceMap,
|
||||
target,
|
||||
filename
|
||||
});
|
||||
getConfigSpan.stop();
|
||||
const normalizeSpan = parentSpan.traceChild("babel-turbo-normalize-file");
|
||||
const file = (0, _util.consumeIterator)((0, _corelibnormalizefile.default)(babelConfig.passes, (0, _corelibnormalizeopts.default)(babelConfig), source));
|
||||
normalizeSpan.stop();
|
||||
const transformSpan = parentSpan.traceChild("babel-turbo-transform");
|
||||
transformAst(file, babelConfig, transformSpan);
|
||||
transformSpan.stop();
|
||||
const generateSpan = parentSpan.traceChild("babel-turbo-generate");
|
||||
const { code, map } = (0, _generator.default)(file.ast, file.opts.generatorOpts, file.code);
|
||||
generateSpan.stop();
|
||||
return {
|
||||
code,
|
||||
map
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=transform.js.map
|
||||
1
node_modules/next/dist/build/babel/loader/transform.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/babel/loader/transform.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/build/babel/loader/transform.ts"],"names":["transform","getTraversalParams","file","pluginPairs","passPairs","passes","visitors","plugin","concat","loadBlockHoistPlugin","pass","PluginPass","key","options","push","visitor","invokePluginPre","pre","call","invokePluginPost","post","transformAstPass","parentSpan","traverse","merge","opts","wrapPluginVisitorMethod","traceChild","traceFn","ast","scope","transformAst","babelConfig","source","inputSourceMap","loaderOptions","filename","target","getConfigSpan","getConfig","stop","normalizeSpan","consumeIterator","normalizeFile","normalizeOpts","transformSpan","generateSpan","code","map","generate","generatorOpts"],"mappings":"AAAA;;CAEC;;;;+BAqED;;;eAAwBA;;;iEAnEH;kEACA;6EACK;6EACA;gFACO;0EACV;kEAED;sBACU;;;;;;AAIhC,SAASC,mBAAmBC,IAAS,EAAEC,WAAkB;IACvD,MAAMC,YAAY,EAAE;IACpB,MAAMC,SAAS,EAAE;IACjB,MAAMC,WAAW,EAAE;IAEnB,KAAK,MAAMC,UAAUJ,YAAYK,MAAM,CAACC,IAAAA,gCAAoB,KAAK;QAC/D,MAAMC,OAAO,IAAIC,0BAAU,CAACT,MAAMK,OAAOK,GAAG,EAAEL,OAAOM,OAAO;QAC5DT,UAAUU,IAAI,CAAC;YAACP;YAAQG;SAAK;QAC7BL,OAAOS,IAAI,CAACJ;QACZJ,SAASQ,IAAI,CAACP,OAAOQ,OAAO;IAC9B;IAEA,OAAO;QAAEX;QAAWC;QAAQC;IAAS;AACvC;AAEA,SAASU,gBAAgBd,IAAS,EAAEE,SAAgB;IAClD,KAAK,MAAM,CAAC,EAAEa,GAAG,EAAE,EAAEP,KAAK,IAAIN,UAAW;QACvC,IAAIa,KAAK;YACPA,IAAIC,IAAI,CAACR,MAAMR;QACjB;IACF;AACF;AAEA,SAASiB,iBAAiBjB,IAAS,EAAEE,SAAgB;IACnD,KAAK,MAAM,CAAC,EAAEgB,IAAI,EAAE,EAAEV,KAAK,IAAIN,UAAW;QACxC,IAAIgB,MAAM;YACRA,KAAKF,IAAI,CAACR,MAAMR;QAClB;IACF;AACF;AAEA,SAASmB,iBAAiBnB,IAAS,EAAEC,WAAkB,EAAEmB,UAAgB;IACvE,MAAM,EAAElB,SAAS,EAAEC,MAAM,EAAEC,QAAQ,EAAE,GAAGL,mBAAmBC,MAAMC;IAEjEa,gBAAgBd,MAAME;IACtB,MAAMW,UAAUQ,iBAAQ,CAACjB,QAAQ,CAACkB,KAAK,CACrClB,UACAD,QACA,qDAAqD;IACrDH,KAAKuB,IAAI,CAACC,uBAAuB;IAGnCJ,WACGK,UAAU,CAAC,wBACXC,OAAO,CAAC,IAAML,IAAAA,iBAAQ,EAACrB,KAAK2B,GAAG,EAAEd,SAASb,KAAK4B,KAAK;IAEvDX,iBAAiBjB,MAAME;AACzB;AAEA,SAAS2B,aAAa7B,IAAS,EAAE8B,WAAgB,EAAEV,UAAgB;IACjE,KAAK,MAAMnB,eAAe6B,YAAY3B,MAAM,CAAE;QAC5CgB,iBAAiBnB,MAAMC,aAAamB;IACtC;AACF;AAEe,SAAStB,UAEtBiC,MAAc,EACdC,cAAyC,EACzCC,aAAkB,EAClBC,QAAgB,EAChBC,MAAc,EACdf,UAAgB;IAEhB,MAAMgB,gBAAgBhB,WAAWK,UAAU,CAAC;IAC5C,MAAMK,cAAcO,kBAAS,CAACrB,IAAI,CAAC,IAAI,EAAE;QACvCe;QACAE;QACAD;QACAG;QACAD;IACF;IACAE,cAAcE,IAAI;IAElB,MAAMC,gBAAgBnB,WAAWK,UAAU,CAAC;IAC5C,MAAMzB,OAAOwC,IAAAA,qBAAe,EAC1BC,IAAAA,6BAAa,EAACX,YAAY3B,MAAM,EAAEuC,IAAAA,6BAAa,EAACZ,cAAcC;IAEhEQ,cAAcD,IAAI;IAElB,MAAMK,gBAAgBvB,WAAWK,UAAU,CAAC;IAC5CI,aAAa7B,MAAM8B,aAAaa;IAChCA,cAAcL,IAAI;IAElB,MAAMM,eAAexB,WAAWK,UAAU,CAAC;IAC3C,MAAM,EAAEoB,IAAI,EAAEC,GAAG,EAAE,GAAGC,IAAAA,kBAAQ,EAAC/C,KAAK2B,GAAG,EAAE3B,KAAKuB,IAAI,CAACyB,aAAa,EAAEhD,KAAK6C,IAAI;IAC3ED,aAAaN,IAAI;IAEjB,OAAO;QAAEO;QAAMC;IAAI;AACrB"}
|
||||
21
node_modules/next/dist/build/babel/loader/types.d.ts
generated
vendored
Normal file
21
node_modules/next/dist/build/babel/loader/types.d.ts
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
import type { webpack } from 'next/dist/compiled/webpack/webpack'
|
||||
import type { Span } from '../../../trace'
|
||||
|
||||
export interface NextJsLoaderContext extends webpack.LoaderContext<{}> {
|
||||
currentTraceSpan: Span
|
||||
target: string
|
||||
}
|
||||
|
||||
export interface NextBabelLoaderOptions {
|
||||
hasJsxRuntime: boolean
|
||||
hasReactRefresh: boolean
|
||||
isServer: boolean
|
||||
development: boolean
|
||||
pagesDir: string
|
||||
sourceMaps?: any[]
|
||||
overrides: any
|
||||
caller: any
|
||||
configFile: string | undefined
|
||||
cwd: string
|
||||
srcDir: string
|
||||
}
|
||||
1
node_modules/next/dist/build/babel/loader/util.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/build/babel/loader/util.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function consumeIterator(iter: Iterator<any>): any;
|
||||
20
node_modules/next/dist/build/babel/loader/util.js
generated
vendored
Normal file
20
node_modules/next/dist/build/babel/loader/util.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "consumeIterator", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return consumeIterator;
|
||||
}
|
||||
});
|
||||
function consumeIterator(iter) {
|
||||
while(true){
|
||||
const { value, done } = iter.next();
|
||||
if (done) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=util.js.map
|
||||
1
node_modules/next/dist/build/babel/loader/util.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/babel/loader/util.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/build/babel/loader/util.ts"],"names":["consumeIterator","iter","value","done","next"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA,gBAAgBC,IAAmB;IACjD,MAAO,KAAM;QACX,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGF,KAAKG,IAAI;QACjC,IAAID,MAAM;YACR,OAAOD;QACT;IACF;AACF"}
|
||||
2
node_modules/next/dist/build/babel/plugins/amp-attributes.d.ts
generated
vendored
Normal file
2
node_modules/next/dist/build/babel/plugins/amp-attributes.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
import type { PluginObj } from 'next/dist/compiled/babel/core';
|
||||
export default function AmpAttributePatcher(): PluginObj;
|
||||
36
node_modules/next/dist/build/babel/plugins/amp-attributes.js
generated
vendored
Normal file
36
node_modules/next/dist/build/babel/plugins/amp-attributes.js
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return AmpAttributePatcher;
|
||||
}
|
||||
});
|
||||
function AmpAttributePatcher() {
|
||||
return {
|
||||
visitor: {
|
||||
JSXOpeningElement (path) {
|
||||
const openingElement = path.node;
|
||||
const { name, attributes } = openingElement;
|
||||
if (!(name && name.type === "JSXIdentifier")) {
|
||||
return;
|
||||
}
|
||||
if (!name.name.startsWith("amp-")) {
|
||||
return;
|
||||
}
|
||||
for (const attribute of attributes){
|
||||
if (attribute.type !== "JSXAttribute") {
|
||||
continue;
|
||||
}
|
||||
if (attribute.name.name === "className") {
|
||||
attribute.name.name = "class";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=amp-attributes.js.map
|
||||
1
node_modules/next/dist/build/babel/plugins/amp-attributes.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/babel/plugins/amp-attributes.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/build/babel/plugins/amp-attributes.ts"],"names":["AmpAttributePatcher","visitor","JSXOpeningElement","path","openingElement","node","name","attributes","type","startsWith","attribute"],"mappings":";;;;+BAEA;;;eAAwBA;;;AAAT,SAASA;IACtB,OAAO;QACLC,SAAS;YACPC,mBAAkBC,IAAuC;gBACvD,MAAMC,iBAAiBD,KAAKE,IAAI;gBAEhC,MAAM,EAAEC,IAAI,EAAEC,UAAU,EAAE,GAAGH;gBAC7B,IAAI,CAAEE,CAAAA,QAAQA,KAAKE,IAAI,KAAK,eAAc,GAAI;oBAC5C;gBACF;gBAEA,IAAI,CAACF,KAAKA,IAAI,CAACG,UAAU,CAAC,SAAS;oBACjC;gBACF;gBAEA,KAAK,MAAMC,aAAaH,WAAY;oBAClC,IAAIG,UAAUF,IAAI,KAAK,gBAAgB;wBACrC;oBACF;oBAEA,IAAIE,UAAUJ,IAAI,CAACA,IAAI,KAAK,aAAa;wBACvCI,UAAUJ,IAAI,CAACA,IAAI,GAAG;oBACxB;gBACF;YACF;QACF;IACF;AACF"}
|
||||
2
node_modules/next/dist/build/babel/plugins/commonjs.d.ts
generated
vendored
Normal file
2
node_modules/next/dist/build/babel/plugins/commonjs.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
import type { PluginObj } from 'next/dist/compiled/babel/core';
|
||||
export default function CommonJSModulePlugin(...args: any): PluginObj;
|
||||
42
node_modules/next/dist/build/babel/plugins/commonjs.js
generated
vendored
Normal file
42
node_modules/next/dist/build/babel/plugins/commonjs.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, // Handle module.exports in user code
|
||||
"default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return CommonJSModulePlugin;
|
||||
}
|
||||
});
|
||||
const _plugintransformmodulescommonjs = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/babel/plugin-transform-modules-commonjs"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function CommonJSModulePlugin(...args) {
|
||||
const commonjs = (0, _plugintransformmodulescommonjs.default)(...args);
|
||||
return {
|
||||
visitor: {
|
||||
Program: {
|
||||
exit (path, state) {
|
||||
let foundModuleExports = false;
|
||||
path.traverse({
|
||||
MemberExpression (expressionPath) {
|
||||
if (expressionPath.node.object.name !== "module") return;
|
||||
if (expressionPath.node.property.name !== "exports") return;
|
||||
foundModuleExports = true;
|
||||
}
|
||||
});
|
||||
if (!foundModuleExports) {
|
||||
return;
|
||||
}
|
||||
commonjs.visitor.Program.exit.call(this, path, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=commonjs.js.map
|
||||
1
node_modules/next/dist/build/babel/plugins/commonjs.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/babel/plugins/commonjs.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/build/babel/plugins/commonjs.ts"],"names":["CommonJSModulePlugin","args","commonjs","commonjsPlugin","visitor","Program","exit","path","state","foundModuleExports","traverse","MemberExpression","expressionPath","node","object","name","property","call"],"mappings":";;;;+BAIA,qCAAqC;AACrC;;;eAAwBA;;;uFAHG;;;;;;AAGZ,SAASA,qBAAqB,GAAGC,IAAS;IACvD,MAAMC,WAAWC,IAAAA,uCAAc,KAAIF;IACnC,OAAO;QACLG,SAAS;YACPC,SAAS;gBACPC,MAAKC,IAA6B,EAAEC,KAAK;oBACvC,IAAIC,qBAAqB;oBACzBF,KAAKG,QAAQ,CAAC;wBACZC,kBAAiBC,cAAmB;4BAClC,IAAIA,eAAeC,IAAI,CAACC,MAAM,CAACC,IAAI,KAAK,UAAU;4BAClD,IAAIH,eAAeC,IAAI,CAACG,QAAQ,CAACD,IAAI,KAAK,WAAW;4BACrDN,qBAAqB;wBACvB;oBACF;oBAEA,IAAI,CAACA,oBAAoB;wBACvB;oBACF;oBAEAP,SAASE,OAAO,CAACC,OAAO,CAACC,IAAI,CAACW,IAAI,CAAC,IAAI,EAAEV,MAAMC;gBACjD;YACF;QACF;IACF;AACF"}
|
||||
5
node_modules/next/dist/build/babel/plugins/jsx-pragma.d.ts
generated
vendored
Normal file
5
node_modules/next/dist/build/babel/plugins/jsx-pragma.d.ts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import type { types as BabelTypes } from 'next/dist/compiled/babel/core';
|
||||
import type { PluginObj } from 'next/dist/compiled/babel/core';
|
||||
export default function ({ types: t, }: {
|
||||
types: typeof BabelTypes;
|
||||
}): PluginObj<any>;
|
||||
74
node_modules/next/dist/build/babel/plugins/jsx-pragma.js
generated
vendored
Normal file
74
node_modules/next/dist/build/babel/plugins/jsx-pragma.js
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
const _pluginsyntaxjsx = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/babel/plugin-syntax-jsx"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function _default({ types: t }) {
|
||||
return {
|
||||
inherits: _pluginsyntaxjsx.default,
|
||||
visitor: {
|
||||
JSXElement (_path, state) {
|
||||
state.set("jsx", true);
|
||||
},
|
||||
// Fragment syntax is still JSX since it compiles to createElement(),
|
||||
// but JSXFragment is not a JSXElement
|
||||
JSXFragment (_path, state) {
|
||||
state.set("jsx", true);
|
||||
},
|
||||
Program: {
|
||||
exit (path, state) {
|
||||
if (state.get("jsx")) {
|
||||
const pragma = t.identifier(state.opts.pragma);
|
||||
let importAs = pragma;
|
||||
// if there's already a React in scope, use that instead of adding an import
|
||||
const existingBinding = state.opts.reuseImport !== false && state.opts.importAs && path.scope.getBinding(state.opts.importAs);
|
||||
// var _jsx = _pragma.createElement;
|
||||
if (state.opts.property) {
|
||||
if (state.opts.importAs) {
|
||||
importAs = t.identifier(state.opts.importAs);
|
||||
} else {
|
||||
importAs = path.scope.generateUidIdentifier("pragma");
|
||||
}
|
||||
const mapping = t.variableDeclaration("var", [
|
||||
t.variableDeclarator(pragma, t.memberExpression(importAs, t.identifier(state.opts.property)))
|
||||
]);
|
||||
// if the React binding came from a require('react'),
|
||||
// make sure that our usage comes after it.
|
||||
let newPath;
|
||||
if (existingBinding && t.isVariableDeclarator(existingBinding.path.node) && t.isCallExpression(existingBinding.path.node.init) && t.isIdentifier(existingBinding.path.node.init.callee) && existingBinding.path.node.init.callee.name === "require") {
|
||||
[newPath] = existingBinding.path.parentPath.insertAfter(mapping);
|
||||
} else {
|
||||
[newPath] = path.unshiftContainer("body", mapping);
|
||||
}
|
||||
for (const declar of newPath.get("declarations")){
|
||||
path.scope.registerBinding(newPath.node.kind, declar);
|
||||
}
|
||||
}
|
||||
if (!existingBinding) {
|
||||
const importSpecifier = t.importDeclaration([
|
||||
state.opts.import ? t.importSpecifier(importAs, t.identifier(state.opts.import)) : state.opts.importNamespace ? t.importNamespaceSpecifier(importAs) : t.importDefaultSpecifier(importAs)
|
||||
], t.stringLiteral(state.opts.module || "react"));
|
||||
const [newPath] = path.unshiftContainer("body", importSpecifier);
|
||||
for (const specifier of newPath.get("specifiers")){
|
||||
path.scope.registerBinding("module", specifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=jsx-pragma.js.map
|
||||
1
node_modules/next/dist/build/babel/plugins/jsx-pragma.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/babel/plugins/jsx-pragma.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/build/babel/plugins/jsx-pragma.ts"],"names":["types","t","inherits","jsx","visitor","JSXElement","_path","state","set","JSXFragment","Program","exit","path","get","pragma","identifier","opts","importAs","existingBinding","reuseImport","scope","getBinding","property","generateUidIdentifier","mapping","variableDeclaration","variableDeclarator","memberExpression","newPath","isVariableDeclarator","node","isCallExpression","init","isIdentifier","callee","name","parentPath","insertAfter","unshiftContainer","declar","registerBinding","kind","importSpecifier","importDeclaration","import","importNamespace","importNamespaceSpecifier","importDefaultSpecifier","stringLiteral","module","specifier"],"mappings":"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"}
|
||||
2
node_modules/next/dist/build/babel/plugins/next-font-unsupported.d.ts
generated
vendored
Normal file
2
node_modules/next/dist/build/babel/plugins/next-font-unsupported.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
import type { PluginObj } from 'next/dist/compiled/babel/core';
|
||||
export default function NextPageDisallowReExportAllExports(): PluginObj<any>;
|
||||
32
node_modules/next/dist/build/babel/plugins/next-font-unsupported.js
generated
vendored
Normal file
32
node_modules/next/dist/build/babel/plugins/next-font-unsupported.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return NextPageDisallowReExportAllExports;
|
||||
}
|
||||
});
|
||||
function NextPageDisallowReExportAllExports() {
|
||||
return {
|
||||
visitor: {
|
||||
ImportDeclaration (path) {
|
||||
if ([
|
||||
"@next/font/local",
|
||||
"@next/font/google",
|
||||
"next/font/local",
|
||||
"next/font/google"
|
||||
].includes(path.node.source.value)) {
|
||||
var _path_node_loc, _path_node_loc1;
|
||||
const err = new SyntaxError(`"next/font" requires SWC although Babel is being used due to a custom babel config being present.\nRead more: https://nextjs.org/docs/messages/babel-font-loader-conflict`);
|
||||
err.code = "BABEL_PARSE_ERROR";
|
||||
err.loc = ((_path_node_loc = path.node.loc) == null ? void 0 : _path_node_loc.start) ?? ((_path_node_loc1 = path.node.loc) == null ? void 0 : _path_node_loc1.end) ?? path.node.loc;
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=next-font-unsupported.js.map
|
||||
1
node_modules/next/dist/build/babel/plugins/next-font-unsupported.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/babel/plugins/next-font-unsupported.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/build/babel/plugins/next-font-unsupported.ts"],"names":["NextPageDisallowReExportAllExports","visitor","ImportDeclaration","path","includes","node","source","value","err","SyntaxError","code","loc","start","end"],"mappings":";;;;+BAGA;;;eAAwBA;;;AAAT,SAASA;IACtB,OAAO;QACLC,SAAS;YACPC,mBAAkBC,IAAuC;gBACvD,IACE;oBACE;oBACA;oBACA;oBACA;iBACD,CAACC,QAAQ,CAACD,KAAKE,IAAI,CAACC,MAAM,CAACC,KAAK,GACjC;wBAMEJ,gBAAwBA;oBAL1B,MAAMK,MAAM,IAAIC,YACd,CAAC,yKAAyK,CAAC;oBAE3KD,IAAYE,IAAI,GAAG;oBACnBF,IAAYG,GAAG,GACfR,EAAAA,iBAAAA,KAAKE,IAAI,CAACM,GAAG,qBAAbR,eAAeS,KAAK,OAAIT,kBAAAA,KAAKE,IAAI,CAACM,GAAG,qBAAbR,gBAAeU,GAAG,KAAIV,KAAKE,IAAI,CAACM,GAAG;oBAC7D,MAAMH;gBACR;YACF;QACF;IACF;AACF"}
|
||||
5
node_modules/next/dist/build/babel/plugins/next-page-config.d.ts
generated
vendored
Normal file
5
node_modules/next/dist/build/babel/plugins/next-page-config.d.ts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { types as BabelTypes } from 'next/dist/compiled/babel/core';
|
||||
import type { PluginObj } from 'next/dist/compiled/babel/core';
|
||||
export default function nextPageConfig({ types: t, }: {
|
||||
types: typeof BabelTypes;
|
||||
}): PluginObj;
|
||||
116
node_modules/next/dist/build/babel/plugins/next-page-config.js
generated
vendored
Normal file
116
node_modules/next/dist/build/babel/plugins/next-page-config.js
generated
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, // config to parsing pageConfig for client bundles
|
||||
"default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return nextPageConfig;
|
||||
}
|
||||
});
|
||||
const _core = require("next/dist/compiled/babel/core");
|
||||
const _constants = require("../../../shared/lib/constants");
|
||||
const CONFIG_KEY = "config";
|
||||
// replace program path with just a variable with the drop identifier
|
||||
function replaceBundle(path, t) {
|
||||
path.parentPath.replaceWith(t.program([
|
||||
t.variableDeclaration("const", [
|
||||
t.variableDeclarator(t.identifier(_constants.STRING_LITERAL_DROP_BUNDLE), t.stringLiteral(`${_constants.STRING_LITERAL_DROP_BUNDLE} ${Date.now()}`))
|
||||
])
|
||||
], []));
|
||||
}
|
||||
function errorMessage(state, details) {
|
||||
const pageName = (state.filename || "").split(state.cwd || "").pop() || "unknown";
|
||||
return `Invalid page config export found. ${details} in file ${pageName}. See: https://nextjs.org/docs/messages/invalid-page-config`;
|
||||
}
|
||||
function nextPageConfig({ types: t }) {
|
||||
return {
|
||||
visitor: {
|
||||
Program: {
|
||||
enter (path, state) {
|
||||
path.traverse({
|
||||
ExportDeclaration (exportPath, exportState) {
|
||||
var _exportPath_node_specifiers;
|
||||
if (_core.types.isExportNamedDeclaration(exportPath.node) && ((_exportPath_node_specifiers = exportPath.node.specifiers) == null ? void 0 : _exportPath_node_specifiers.some((specifier)=>{
|
||||
return (t.isIdentifier(specifier.exported) ? specifier.exported.name : specifier.exported.value) === CONFIG_KEY;
|
||||
})) && _core.types.isStringLiteral(exportPath.node.source)) {
|
||||
throw new Error(errorMessage(exportState, "Expected object but got export from"));
|
||||
}
|
||||
},
|
||||
ExportNamedDeclaration (exportPath, exportState) {
|
||||
var _exportPath_node_declaration, _exportPath_scope_getBinding;
|
||||
if (exportState.bundleDropped || !exportPath.node.declaration && exportPath.node.specifiers.length === 0) {
|
||||
return;
|
||||
}
|
||||
const config = {};
|
||||
const declarations = [
|
||||
...((_exportPath_node_declaration = exportPath.node.declaration) == null ? void 0 : _exportPath_node_declaration.declarations) || [],
|
||||
(_exportPath_scope_getBinding = exportPath.scope.getBinding(CONFIG_KEY)) == null ? void 0 : _exportPath_scope_getBinding.path.node
|
||||
].filter(Boolean);
|
||||
for (const specifier of exportPath.node.specifiers){
|
||||
if ((t.isIdentifier(specifier.exported) ? specifier.exported.name : specifier.exported.value) === CONFIG_KEY) {
|
||||
// export {} from 'somewhere'
|
||||
if (_core.types.isStringLiteral(exportPath.node.source)) {
|
||||
throw new Error(errorMessage(exportState, `Expected object but got import`));
|
||||
// import hello from 'world'
|
||||
// export { hello as config }
|
||||
} else if (_core.types.isIdentifier(specifier.local)) {
|
||||
var _exportPath_scope_getBinding1;
|
||||
if (_core.types.isImportSpecifier((_exportPath_scope_getBinding1 = exportPath.scope.getBinding(specifier.local.name)) == null ? void 0 : _exportPath_scope_getBinding1.path.node)) {
|
||||
throw new Error(errorMessage(exportState, `Expected object but got import`));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const declaration of declarations){
|
||||
if (!_core.types.isIdentifier(declaration.id, {
|
||||
name: CONFIG_KEY
|
||||
})) {
|
||||
continue;
|
||||
}
|
||||
let { init } = declaration;
|
||||
if (_core.types.isTSAsExpression(init)) {
|
||||
init = init.expression;
|
||||
}
|
||||
if (!_core.types.isObjectExpression(init)) {
|
||||
const got = init ? init.type : "undefined";
|
||||
throw new Error(errorMessage(exportState, `Expected object but got ${got}`));
|
||||
}
|
||||
for (const prop of init.properties){
|
||||
if (_core.types.isSpreadElement(prop)) {
|
||||
throw new Error(errorMessage(exportState, `Property spread is not allowed`));
|
||||
}
|
||||
const { name } = prop.key;
|
||||
if (_core.types.isIdentifier(prop.key, {
|
||||
name: "amp"
|
||||
})) {
|
||||
if (!_core.types.isObjectProperty(prop)) {
|
||||
throw new Error(errorMessage(exportState, `Invalid property "${name}"`));
|
||||
}
|
||||
if (!_core.types.isBooleanLiteral(prop.value) && !_core.types.isStringLiteral(prop.value)) {
|
||||
throw new Error(errorMessage(exportState, `Invalid value for "${name}"`));
|
||||
}
|
||||
config.amp = prop.value.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (config.amp === true) {
|
||||
var _exportState_file_opts, _exportState_file;
|
||||
if (!((_exportState_file = exportState.file) == null ? void 0 : (_exportState_file_opts = _exportState_file.opts) == null ? void 0 : _exportState_file_opts.caller.isDev)) {
|
||||
// don't replace bundle in development so HMR can track
|
||||
// dependencies and trigger reload when they are changed
|
||||
replaceBundle(exportPath, t);
|
||||
}
|
||||
exportState.bundleDropped = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=next-page-config.js.map
|
||||
1
node_modules/next/dist/build/babel/plugins/next-page-config.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/babel/plugins/next-page-config.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/build/babel/plugins/next-page-config.ts"],"names":["nextPageConfig","CONFIG_KEY","replaceBundle","path","t","parentPath","replaceWith","program","variableDeclaration","variableDeclarator","identifier","STRING_LITERAL_DROP_BUNDLE","stringLiteral","Date","now","errorMessage","state","details","pageName","filename","split","cwd","pop","types","visitor","Program","enter","traverse","ExportDeclaration","exportPath","exportState","BabelTypes","isExportNamedDeclaration","node","specifiers","some","specifier","isIdentifier","exported","name","value","isStringLiteral","source","Error","ExportNamedDeclaration","bundleDropped","declaration","length","config","declarations","scope","getBinding","filter","Boolean","local","isImportSpecifier","id","init","isTSAsExpression","expression","isObjectExpression","got","type","prop","properties","isSpreadElement","key","isObjectProperty","isBooleanLiteral","amp","file","opts","caller","isDev"],"mappings":"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"}
|
||||
2
node_modules/next/dist/build/babel/plugins/next-page-disallow-re-export-all-exports.d.ts
generated
vendored
Normal file
2
node_modules/next/dist/build/babel/plugins/next-page-disallow-re-export-all-exports.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
import type { PluginObj } from 'next/dist/compiled/babel/core';
|
||||
export default function NextPageDisallowReExportAllExports(): PluginObj<any>;
|
||||
25
node_modules/next/dist/build/babel/plugins/next-page-disallow-re-export-all-exports.js
generated
vendored
Normal file
25
node_modules/next/dist/build/babel/plugins/next-page-disallow-re-export-all-exports.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return NextPageDisallowReExportAllExports;
|
||||
}
|
||||
});
|
||||
function NextPageDisallowReExportAllExports() {
|
||||
return {
|
||||
visitor: {
|
||||
ExportAllDeclaration (path) {
|
||||
var _path_node_loc, _path_node_loc1;
|
||||
const err = new SyntaxError(`Using \`export * from '...'\` in a page is disallowed. Please use \`export { default } from '...'\` instead.\n` + `Read more: https://nextjs.org/docs/messages/export-all-in-page`);
|
||||
err.code = "BABEL_PARSE_ERROR";
|
||||
err.loc = ((_path_node_loc = path.node.loc) == null ? void 0 : _path_node_loc.start) ?? ((_path_node_loc1 = path.node.loc) == null ? void 0 : _path_node_loc1.end) ?? path.node.loc;
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=next-page-disallow-re-export-all-exports.js.map
|
||||
1
node_modules/next/dist/build/babel/plugins/next-page-disallow-re-export-all-exports.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/babel/plugins/next-page-disallow-re-export-all-exports.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/build/babel/plugins/next-page-disallow-re-export-all-exports.ts"],"names":["NextPageDisallowReExportAllExports","visitor","ExportAllDeclaration","path","err","SyntaxError","code","loc","node","start","end"],"mappings":";;;;+BAGA;;;eAAwBA;;;AAAT,SAASA;IACtB,OAAO;QACLC,SAAS;YACPC,sBAAqBC,IAA0C;oBAO3DA,gBAAwBA;gBAN1B,MAAMC,MAAM,IAAIC,YACd,CAAC,8GAA8G,CAAC,GAC9G,CAAC,8DAA8D,CAAC;gBAElED,IAAYE,IAAI,GAAG;gBACnBF,IAAYG,GAAG,GACfJ,EAAAA,iBAAAA,KAAKK,IAAI,CAACD,GAAG,qBAAbJ,eAAeM,KAAK,OAAIN,kBAAAA,KAAKK,IAAI,CAACD,GAAG,qBAAbJ,gBAAeO,GAAG,KAAIP,KAAKK,IAAI,CAACD,GAAG;gBAC7D,MAAMH;YACR;QACF;IACF;AACF"}
|
||||
15
node_modules/next/dist/build/babel/plugins/next-ssg-transform.d.ts
generated
vendored
Normal file
15
node_modules/next/dist/build/babel/plugins/next-ssg-transform.d.ts
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
import type { NodePath, types as BabelTypes } from 'next/dist/compiled/babel/core';
|
||||
import type { PluginObj } from 'next/dist/compiled/babel/core';
|
||||
export declare const EXPORT_NAME_GET_STATIC_PROPS = "getStaticProps";
|
||||
export declare const EXPORT_NAME_GET_STATIC_PATHS = "getStaticPaths";
|
||||
export declare const EXPORT_NAME_GET_SERVER_PROPS = "getServerSideProps";
|
||||
type PluginState = {
|
||||
refs: Set<NodePath<BabelTypes.Identifier>>;
|
||||
isPrerender: boolean;
|
||||
isServerProps: boolean;
|
||||
done: boolean;
|
||||
};
|
||||
export default function nextTransformSsg({ types: t, }: {
|
||||
types: typeof BabelTypes;
|
||||
}): PluginObj<PluginState>;
|
||||
export {};
|
||||
328
node_modules/next/dist/build/babel/plugins/next-ssg-transform.js
generated
vendored
Normal file
328
node_modules/next/dist/build/babel/plugins/next-ssg-transform.js
generated
vendored
Normal file
@ -0,0 +1,328 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
EXPORT_NAME_GET_SERVER_PROPS: null,
|
||||
EXPORT_NAME_GET_STATIC_PATHS: null,
|
||||
EXPORT_NAME_GET_STATIC_PROPS: null,
|
||||
default: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
EXPORT_NAME_GET_SERVER_PROPS: function() {
|
||||
return EXPORT_NAME_GET_SERVER_PROPS;
|
||||
},
|
||||
EXPORT_NAME_GET_STATIC_PATHS: function() {
|
||||
return EXPORT_NAME_GET_STATIC_PATHS;
|
||||
},
|
||||
EXPORT_NAME_GET_STATIC_PROPS: function() {
|
||||
return EXPORT_NAME_GET_STATIC_PROPS;
|
||||
},
|
||||
default: function() {
|
||||
return nextTransformSsg;
|
||||
}
|
||||
});
|
||||
const _constants = require("../../../lib/constants");
|
||||
const _constants1 = require("../../../shared/lib/constants");
|
||||
const EXPORT_NAME_GET_STATIC_PROPS = "getStaticProps";
|
||||
const EXPORT_NAME_GET_STATIC_PATHS = "getStaticPaths";
|
||||
const EXPORT_NAME_GET_SERVER_PROPS = "getServerSideProps";
|
||||
const ssgExports = new Set([
|
||||
EXPORT_NAME_GET_STATIC_PROPS,
|
||||
EXPORT_NAME_GET_STATIC_PATHS,
|
||||
EXPORT_NAME_GET_SERVER_PROPS,
|
||||
// legacy methods added so build doesn't fail from importing
|
||||
// server-side only methods
|
||||
`unstable_getStaticProps`,
|
||||
`unstable_getStaticPaths`,
|
||||
`unstable_getServerProps`,
|
||||
`unstable_getServerSideProps`
|
||||
]);
|
||||
function decorateSsgExport(t, path, state) {
|
||||
const gsspName = state.isPrerender ? _constants1.STATIC_PROPS_ID : _constants1.SERVER_PROPS_ID;
|
||||
const gsspId = t.identifier(gsspName);
|
||||
const addGsspExport = (exportPath)=>{
|
||||
if (state.done) {
|
||||
return;
|
||||
}
|
||||
state.done = true;
|
||||
const [pageCompPath] = exportPath.replaceWithMultiple([
|
||||
t.exportNamedDeclaration(t.variableDeclaration(// We use 'var' instead of 'let' or 'const' for ES5 support. Since
|
||||
// this runs in `Program#exit`, no ES2015 transforms (preset env)
|
||||
// will be ran against this code.
|
||||
"var", [
|
||||
t.variableDeclarator(gsspId, t.booleanLiteral(true))
|
||||
]), [
|
||||
t.exportSpecifier(gsspId, gsspId)
|
||||
]),
|
||||
exportPath.node
|
||||
]);
|
||||
exportPath.scope.registerDeclaration(pageCompPath);
|
||||
};
|
||||
path.traverse({
|
||||
ExportDefaultDeclaration (exportDefaultPath) {
|
||||
addGsspExport(exportDefaultPath);
|
||||
},
|
||||
ExportNamedDeclaration (exportNamedPath) {
|
||||
addGsspExport(exportNamedPath);
|
||||
}
|
||||
});
|
||||
}
|
||||
const isDataIdentifier = (name, state)=>{
|
||||
if (ssgExports.has(name)) {
|
||||
if (name === EXPORT_NAME_GET_SERVER_PROPS) {
|
||||
if (state.isPrerender) {
|
||||
throw new Error(_constants.SERVER_PROPS_SSG_CONFLICT);
|
||||
}
|
||||
state.isServerProps = true;
|
||||
} else {
|
||||
if (state.isServerProps) {
|
||||
throw new Error(_constants.SERVER_PROPS_SSG_CONFLICT);
|
||||
}
|
||||
state.isPrerender = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
function nextTransformSsg({ types: t }) {
|
||||
function getIdentifier(path) {
|
||||
const parentPath = path.parentPath;
|
||||
if (parentPath.type === "VariableDeclarator") {
|
||||
const pp = parentPath;
|
||||
const name = pp.get("id");
|
||||
return name.node.type === "Identifier" ? name : null;
|
||||
}
|
||||
if (parentPath.type === "AssignmentExpression") {
|
||||
const pp = parentPath;
|
||||
const name = pp.get("left");
|
||||
return name.node.type === "Identifier" ? name : null;
|
||||
}
|
||||
if (path.node.type === "ArrowFunctionExpression") {
|
||||
return null;
|
||||
}
|
||||
return path.node.id && path.node.id.type === "Identifier" ? path.get("id") : null;
|
||||
}
|
||||
function isIdentifierReferenced(ident) {
|
||||
const b = ident.scope.getBinding(ident.node.name);
|
||||
if (b == null ? void 0 : b.referenced) {
|
||||
// Functions can reference themselves, so we need to check if there's a
|
||||
// binding outside the function scope or not.
|
||||
if (b.path.type === "FunctionDeclaration") {
|
||||
return !b.constantViolations.concat(b.referencePaths)// Check that every reference is contained within the function:
|
||||
.every((ref)=>ref.findParent((p)=>p === b.path));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function markFunction(path, state) {
|
||||
const ident = getIdentifier(path);
|
||||
if ((ident == null ? void 0 : ident.node) && isIdentifierReferenced(ident)) {
|
||||
state.refs.add(ident);
|
||||
}
|
||||
}
|
||||
function markImport(path, state) {
|
||||
const local = path.get("local");
|
||||
if (isIdentifierReferenced(local)) {
|
||||
state.refs.add(local);
|
||||
}
|
||||
}
|
||||
return {
|
||||
visitor: {
|
||||
Program: {
|
||||
enter (path, state) {
|
||||
state.refs = new Set();
|
||||
state.isPrerender = false;
|
||||
state.isServerProps = false;
|
||||
state.done = false;
|
||||
path.traverse({
|
||||
VariableDeclarator (variablePath, variableState) {
|
||||
if (variablePath.node.id.type === "Identifier") {
|
||||
const local = variablePath.get("id");
|
||||
if (isIdentifierReferenced(local)) {
|
||||
variableState.refs.add(local);
|
||||
}
|
||||
} else if (variablePath.node.id.type === "ObjectPattern") {
|
||||
const pattern = variablePath.get("id");
|
||||
const properties = pattern.get("properties");
|
||||
properties.forEach((p)=>{
|
||||
const local = p.get(p.node.type === "ObjectProperty" ? "value" : p.node.type === "RestElement" ? "argument" : function() {
|
||||
throw new Error("invariant");
|
||||
}());
|
||||
if (isIdentifierReferenced(local)) {
|
||||
variableState.refs.add(local);
|
||||
}
|
||||
});
|
||||
} else if (variablePath.node.id.type === "ArrayPattern") {
|
||||
const pattern = variablePath.get("id");
|
||||
const elements = pattern.get("elements");
|
||||
elements.forEach((e)=>{
|
||||
var _e_node, _e_node1;
|
||||
let local;
|
||||
if (((_e_node = e.node) == null ? void 0 : _e_node.type) === "Identifier") {
|
||||
local = e;
|
||||
} else if (((_e_node1 = e.node) == null ? void 0 : _e_node1.type) === "RestElement") {
|
||||
local = e.get("argument");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
if (isIdentifierReferenced(local)) {
|
||||
variableState.refs.add(local);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
FunctionDeclaration: markFunction,
|
||||
FunctionExpression: markFunction,
|
||||
ArrowFunctionExpression: markFunction,
|
||||
ImportSpecifier: markImport,
|
||||
ImportDefaultSpecifier: markImport,
|
||||
ImportNamespaceSpecifier: markImport,
|
||||
ExportNamedDeclaration (exportNamedPath, exportNamedState) {
|
||||
const specifiers = exportNamedPath.get("specifiers");
|
||||
if (specifiers.length) {
|
||||
specifiers.forEach((s)=>{
|
||||
if (isDataIdentifier(t.isIdentifier(s.node.exported) ? s.node.exported.name : s.node.exported.value, exportNamedState)) {
|
||||
s.remove();
|
||||
}
|
||||
});
|
||||
if (exportNamedPath.node.specifiers.length < 1) {
|
||||
exportNamedPath.remove();
|
||||
}
|
||||
return;
|
||||
}
|
||||
const decl = exportNamedPath.get("declaration");
|
||||
if (decl == null || decl.node == null) {
|
||||
return;
|
||||
}
|
||||
switch(decl.node.type){
|
||||
case "FunctionDeclaration":
|
||||
{
|
||||
const name = decl.node.id.name;
|
||||
if (isDataIdentifier(name, exportNamedState)) {
|
||||
exportNamedPath.remove();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "VariableDeclaration":
|
||||
{
|
||||
const inner = decl.get("declarations");
|
||||
inner.forEach((d)=>{
|
||||
if (d.node.id.type !== "Identifier") {
|
||||
return;
|
||||
}
|
||||
const name = d.node.id.name;
|
||||
if (isDataIdentifier(name, exportNamedState)) {
|
||||
d.remove();
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, state);
|
||||
if (!state.isPrerender && !state.isServerProps) {
|
||||
return;
|
||||
}
|
||||
const refs = state.refs;
|
||||
let count;
|
||||
function sweepFunction(sweepPath) {
|
||||
const ident = getIdentifier(sweepPath);
|
||||
if ((ident == null ? void 0 : ident.node) && refs.has(ident) && !isIdentifierReferenced(ident)) {
|
||||
++count;
|
||||
if (t.isAssignmentExpression(sweepPath.parentPath.node) || t.isVariableDeclarator(sweepPath.parentPath.node)) {
|
||||
sweepPath.parentPath.remove();
|
||||
} else {
|
||||
sweepPath.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
function sweepImport(sweepPath) {
|
||||
const local = sweepPath.get("local");
|
||||
if (refs.has(local) && !isIdentifierReferenced(local)) {
|
||||
++count;
|
||||
sweepPath.remove();
|
||||
if (sweepPath.parent.specifiers.length === 0) {
|
||||
sweepPath.parentPath.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
do {
|
||||
path.scope.crawl();
|
||||
count = 0;
|
||||
path.traverse({
|
||||
// eslint-disable-next-line no-loop-func
|
||||
VariableDeclarator (variablePath) {
|
||||
if (variablePath.node.id.type === "Identifier") {
|
||||
const local = variablePath.get("id");
|
||||
if (refs.has(local) && !isIdentifierReferenced(local)) {
|
||||
++count;
|
||||
variablePath.remove();
|
||||
}
|
||||
} else if (variablePath.node.id.type === "ObjectPattern") {
|
||||
const pattern = variablePath.get("id");
|
||||
const beforeCount = count;
|
||||
const properties = pattern.get("properties");
|
||||
properties.forEach((p)=>{
|
||||
const local = p.get(p.node.type === "ObjectProperty" ? "value" : p.node.type === "RestElement" ? "argument" : function() {
|
||||
throw new Error("invariant");
|
||||
}());
|
||||
if (refs.has(local) && !isIdentifierReferenced(local)) {
|
||||
++count;
|
||||
p.remove();
|
||||
}
|
||||
});
|
||||
if (beforeCount !== count && pattern.get("properties").length < 1) {
|
||||
variablePath.remove();
|
||||
}
|
||||
} else if (variablePath.node.id.type === "ArrayPattern") {
|
||||
const pattern = variablePath.get("id");
|
||||
const beforeCount = count;
|
||||
const elements = pattern.get("elements");
|
||||
elements.forEach((e)=>{
|
||||
var _e_node, _e_node1;
|
||||
let local;
|
||||
if (((_e_node = e.node) == null ? void 0 : _e_node.type) === "Identifier") {
|
||||
local = e;
|
||||
} else if (((_e_node1 = e.node) == null ? void 0 : _e_node1.type) === "RestElement") {
|
||||
local = e.get("argument");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
if (refs.has(local) && !isIdentifierReferenced(local)) {
|
||||
++count;
|
||||
e.remove();
|
||||
}
|
||||
});
|
||||
if (beforeCount !== count && pattern.get("elements").length < 1) {
|
||||
variablePath.remove();
|
||||
}
|
||||
}
|
||||
},
|
||||
FunctionDeclaration: sweepFunction,
|
||||
FunctionExpression: sweepFunction,
|
||||
ArrowFunctionExpression: sweepFunction,
|
||||
ImportSpecifier: sweepImport,
|
||||
ImportDefaultSpecifier: sweepImport,
|
||||
ImportNamespaceSpecifier: sweepImport
|
||||
});
|
||||
}while (count);
|
||||
decorateSsgExport(t, path, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=next-ssg-transform.js.map
|
||||
1
node_modules/next/dist/build/babel/plugins/next-ssg-transform.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/babel/plugins/next-ssg-transform.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
node_modules/next/dist/build/babel/plugins/optimize-hook-destructuring.d.ts
generated
vendored
Normal file
5
node_modules/next/dist/build/babel/plugins/optimize-hook-destructuring.d.ts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import type { types as BabelTypes } from 'next/dist/compiled/babel/core';
|
||||
import type { PluginObj } from 'next/dist/compiled/babel/core';
|
||||
export default function ({ types: t, }: {
|
||||
types: typeof BabelTypes;
|
||||
}): PluginObj<any>;
|
||||
60
node_modules/next/dist/build/babel/plugins/optimize-hook-destructuring.js
generated
vendored
Normal file
60
node_modules/next/dist/build/babel/plugins/optimize-hook-destructuring.js
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
// matches any hook-like (the default)
|
||||
const isHook = /^use[A-Z]/;
|
||||
// matches only built-in hooks provided by React et al
|
||||
const isBuiltInHook = /^use(Callback|Context|DebugValue|Effect|ImperativeHandle|LayoutEffect|Memo|Reducer|Ref|State)$/;
|
||||
function _default({ types: t }) {
|
||||
const visitor = {
|
||||
CallExpression (path, state) {
|
||||
const onlyBuiltIns = state.opts.onlyBuiltIns;
|
||||
// if specified, options.lib is a list of libraries that provide hook functions
|
||||
const libs = state.opts.lib && (state.opts.lib === true ? [
|
||||
"react",
|
||||
"preact/hooks"
|
||||
] : [].concat(state.opts.lib));
|
||||
// skip function calls that are not the init of a variable declaration:
|
||||
if (!t.isVariableDeclarator(path.parent)) return;
|
||||
// skip function calls where the return value is not Array-destructured:
|
||||
if (!t.isArrayPattern(path.parent.id)) return;
|
||||
// name of the (hook) function being called:
|
||||
const hookName = path.node.callee.name;
|
||||
if (libs) {
|
||||
const binding = path.scope.getBinding(hookName);
|
||||
// not an import
|
||||
if (!binding || binding.kind !== "module") return;
|
||||
const specifier = binding.path.parent.source.value;
|
||||
// not a match
|
||||
if (!libs.some((lib)=>lib === specifier)) return;
|
||||
}
|
||||
// only match function calls with names that look like a hook
|
||||
if (!(onlyBuiltIns ? isBuiltInHook : isHook).test(hookName)) return;
|
||||
path.parent.id = t.objectPattern(path.parent.id.elements.reduce((patterns, element, i)=>{
|
||||
if (element === null) {
|
||||
return patterns;
|
||||
}
|
||||
return patterns.concat(t.objectProperty(t.numericLiteral(i), // TODO: fix this
|
||||
element));
|
||||
}, []));
|
||||
}
|
||||
};
|
||||
return {
|
||||
name: "optimize-hook-destructuring",
|
||||
visitor: {
|
||||
// this is a workaround to run before preset-env destroys destructured assignments
|
||||
Program (path, state) {
|
||||
path.traverse(visitor, state);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=optimize-hook-destructuring.js.map
|
||||
1
node_modules/next/dist/build/babel/plugins/optimize-hook-destructuring.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/babel/plugins/optimize-hook-destructuring.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/build/babel/plugins/optimize-hook-destructuring.ts"],"names":["isHook","isBuiltInHook","types","t","visitor","CallExpression","path","state","onlyBuiltIns","opts","libs","lib","concat","isVariableDeclarator","parent","isArrayPattern","id","hookName","node","callee","name","binding","scope","getBinding","kind","specifier","source","value","some","test","objectPattern","elements","reduce","patterns","element","i","objectProperty","numericLiteral","Program","traverse"],"mappings":";;;;+BAYA;;;eAAA;;;AAPA,sCAAsC;AACtC,MAAMA,SAAS;AAEf,sDAAsD;AACtD,MAAMC,gBACJ;AAEa,SAAf,SAAyB,EACvBC,OAAOC,CAAC,EAGT;IACC,MAAMC,UAAU;QACdC,gBAAeC,IAAyC,EAAEC,KAAU;YAClE,MAAMC,eAAeD,MAAME,IAAI,CAACD,YAAY;YAE5C,+EAA+E;YAC/E,MAAME,OACJH,MAAME,IAAI,CAACE,GAAG,IACbJ,CAAAA,MAAME,IAAI,CAACE,GAAG,KAAK,OAChB;gBAAC;gBAAS;aAAe,GACzB,EAAE,CAACC,MAAM,CAACL,MAAME,IAAI,CAACE,GAAG,CAAA;YAE9B,uEAAuE;YACvE,IAAI,CAACR,EAAEU,oBAAoB,CAACP,KAAKQ,MAAM,GAAG;YAE1C,wEAAwE;YACxE,IAAI,CAACX,EAAEY,cAAc,CAACT,KAAKQ,MAAM,CAACE,EAAE,GAAG;YAEvC,4CAA4C;YAC5C,MAAMC,WAAW,AAACX,KAAKY,IAAI,CAACC,MAAM,CAA2BC,IAAI;YAEjE,IAAIV,MAAM;gBACR,MAAMW,UAAUf,KAAKgB,KAAK,CAACC,UAAU,CAACN;gBACtC,gBAAgB;gBAChB,IAAI,CAACI,WAAWA,QAAQG,IAAI,KAAK,UAAU;gBAE3C,MAAMC,YAAY,AAACJ,QAAQf,IAAI,CAACQ,MAAM,CACnCY,MAAM,CAACC,KAAK;gBACf,cAAc;gBACd,IAAI,CAACjB,KAAKkB,IAAI,CAAC,CAACjB,MAAaA,QAAQc,YAAY;YACnD;YAEA,6DAA6D;YAC7D,IAAI,CAAC,AAACjB,CAAAA,eAAeP,gBAAgBD,MAAK,EAAG6B,IAAI,CAACZ,WAAW;YAE7DX,KAAKQ,MAAM,CAACE,EAAE,GAAGb,EAAE2B,aAAa,CAC9BxB,KAAKQ,MAAM,CAACE,EAAE,CAACe,QAAQ,CAACC,MAAM,CAC5B,CAACC,UAAUC,SAASC;gBAClB,IAAID,YAAY,MAAM;oBACpB,OAAOD;gBACT;gBAEA,OAAOA,SAASrB,MAAM,CACpBT,EAAEiC,cAAc,CACdjC,EAAEkC,cAAc,CAACF,IACjB,iBAAiB;gBACjBD;YAMN,GACA,EAAE;QAGR;IACF;IAEA,OAAO;QACLd,MAAM;QACNhB,SAAS;YACP,kFAAkF;YAClFkC,SAAQhC,IAAI,EAAEC,KAAK;gBACjBD,KAAKiC,QAAQ,CAACnC,SAASG;YACzB;QACF;IACF;AACF"}
|
||||
25
node_modules/next/dist/build/babel/plugins/react-loadable-plugin.d.ts
generated
vendored
Normal file
25
node_modules/next/dist/build/babel/plugins/react-loadable-plugin.d.ts
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/**
|
||||
COPYRIGHT (c) 2017-present James Kyle <me@thejameskyle.com>
|
||||
MIT License
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWAR
|
||||
*/
|
||||
import type { types as BabelTypes } from 'next/dist/compiled/babel/core';
|
||||
import type { PluginObj } from 'next/dist/compiled/babel/core';
|
||||
export default function ({ types: t, }: {
|
||||
types: typeof BabelTypes;
|
||||
}): PluginObj;
|
||||
150
node_modules/next/dist/build/babel/plugins/react-loadable-plugin.js
generated
vendored
Normal file
150
node_modules/next/dist/build/babel/plugins/react-loadable-plugin.js
generated
vendored
Normal file
@ -0,0 +1,150 @@
|
||||
/**
|
||||
COPYRIGHT (c) 2017-present James Kyle <me@thejameskyle.com>
|
||||
MIT License
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWAR
|
||||
*/ // This file is https://github.com/jamiebuilds/react-loadable/blob/master/src/babel.js
|
||||
// Modified to also look for `next/dynamic`
|
||||
// Modified to put `webpack` and `modules` under `loadableGenerated` to be backwards compatible with next/dynamic which has a `modules` key
|
||||
// Modified to support `dynamic(import('something'))` and `dynamic(import('something'), options)
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
const _path = require("path");
|
||||
function _default({ types: t }) {
|
||||
return {
|
||||
visitor: {
|
||||
ImportDeclaration (path, state) {
|
||||
let source = path.node.source.value;
|
||||
if (source !== "next/dynamic") return;
|
||||
let defaultSpecifier = path.get("specifiers").find((specifier)=>{
|
||||
return specifier.isImportDefaultSpecifier();
|
||||
});
|
||||
if (!defaultSpecifier) return;
|
||||
const bindingName = defaultSpecifier.node.local.name;
|
||||
const binding = path.scope.getBinding(bindingName);
|
||||
if (!binding) {
|
||||
return;
|
||||
}
|
||||
binding.referencePaths.forEach((refPath)=>{
|
||||
var _state_file_opts_caller, _state_file_opts_caller1;
|
||||
let callExpression = refPath.parentPath;
|
||||
if (callExpression.isMemberExpression() && callExpression.node.computed === false) {
|
||||
const property = callExpression.get("property");
|
||||
if (!Array.isArray(property) && property.isIdentifier({
|
||||
name: "Map"
|
||||
})) {
|
||||
callExpression = callExpression.parentPath;
|
||||
}
|
||||
}
|
||||
if (!callExpression.isCallExpression()) return;
|
||||
const callExpression_ = callExpression;
|
||||
let args = callExpression_.get("arguments");
|
||||
if (args.length > 2) {
|
||||
throw callExpression_.buildCodeFrameError("next/dynamic only accepts 2 arguments");
|
||||
}
|
||||
if (!args[0]) {
|
||||
return;
|
||||
}
|
||||
let loader;
|
||||
let options;
|
||||
if (args[0].isObjectExpression()) {
|
||||
options = args[0];
|
||||
} else {
|
||||
if (!args[1]) {
|
||||
callExpression_.node.arguments.push(t.objectExpression([]));
|
||||
}
|
||||
// This is needed as the code is modified above
|
||||
args = callExpression_.get("arguments");
|
||||
loader = args[0];
|
||||
options = args[1];
|
||||
}
|
||||
if (!options.isObjectExpression()) return;
|
||||
const options_ = options;
|
||||
let properties = options_.get("properties");
|
||||
let propertiesMap = {};
|
||||
properties.forEach((property)=>{
|
||||
const key = property.get("key");
|
||||
propertiesMap[key.node.name] = property;
|
||||
});
|
||||
if (propertiesMap.loadableGenerated) {
|
||||
return;
|
||||
}
|
||||
if (propertiesMap.loader) {
|
||||
loader = propertiesMap.loader.get("value");
|
||||
}
|
||||
if (propertiesMap.modules) {
|
||||
loader = propertiesMap.modules.get("value");
|
||||
}
|
||||
if (!loader || Array.isArray(loader)) {
|
||||
return;
|
||||
}
|
||||
const dynamicImports = [];
|
||||
const dynamicKeys = [];
|
||||
if (propertiesMap.ssr) {
|
||||
const ssr = propertiesMap.ssr.get("value");
|
||||
const nodePath = Array.isArray(ssr) ? undefined : ssr;
|
||||
if (nodePath) {
|
||||
var _state_file_opts_caller2;
|
||||
const nonSSR = nodePath.node.type === "BooleanLiteral" && nodePath.node.value === false;
|
||||
// If `ssr` is set to `false`, erase the loader for server side
|
||||
if (nonSSR && loader && ((_state_file_opts_caller2 = state.file.opts.caller) == null ? void 0 : _state_file_opts_caller2.isServer)) {
|
||||
loader.replaceWith(t.arrowFunctionExpression([], t.nullLiteral(), true));
|
||||
}
|
||||
}
|
||||
}
|
||||
loader.traverse({
|
||||
Import (importPath) {
|
||||
var _state_file_opts_caller;
|
||||
const importArguments = importPath.parentPath.get("arguments");
|
||||
if (!Array.isArray(importArguments)) return;
|
||||
const node = importArguments[0].node;
|
||||
dynamicImports.push(node);
|
||||
dynamicKeys.push(t.binaryExpression("+", t.stringLiteral((((_state_file_opts_caller = state.file.opts.caller) == null ? void 0 : _state_file_opts_caller.srcDir) ? (0, _path.relative)(state.file.opts.caller.srcDir, state.file.opts.filename) : state.file.opts.filename) + " -> "), node));
|
||||
}
|
||||
});
|
||||
if (!dynamicImports.length) return;
|
||||
options.node.properties.push(t.objectProperty(t.identifier("loadableGenerated"), t.objectExpression(((_state_file_opts_caller = state.file.opts.caller) == null ? void 0 : _state_file_opts_caller.isDev) || ((_state_file_opts_caller1 = state.file.opts.caller) == null ? void 0 : _state_file_opts_caller1.isServer) ? [
|
||||
t.objectProperty(t.identifier("modules"), t.arrayExpression(dynamicKeys))
|
||||
] : [
|
||||
t.objectProperty(t.identifier("webpack"), t.arrowFunctionExpression([], t.arrayExpression(dynamicImports.map((dynamicImport)=>{
|
||||
return t.callExpression(t.memberExpression(t.identifier("require"), t.identifier("resolveWeak")), [
|
||||
dynamicImport
|
||||
]);
|
||||
}))))
|
||||
])));
|
||||
// Turns `dynamic(import('something'))` into `dynamic(() => import('something'))` for backwards compat.
|
||||
// This is the replicate the behavior in versions below Next.js 7 where we magically handled not executing the `import()` too.
|
||||
// We'll deprecate this behavior and provide a codemod for it in 7.1.
|
||||
if (loader.isCallExpression()) {
|
||||
const arrowFunction = t.arrowFunctionExpression([], loader.node);
|
||||
loader.replaceWith(arrowFunction);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=react-loadable-plugin.js.map
|
||||
1
node_modules/next/dist/build/babel/plugins/react-loadable-plugin.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/babel/plugins/react-loadable-plugin.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/build/babel/plugins/react-loadable-plugin.ts"],"names":["types","t","visitor","ImportDeclaration","path","state","source","node","value","defaultSpecifier","get","find","specifier","isImportDefaultSpecifier","bindingName","local","name","binding","scope","getBinding","referencePaths","forEach","refPath","callExpression","parentPath","isMemberExpression","computed","property","Array","isArray","isIdentifier","isCallExpression","callExpression_","args","length","buildCodeFrameError","loader","options","isObjectExpression","arguments","push","objectExpression","options_","properties","propertiesMap","key","loadableGenerated","modules","dynamicImports","dynamicKeys","ssr","nodePath","undefined","nonSSR","type","file","opts","caller","isServer","replaceWith","arrowFunctionExpression","nullLiteral","traverse","Import","importPath","importArguments","binaryExpression","stringLiteral","srcDir","relativePath","filename","objectProperty","identifier","isDev","arrayExpression","map","dynamicImport","memberExpression","arrowFunction"],"mappings":"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"}
|
||||
25
node_modules/next/dist/build/babel/preset.d.ts
generated
vendored
Normal file
25
node_modules/next/dist/build/babel/preset.d.ts
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
import type { PluginItem } from 'next/dist/compiled/babel/core';
|
||||
type StyledJsxPlugin = [string, any] | string;
|
||||
type StyledJsxBabelOptions = {
|
||||
plugins?: StyledJsxPlugin[];
|
||||
styleModule?: string;
|
||||
'babel-test'?: boolean;
|
||||
} | undefined;
|
||||
type NextBabelPresetOptions = {
|
||||
'preset-env'?: any;
|
||||
'preset-react'?: any;
|
||||
'class-properties'?: any;
|
||||
'transform-runtime'?: any;
|
||||
'styled-jsx'?: StyledJsxBabelOptions;
|
||||
'preset-typescript'?: any;
|
||||
};
|
||||
type BabelPreset = {
|
||||
presets?: PluginItem[] | null;
|
||||
plugins?: PluginItem[] | null;
|
||||
sourceType?: 'script' | 'module' | 'unambiguous';
|
||||
overrides?: Array<{
|
||||
test: RegExp;
|
||||
} & Omit<BabelPreset, 'overrides'>>;
|
||||
};
|
||||
declare const _default: (api: any, options?: NextBabelPresetOptions) => BabelPreset;
|
||||
export default _default;
|
||||
162
node_modules/next/dist/build/babel/preset.js
generated
vendored
Normal file
162
node_modules/next/dist/build/babel/preset.js
generated
vendored
Normal file
@ -0,0 +1,162 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
const _path = require("path");
|
||||
const isLoadIntentTest = process.env.NODE_ENV === "test";
|
||||
const isLoadIntentDevelopment = process.env.NODE_ENV === "development";
|
||||
// Resolve styled-jsx plugins
|
||||
function styledJsxOptions(options) {
|
||||
options = options || {};
|
||||
options.styleModule = "styled-jsx/style";
|
||||
if (!Array.isArray(options.plugins)) {
|
||||
return options;
|
||||
}
|
||||
options.plugins = options.plugins.map((plugin)=>{
|
||||
if (Array.isArray(plugin)) {
|
||||
const [name, pluginOptions] = plugin;
|
||||
return [
|
||||
require.resolve(name),
|
||||
pluginOptions
|
||||
];
|
||||
}
|
||||
return require.resolve(plugin);
|
||||
});
|
||||
return options;
|
||||
}
|
||||
// Taken from https://github.com/babel/babel/commit/d60c5e1736543a6eac4b549553e107a9ba967051#diff-b4beead8ad9195361b4537601cc22532R158
|
||||
function supportsStaticESM(caller) {
|
||||
return !!(caller == null ? void 0 : caller.supportsStaticESM);
|
||||
}
|
||||
const _default = (api, options = {})=>{
|
||||
var _options_presetreact, _options_presetreact1;
|
||||
const supportsESM = api.caller(supportsStaticESM);
|
||||
const isServer = api.caller((caller)=>!!caller && caller.isServer);
|
||||
const isCallerDevelopment = api.caller((caller)=>caller == null ? void 0 : caller.isDev);
|
||||
// Look at external intent if used without a caller (e.g. via Jest):
|
||||
const isTest = isCallerDevelopment == null && isLoadIntentTest;
|
||||
// Look at external intent if used without a caller (e.g. Storybook):
|
||||
const isDevelopment = isCallerDevelopment === true || isCallerDevelopment == null && isLoadIntentDevelopment;
|
||||
// Default to production mode if not `test` nor `development`:
|
||||
const isProduction = !(isTest || isDevelopment);
|
||||
const isBabelLoader = api.caller((caller)=>!!caller && (caller.name === "babel-loader" || caller.name === "next-babel-turbo-loader"));
|
||||
const useJsxRuntime = ((_options_presetreact = options["preset-react"]) == null ? void 0 : _options_presetreact.runtime) === "automatic" || Boolean(api.caller((caller)=>!!caller && caller.hasJsxRuntime)) && ((_options_presetreact1 = options["preset-react"]) == null ? void 0 : _options_presetreact1.runtime) !== "classic";
|
||||
const presetEnvConfig = {
|
||||
// In the test environment `modules` is often needed to be set to true, babel figures that out by itself using the `'auto'` option
|
||||
// In production/development this option is set to `false` so that webpack can handle import/export with tree-shaking
|
||||
modules: "auto",
|
||||
exclude: [
|
||||
"transform-typeof-symbol"
|
||||
],
|
||||
...options["preset-env"]
|
||||
};
|
||||
// When transpiling for the server or tests, target the current Node version
|
||||
// if not explicitly specified:
|
||||
if ((isServer || isTest) && (!presetEnvConfig.targets || !(typeof presetEnvConfig.targets === "object" && "node" in presetEnvConfig.targets))) {
|
||||
presetEnvConfig.targets = {
|
||||
// Targets the current process' version of Node. This requires apps be
|
||||
// built and deployed on the same version of Node.
|
||||
// This is the same as using "current" but explicit
|
||||
node: process.versions.node
|
||||
};
|
||||
}
|
||||
return {
|
||||
sourceType: "unambiguous",
|
||||
presets: [
|
||||
[
|
||||
require("next/dist/compiled/babel/preset-env"),
|
||||
presetEnvConfig
|
||||
],
|
||||
[
|
||||
require("next/dist/compiled/babel/preset-react"),
|
||||
{
|
||||
// This adds @babel/plugin-transform-react-jsx-source and
|
||||
// @babel/plugin-transform-react-jsx-self automatically in development
|
||||
development: isDevelopment || isTest,
|
||||
...useJsxRuntime ? {
|
||||
runtime: "automatic"
|
||||
} : {
|
||||
pragma: "__jsx"
|
||||
},
|
||||
...options["preset-react"]
|
||||
}
|
||||
],
|
||||
[
|
||||
require("next/dist/compiled/babel/preset-typescript"),
|
||||
{
|
||||
allowNamespaces: true,
|
||||
...options["preset-typescript"]
|
||||
}
|
||||
]
|
||||
],
|
||||
plugins: [
|
||||
!useJsxRuntime && [
|
||||
require("./plugins/jsx-pragma"),
|
||||
{
|
||||
// This produces the following injected import for modules containing JSX:
|
||||
// import React from 'react';
|
||||
// var __jsx = React.createElement;
|
||||
module: "react",
|
||||
importAs: "React",
|
||||
pragma: "__jsx",
|
||||
property: "createElement"
|
||||
}
|
||||
],
|
||||
[
|
||||
require("./plugins/optimize-hook-destructuring"),
|
||||
{
|
||||
// only optimize hook functions imported from React/Preact
|
||||
lib: true
|
||||
}
|
||||
],
|
||||
require("next/dist/compiled/babel/plugin-syntax-dynamic-import"),
|
||||
require("next/dist/compiled/babel/plugin-syntax-import-assertions"),
|
||||
require("./plugins/react-loadable-plugin"),
|
||||
[
|
||||
require("next/dist/compiled/babel/plugin-proposal-class-properties"),
|
||||
options["class-properties"] || {}
|
||||
],
|
||||
[
|
||||
require("next/dist/compiled/babel/plugin-proposal-object-rest-spread"),
|
||||
{
|
||||
useBuiltIns: true
|
||||
}
|
||||
],
|
||||
!isServer && [
|
||||
require("next/dist/compiled/babel/plugin-transform-runtime"),
|
||||
{
|
||||
corejs: false,
|
||||
helpers: true,
|
||||
regenerator: true,
|
||||
useESModules: supportsESM && presetEnvConfig.modules !== "commonjs",
|
||||
absoluteRuntime: isBabelLoader ? (0, _path.dirname)(require.resolve("next/dist/compiled/@babel/runtime/package.json")) : undefined,
|
||||
...options["transform-runtime"]
|
||||
}
|
||||
],
|
||||
[
|
||||
isTest && options["styled-jsx"] && options["styled-jsx"]["babel-test"] ? require("styled-jsx/babel-test") : require("styled-jsx/babel"),
|
||||
styledJsxOptions(options["styled-jsx"])
|
||||
],
|
||||
require("./plugins/amp-attributes"),
|
||||
isProduction && [
|
||||
require("next/dist/compiled/babel/plugin-transform-react-remove-prop-types"),
|
||||
{
|
||||
removeImport: true
|
||||
}
|
||||
],
|
||||
isServer && require("next/dist/compiled/babel/plugin-syntax-bigint"),
|
||||
// Always compile numeric separator because the resulting number is
|
||||
// smaller.
|
||||
require("next/dist/compiled/babel/plugin-proposal-numeric-separator"),
|
||||
require("next/dist/compiled/babel/plugin-proposal-export-namespace-from")
|
||||
].filter(Boolean)
|
||||
};
|
||||
};
|
||||
|
||||
//# sourceMappingURL=preset.js.map
|
||||
1
node_modules/next/dist/build/babel/preset.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/babel/preset.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/build/babel/preset.ts"],"names":["isLoadIntentTest","process","env","NODE_ENV","isLoadIntentDevelopment","styledJsxOptions","options","styleModule","Array","isArray","plugins","map","plugin","name","pluginOptions","require","resolve","supportsStaticESM","caller","api","supportsESM","isServer","isCallerDevelopment","isDev","isTest","isDevelopment","isProduction","isBabelLoader","useJsxRuntime","runtime","Boolean","hasJsxRuntime","presetEnvConfig","modules","exclude","targets","node","versions","sourceType","presets","development","pragma","allowNamespaces","module","importAs","property","lib","useBuiltIns","corejs","helpers","regenerator","useESModules","absoluteRuntime","dirname","undefined","removeImport","filter"],"mappings":"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"}
|
||||
51
node_modules/next/dist/build/build-context.d.ts
generated
vendored
Normal file
51
node_modules/next/dist/build/build-context.d.ts
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
import type { LoadedEnvFiles } from '@next/env';
|
||||
import type { Rewrite, Redirect } from '../lib/load-custom-routes';
|
||||
import type { __ApiPreviewProps } from '../server/api-utils';
|
||||
import type { NextConfigComplete } from '../server/config-shared';
|
||||
import type { Span } from '../trace';
|
||||
import type getBaseWebpackConfig from './webpack-config';
|
||||
import type { TelemetryPluginState } from './webpack/plugins/telemetry-plugin';
|
||||
import type { Telemetry } from '../telemetry/storage';
|
||||
export declare function resumePluginState(resumedState?: Record<string, any>): void;
|
||||
export declare function getProxiedPluginState<State extends Record<string, any>>(initialState: State): State;
|
||||
export declare function getPluginState(): Record<string, any>;
|
||||
export interface MappedPages {
|
||||
[page: string]: string;
|
||||
}
|
||||
export declare const NextBuildContext: Partial<{
|
||||
compilerIdx?: number;
|
||||
pluginState: Record<string, any>;
|
||||
dir: string;
|
||||
buildId: string;
|
||||
encryptionKey: string;
|
||||
config: NextConfigComplete;
|
||||
appDir: string;
|
||||
pagesDir: string;
|
||||
rewrites: {
|
||||
fallback: Rewrite[];
|
||||
afterFiles: Rewrite[];
|
||||
beforeFiles: Rewrite[];
|
||||
};
|
||||
originalRewrites: {
|
||||
fallback: Rewrite[];
|
||||
afterFiles: Rewrite[];
|
||||
beforeFiles: Rewrite[];
|
||||
};
|
||||
originalRedirects: Redirect[];
|
||||
loadedEnvFiles: LoadedEnvFiles;
|
||||
previewProps: __ApiPreviewProps;
|
||||
mappedPages: MappedPages | undefined;
|
||||
mappedAppPages: MappedPages | undefined;
|
||||
mappedRootPaths: MappedPages;
|
||||
hasInstrumentationHook: boolean;
|
||||
telemetry: Telemetry;
|
||||
telemetryState: TelemetryPluginState;
|
||||
nextBuildSpan: Span;
|
||||
reactProductionProfiling: boolean;
|
||||
noMangling: boolean;
|
||||
appDirOnly: boolean;
|
||||
clientRouterFilters: Parameters<typeof getBaseWebpackConfig>[1]['clientRouterFilters'];
|
||||
previewModeId: string;
|
||||
fetchCacheKeyPrefix?: string;
|
||||
allowedRevalidateHeaderKeys?: string[];
|
||||
}>;
|
||||
58
node_modules/next/dist/build/build-context.js
generated
vendored
Normal file
58
node_modules/next/dist/build/build-context.js
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
NextBuildContext: null,
|
||||
getPluginState: null,
|
||||
getProxiedPluginState: null,
|
||||
resumePluginState: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
NextBuildContext: function() {
|
||||
return NextBuildContext;
|
||||
},
|
||||
getPluginState: function() {
|
||||
return getPluginState;
|
||||
},
|
||||
getProxiedPluginState: function() {
|
||||
return getProxiedPluginState;
|
||||
},
|
||||
resumePluginState: function() {
|
||||
return resumePluginState;
|
||||
}
|
||||
});
|
||||
// A layer for storing data that is used by plugins to communicate with each
|
||||
// other between different steps of the build process. This is only internal
|
||||
// to Next.js and will not be a part of the final build output.
|
||||
// These states don't need to be deeply merged.
|
||||
let pluginState = {};
|
||||
function resumePluginState(resumedState) {
|
||||
Object.assign(pluginState, resumedState);
|
||||
}
|
||||
function getProxiedPluginState(initialState) {
|
||||
return new Proxy(pluginState, {
|
||||
get (target, key) {
|
||||
if (typeof target[key] === "undefined") {
|
||||
return target[key] = initialState[key];
|
||||
}
|
||||
return target[key];
|
||||
},
|
||||
set (target, key, value) {
|
||||
target[key] = value;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
function getPluginState() {
|
||||
return pluginState;
|
||||
}
|
||||
const NextBuildContext = {};
|
||||
|
||||
//# sourceMappingURL=build-context.js.map
|
||||
1
node_modules/next/dist/build/build-context.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/build-context.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/build/build-context.ts"],"names":["NextBuildContext","getPluginState","getProxiedPluginState","resumePluginState","pluginState","resumedState","Object","assign","initialState","Proxy","get","target","key","set","value"],"mappings":";;;;;;;;;;;;;;;;;IAkDaA,gBAAgB;eAAhBA;;IAZGC,cAAc;eAAdA;;IAjBAC,qBAAqB;eAArBA;;IAPAC,iBAAiB;eAAjBA;;;AALhB,4EAA4E;AAC5E,4EAA4E;AAC5E,+DAA+D;AAC/D,+CAA+C;AAC/C,IAAIC,cAAmC,CAAC;AACjC,SAASD,kBAAkBE,YAAkC;IAClEC,OAAOC,MAAM,CAACH,aAAaC;AAC7B;AAKO,SAASH,sBACdM,YAAmB;IAEnB,OAAO,IAAIC,MAAML,aAAa;QAC5BM,KAAIC,MAAM,EAAEC,GAAW;YACrB,IAAI,OAAOD,MAAM,CAACC,IAAI,KAAK,aAAa;gBACtC,OAAQD,MAAM,CAACC,IAAI,GAAGJ,YAAY,CAACI,IAAI;YACzC;YACA,OAAOD,MAAM,CAACC,IAAI;QACpB;QACAC,KAAIF,MAAM,EAAEC,GAAW,EAAEE,KAAK;YAC5BH,MAAM,CAACC,IAAI,GAAGE;YACd,OAAO;QACT;IACF;AACF;AAEO,SAASb;IACd,OAAOG;AACT;AAUO,MAAMJ,mBA2CR,CAAC"}
|
||||
15
node_modules/next/dist/build/collect-build-traces.d.ts
generated
vendored
Normal file
15
node_modules/next/dist/build/collect-build-traces.d.ts
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
import { Span } from '../trace';
|
||||
import type { NextConfigComplete } from '../server/config-shared';
|
||||
import { type BuildTraceContext } from './webpack/plugins/next-trace-entrypoints-plugin';
|
||||
import { type PageInfos, type SerializedPageInfos } from './utils';
|
||||
export declare function collectBuildTraces({ dir, config, distDir, pageInfos, staticPages, nextBuildSpan, hasSsrAmpPages, buildTraceContext, outputFileTracingRoot, }: {
|
||||
dir: string;
|
||||
distDir: string;
|
||||
staticPages: string[];
|
||||
hasSsrAmpPages: boolean;
|
||||
outputFileTracingRoot: string;
|
||||
pageInfos: PageInfos | SerializedPageInfos;
|
||||
nextBuildSpan?: Span;
|
||||
config: NextConfigComplete;
|
||||
buildTraceContext?: BuildTraceContext;
|
||||
}): Promise<void>;
|
||||
602
node_modules/next/dist/build/collect-build-traces.js
generated
vendored
Normal file
602
node_modules/next/dist/build/collect-build-traces.js
generated
vendored
Normal file
@ -0,0 +1,602 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "collectBuildTraces", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return collectBuildTraces;
|
||||
}
|
||||
});
|
||||
const _trace = require("../trace");
|
||||
const _nexttraceentrypointsplugin = require("./webpack/plugins/next-trace-entrypoints-plugin");
|
||||
const _constants = require("../shared/lib/constants");
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _promises = /*#__PURE__*/ _interop_require_default(require("fs/promises"));
|
||||
const _utils = require("./utils");
|
||||
const _swc = require("./swc");
|
||||
const _nonnullable = require("../lib/non-nullable");
|
||||
const _ciinfo = /*#__PURE__*/ _interop_require_wildcard(require("../telemetry/ci-info"));
|
||||
const _debug = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/debug"));
|
||||
const _picomatch = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/picomatch"));
|
||||
const _requirehook = require("../server/require-hook");
|
||||
const _nft = require("next/dist/compiled/@vercel/nft");
|
||||
const _normalizepagepath = require("../shared/lib/page-path/normalize-page-path");
|
||||
const _apppaths = require("../shared/lib/router/utils/app-paths");
|
||||
const _iserror = /*#__PURE__*/ _interop_require_default(require("../lib/is-error"));
|
||||
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;
|
||||
}
|
||||
const debug = (0, _debug.default)("next:build:build-traces");
|
||||
function shouldIgnore(file, serverIgnoreFn, reasons, cachedIgnoreFiles, children = new Set()) {
|
||||
if (cachedIgnoreFiles.has(file)) {
|
||||
return cachedIgnoreFiles.get(file);
|
||||
}
|
||||
if (serverIgnoreFn(file)) {
|
||||
cachedIgnoreFiles.set(file, true);
|
||||
return true;
|
||||
}
|
||||
children.add(file);
|
||||
const reason = reasons.get(file);
|
||||
if (!reason || reason.parents.size === 0 || reason.type.includes("initial")) {
|
||||
cachedIgnoreFiles.set(file, false);
|
||||
return false;
|
||||
}
|
||||
// if all parents are ignored the child file
|
||||
// should be ignored as well
|
||||
let allParentsIgnored = true;
|
||||
for (const parent of reason.parents.values()){
|
||||
if (!children.has(parent)) {
|
||||
children.add(parent);
|
||||
if (!shouldIgnore(parent, serverIgnoreFn, reasons, cachedIgnoreFiles, children)) {
|
||||
allParentsIgnored = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
cachedIgnoreFiles.set(file, allParentsIgnored);
|
||||
return allParentsIgnored;
|
||||
}
|
||||
async function collectBuildTraces({ dir, config, distDir, pageInfos, staticPages, nextBuildSpan = new _trace.Span({
|
||||
name: "build"
|
||||
}), hasSsrAmpPages, buildTraceContext, outputFileTracingRoot }) {
|
||||
const startTime = Date.now();
|
||||
debug("starting build traces");
|
||||
let turboTasksForTrace;
|
||||
let bindings = await (0, _swc.loadBindings)();
|
||||
const runTurbotrace = async function() {
|
||||
if (!config.experimental.turbotrace || !buildTraceContext) {
|
||||
return;
|
||||
}
|
||||
if (!(bindings == null ? void 0 : bindings.isWasm) && typeof bindings.turbo.startTrace === "function") {
|
||||
var _config_experimental_turbotrace;
|
||||
let turbotraceOutputPath;
|
||||
let turbotraceFiles;
|
||||
turboTasksForTrace = bindings.turbo.createTurboTasks((((_config_experimental_turbotrace = config.experimental.turbotrace) == null ? void 0 : _config_experimental_turbotrace.memoryLimit) ?? _constants.TURBO_TRACE_DEFAULT_MEMORY_LIMIT) * 1024 * 1024);
|
||||
const { entriesTrace, chunksTrace } = buildTraceContext;
|
||||
if (entriesTrace) {
|
||||
const { appDir: buildTraceContextAppDir, depModArray, entryNameMap, outputPath, action } = entriesTrace;
|
||||
const depModSet = new Set(depModArray);
|
||||
const filesTracedInEntries = await bindings.turbo.startTrace(action, turboTasksForTrace);
|
||||
const { contextDirectory, input: entriesToTrace } = action;
|
||||
// only trace the assets under the appDir
|
||||
// exclude files from node_modules, entries and processed by webpack
|
||||
const filesTracedFromEntries = filesTracedInEntries.map((f)=>_path.default.join(contextDirectory, f)).filter((f)=>!f.includes("/node_modules/") && f.startsWith(buildTraceContextAppDir) && !entriesToTrace.includes(f) && !depModSet.has(f));
|
||||
if (filesTracedFromEntries.length) {
|
||||
// The turbo trace doesn't provide the traced file type and reason at present
|
||||
// let's write the traced files into the first [entry].nft.json
|
||||
const [[, entryName]] = Array.from(Object.entries(entryNameMap)).filter(([k])=>k.startsWith(buildTraceContextAppDir));
|
||||
const traceOutputPath = _path.default.join(outputPath, `../${entryName}.js.nft.json`);
|
||||
const traceOutputDir = _path.default.dirname(traceOutputPath);
|
||||
turbotraceOutputPath = traceOutputPath;
|
||||
turbotraceFiles = filesTracedFromEntries.map((file)=>_path.default.relative(traceOutputDir, file));
|
||||
}
|
||||
}
|
||||
if (chunksTrace) {
|
||||
const { action, outputPath } = chunksTrace;
|
||||
action.input = action.input.filter((f)=>{
|
||||
const outputPagesPath = _path.default.join(outputPath, "..", "pages");
|
||||
return !f.startsWith(outputPagesPath) || !staticPages.includes(// strip `outputPagesPath` and file ext from absolute
|
||||
f.substring(outputPagesPath.length, f.length - 3));
|
||||
});
|
||||
await bindings.turbo.startTrace(action, turboTasksForTrace);
|
||||
if (turbotraceOutputPath && turbotraceFiles) {
|
||||
const existedNftFile = await _promises.default.readFile(turbotraceOutputPath, "utf8").then((existedContent)=>JSON.parse(existedContent)).catch(()=>({
|
||||
version: _constants.TRACE_OUTPUT_VERSION,
|
||||
files: []
|
||||
}));
|
||||
existedNftFile.files.push(...turbotraceFiles);
|
||||
const filesSet = new Set(existedNftFile.files);
|
||||
existedNftFile.files = [
|
||||
...filesSet
|
||||
];
|
||||
await _promises.default.writeFile(turbotraceOutputPath, JSON.stringify(existedNftFile), "utf8");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const { outputFileTracingIncludes = {}, outputFileTracingExcludes = {} } = config.experimental;
|
||||
const excludeGlobKeys = Object.keys(outputFileTracingExcludes);
|
||||
const includeGlobKeys = Object.keys(outputFileTracingIncludes);
|
||||
await nextBuildSpan.traceChild("node-file-trace-build", {
|
||||
isTurbotrace: Boolean(config.experimental.turbotrace) ? "true" : "false"
|
||||
}).traceAsyncFn(async ()=>{
|
||||
var _config_experimental_turbotrace, _config_experimental;
|
||||
const nextServerTraceOutput = _path.default.join(distDir, "next-server.js.nft.json");
|
||||
const nextMinimalTraceOutput = _path.default.join(distDir, "next-minimal-server.js.nft.json");
|
||||
const root = ((_config_experimental = config.experimental) == null ? void 0 : (_config_experimental_turbotrace = _config_experimental.turbotrace) == null ? void 0 : _config_experimental_turbotrace.contextDirectory) ?? outputFileTracingRoot;
|
||||
// Under standalone mode, we need to trace the extra IPC server and
|
||||
// worker files.
|
||||
const isStandalone = config.output === "standalone";
|
||||
const nextServerEntry = require.resolve("next/dist/server/next-server");
|
||||
const sharedEntriesSet = [
|
||||
...config.experimental.turbotrace ? [] : Object.keys(_requirehook.defaultOverrides).map((value)=>require.resolve(value, {
|
||||
paths: [
|
||||
require.resolve("next/dist/server/require-hook")
|
||||
]
|
||||
}))
|
||||
];
|
||||
const { cacheHandler } = config;
|
||||
// ensure we trace any dependencies needed for custom
|
||||
// incremental cache handler
|
||||
if (cacheHandler) {
|
||||
sharedEntriesSet.push(require.resolve(_path.default.isAbsolute(cacheHandler) ? cacheHandler : _path.default.join(dir, cacheHandler)));
|
||||
}
|
||||
const serverEntries = [
|
||||
...sharedEntriesSet,
|
||||
...isStandalone ? [
|
||||
require.resolve("next/dist/server/lib/start-server"),
|
||||
require.resolve("next/dist/server/next"),
|
||||
require.resolve("next/dist/server/require-hook")
|
||||
] : [],
|
||||
require.resolve("next/dist/server/next-server")
|
||||
].filter(Boolean);
|
||||
const minimalServerEntries = [
|
||||
...sharedEntriesSet,
|
||||
require.resolve("next/dist/compiled/next-server/server.runtime.prod")
|
||||
].filter(Boolean);
|
||||
const additionalIgnores = new Set();
|
||||
for (const glob of excludeGlobKeys){
|
||||
if ((0, _picomatch.default)(glob)("next-server")) {
|
||||
outputFileTracingExcludes[glob].forEach((exclude)=>{
|
||||
additionalIgnores.add(exclude);
|
||||
});
|
||||
}
|
||||
}
|
||||
const makeIgnoreFn = (ignores)=>{
|
||||
// pre compile the ignore globs
|
||||
const isMatch = (0, _picomatch.default)(ignores, {
|
||||
contains: true,
|
||||
dot: true
|
||||
});
|
||||
return (pathname)=>{
|
||||
if (_path.default.isAbsolute(pathname) && !pathname.startsWith(root)) {
|
||||
return true;
|
||||
}
|
||||
return isMatch(pathname);
|
||||
};
|
||||
};
|
||||
const sharedIgnores = [
|
||||
"**/next/dist/compiled/next-server/**/*.dev.js",
|
||||
...isStandalone ? [] : [
|
||||
"**/next/dist/compiled/jest-worker/**/*"
|
||||
],
|
||||
"**/next/dist/compiled/webpack/(bundle4|bundle5).js",
|
||||
"**/node_modules/webpack5/**/*",
|
||||
"**/next/dist/server/lib/route-resolver*",
|
||||
"next/dist/compiled/semver/semver/**/*.js",
|
||||
..._ciinfo.hasNextSupport ? [
|
||||
// only ignore image-optimizer code when
|
||||
// this is being handled outside of next-server
|
||||
"**/next/dist/server/image-optimizer.js",
|
||||
"**/next/dist/server/lib/squoosh/**/*.wasm"
|
||||
] : [],
|
||||
...!hasSsrAmpPages ? [
|
||||
"**/next/dist/compiled/@ampproject/toolbox-optimizer/**/*"
|
||||
] : [],
|
||||
...isStandalone ? [] : _nexttraceentrypointsplugin.TRACE_IGNORES,
|
||||
...additionalIgnores,
|
||||
...config.experimental.outputFileTracingIgnores || []
|
||||
];
|
||||
const sharedIgnoresFn = makeIgnoreFn(sharedIgnores);
|
||||
const serverIgnores = [
|
||||
...sharedIgnores,
|
||||
"**/node_modules/react{,-dom,-dom-server-turbopack}/**/*.development.js",
|
||||
"**/*.d.ts",
|
||||
"**/*.map",
|
||||
"**/next/dist/pages/**/*",
|
||||
..._ciinfo.hasNextSupport ? [
|
||||
"**/node_modules/sharp/**/*",
|
||||
"**/@img/sharp-libvips*/**/*"
|
||||
] : []
|
||||
].filter(_nonnullable.nonNullable);
|
||||
const serverIgnoreFn = makeIgnoreFn(serverIgnores);
|
||||
const minimalServerIgnores = [
|
||||
...serverIgnores,
|
||||
"**/next/dist/compiled/edge-runtime/**/*",
|
||||
"**/next/dist/server/web/sandbox/**/*",
|
||||
"**/next/dist/server/post-process.js"
|
||||
];
|
||||
const minimalServerIgnoreFn = makeIgnoreFn(minimalServerIgnores);
|
||||
const routesIgnores = [
|
||||
...sharedIgnores,
|
||||
// server chunks are provided via next-trace-entrypoints-plugin plugin
|
||||
// as otherwise all chunks are traced here and included for all pages
|
||||
// whether they are needed or not
|
||||
"**/.next/server/chunks/**",
|
||||
"**/next/dist/server/optimize-amp.js",
|
||||
"**/next/dist/server/post-process.js"
|
||||
].filter(_nonnullable.nonNullable);
|
||||
const routeIgnoreFn = makeIgnoreFn(routesIgnores);
|
||||
const traceContext = _path.default.join(nextServerEntry, "..", "..");
|
||||
const serverTracedFiles = new Set();
|
||||
const minimalServerTracedFiles = new Set();
|
||||
function addToTracedFiles(base, file, dest) {
|
||||
dest.add(_path.default.relative(distDir, _path.default.join(base, file)).replace(/\\/g, "/"));
|
||||
}
|
||||
if (isStandalone) {
|
||||
addToTracedFiles("", require.resolve("next/dist/compiled/jest-worker/processChild"), serverTracedFiles);
|
||||
addToTracedFiles("", require.resolve("next/dist/compiled/jest-worker/threadChild"), serverTracedFiles);
|
||||
}
|
||||
if (config.experimental.turbotrace) {
|
||||
await runTurbotrace();
|
||||
const startTrace = bindings.turbo.startTrace;
|
||||
const makeTrace = async (entries)=>{
|
||||
var _config_experimental_turbotrace, _config_experimental_turbotrace1, _config_experimental_turbotrace2, _config_experimental_turbotrace3;
|
||||
return startTrace({
|
||||
action: "print",
|
||||
input: entries,
|
||||
contextDirectory: traceContext,
|
||||
logLevel: (_config_experimental_turbotrace = config.experimental.turbotrace) == null ? void 0 : _config_experimental_turbotrace.logLevel,
|
||||
processCwd: (_config_experimental_turbotrace1 = config.experimental.turbotrace) == null ? void 0 : _config_experimental_turbotrace1.processCwd,
|
||||
logDetail: (_config_experimental_turbotrace2 = config.experimental.turbotrace) == null ? void 0 : _config_experimental_turbotrace2.logDetail,
|
||||
showAll: (_config_experimental_turbotrace3 = config.experimental.turbotrace) == null ? void 0 : _config_experimental_turbotrace3.logAll
|
||||
}, turboTasksForTrace);
|
||||
};
|
||||
// turbotrace does not handle concurrent tracing
|
||||
const vanillaFiles = await makeTrace(serverEntries);
|
||||
const minimalFiles = await makeTrace(minimalServerEntries);
|
||||
for (const [set, files] of [
|
||||
[
|
||||
serverTracedFiles,
|
||||
vanillaFiles
|
||||
],
|
||||
[
|
||||
minimalServerTracedFiles,
|
||||
minimalFiles
|
||||
]
|
||||
]){
|
||||
for (const file of files){
|
||||
if (!(set === minimalServerTracedFiles ? minimalServerIgnoreFn : serverIgnoreFn)(_path.default.join(traceContext, file))) {
|
||||
addToTracedFiles(traceContext, file, set);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var _buildTraceContext_chunksTrace;
|
||||
const chunksToTrace = [
|
||||
...(buildTraceContext == null ? void 0 : (_buildTraceContext_chunksTrace = buildTraceContext.chunksTrace) == null ? void 0 : _buildTraceContext_chunksTrace.action.input) || [],
|
||||
...serverEntries,
|
||||
...minimalServerEntries
|
||||
];
|
||||
const result = await (0, _nft.nodeFileTrace)(chunksToTrace, {
|
||||
base: outputFileTracingRoot,
|
||||
processCwd: dir,
|
||||
mixedModules: true,
|
||||
async readFile (p) {
|
||||
try {
|
||||
return await _promises.default.readFile(p, "utf8");
|
||||
} catch (e) {
|
||||
if ((0, _iserror.default)(e) && (e.code === "ENOENT" || e.code === "EISDIR")) {
|
||||
// since tracing runs in parallel with static generation server
|
||||
// files might be removed from that step so tolerate ENOENT
|
||||
// errors gracefully
|
||||
return "";
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
async readlink (p) {
|
||||
try {
|
||||
return await _promises.default.readlink(p);
|
||||
} catch (e) {
|
||||
if ((0, _iserror.default)(e) && (e.code === "EINVAL" || e.code === "ENOENT" || e.code === "UNKNOWN")) {
|
||||
return null;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
async stat (p) {
|
||||
try {
|
||||
return await _promises.default.stat(p);
|
||||
} catch (e) {
|
||||
if ((0, _iserror.default)(e) && (e.code === "ENOENT" || e.code === "ENOTDIR")) {
|
||||
return null;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
// handle shared ignores at top-level as it
|
||||
// avoids over-tracing when we don't need to
|
||||
// and speeds up total trace time
|
||||
ignore (p) {
|
||||
if (sharedIgnoresFn(p)) {
|
||||
return true;
|
||||
}
|
||||
// if a chunk is attempting to be traced that isn't
|
||||
// in our initial list we need to ignore it to prevent
|
||||
// over tracing as webpack needs to be the source of
|
||||
// truth for which chunks should be included for each entry
|
||||
if (p.includes(".next/server/chunks") && !chunksToTrace.includes(_path.default.join(outputFileTracingRoot, p))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
const reasons = result.reasons;
|
||||
const fileList = result.fileList;
|
||||
for (const file of result.esmFileList){
|
||||
fileList.add(file);
|
||||
}
|
||||
const parentFilesMap = (0, _nexttraceentrypointsplugin.getFilesMapFromReasons)(fileList, reasons);
|
||||
const cachedLookupIgnore = new Map();
|
||||
const cachedLookupIgnoreMinimal = new Map();
|
||||
for (const [entries, tracedFiles] of [
|
||||
[
|
||||
serverEntries,
|
||||
serverTracedFiles
|
||||
],
|
||||
[
|
||||
minimalServerEntries,
|
||||
minimalServerTracedFiles
|
||||
]
|
||||
]){
|
||||
for (const file of entries){
|
||||
const curFiles = parentFilesMap.get(_path.default.relative(outputFileTracingRoot, file));
|
||||
tracedFiles.add(_path.default.relative(distDir, file).replace(/\\/g, "/"));
|
||||
for (const curFile of curFiles || []){
|
||||
const filePath = _path.default.join(outputFileTracingRoot, curFile);
|
||||
if (!shouldIgnore(curFile, tracedFiles === minimalServerTracedFiles ? minimalServerIgnoreFn : serverIgnoreFn, reasons, tracedFiles === minimalServerTracedFiles ? cachedLookupIgnoreMinimal : cachedLookupIgnore)) {
|
||||
tracedFiles.add(_path.default.relative(distDir, filePath).replace(/\\/g, "/"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const { entryNameFilesMap } = (buildTraceContext == null ? void 0 : buildTraceContext.chunksTrace) || {};
|
||||
const cachedLookupIgnoreRoutes = new Map();
|
||||
await Promise.all([
|
||||
...entryNameFilesMap ? Object.entries(entryNameFilesMap) : new Map()
|
||||
].map(async ([entryName, entryNameFiles])=>{
|
||||
const isApp = entryName.startsWith("app/");
|
||||
const isPages = entryName.startsWith("pages/");
|
||||
let route = entryName;
|
||||
if (isApp) {
|
||||
route = (0, _apppaths.normalizeAppPath)(route.substring("app".length));
|
||||
}
|
||||
if (isPages) {
|
||||
route = (0, _normalizepagepath.normalizePagePath)(route.substring("pages".length));
|
||||
}
|
||||
// we don't need to trace for automatically statically optimized
|
||||
// pages as they don't have server bundles
|
||||
if (staticPages.includes(route)) {
|
||||
return;
|
||||
}
|
||||
const entryOutputPath = _path.default.join(distDir, "server", `${entryName}.js`);
|
||||
const traceOutputPath = `${entryOutputPath}.nft.json`;
|
||||
const existingTrace = JSON.parse(await _promises.default.readFile(traceOutputPath, "utf8"));
|
||||
const traceOutputDir = _path.default.dirname(traceOutputPath);
|
||||
const curTracedFiles = new Set();
|
||||
for (const file of [
|
||||
...entryNameFiles,
|
||||
entryOutputPath
|
||||
]){
|
||||
const curFiles = parentFilesMap.get(_path.default.relative(outputFileTracingRoot, file));
|
||||
for (const curFile of curFiles || []){
|
||||
if (!shouldIgnore(curFile, routeIgnoreFn, reasons, cachedLookupIgnoreRoutes)) {
|
||||
const filePath = _path.default.join(outputFileTracingRoot, curFile);
|
||||
const outputFile = _path.default.relative(traceOutputDir, filePath).replace(/\\/g, "/");
|
||||
curTracedFiles.add(outputFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const file of existingTrace.files || []){
|
||||
curTracedFiles.add(file);
|
||||
}
|
||||
await _promises.default.writeFile(traceOutputPath, JSON.stringify({
|
||||
...existingTrace,
|
||||
files: [
|
||||
...curTracedFiles
|
||||
].sort()
|
||||
}));
|
||||
}));
|
||||
}
|
||||
const moduleTypes = [
|
||||
"app-page",
|
||||
"pages"
|
||||
];
|
||||
for (const type of moduleTypes){
|
||||
const modulePath = require.resolve(`next/dist/server/future/route-modules/${type}/module.compiled`);
|
||||
const relativeModulePath = _path.default.relative(root, modulePath);
|
||||
const contextDir = _path.default.join(_path.default.dirname(modulePath), "vendored", "contexts");
|
||||
for (const item of (await _promises.default.readdir(contextDir))){
|
||||
const itemPath = _path.default.relative(root, _path.default.join(contextDir, item));
|
||||
if (!serverIgnoreFn(itemPath)) {
|
||||
addToTracedFiles(root, itemPath, serverTracedFiles);
|
||||
addToTracedFiles(root, itemPath, minimalServerTracedFiles);
|
||||
}
|
||||
}
|
||||
addToTracedFiles(root, relativeModulePath, serverTracedFiles);
|
||||
addToTracedFiles(root, relativeModulePath, minimalServerTracedFiles);
|
||||
}
|
||||
await Promise.all([
|
||||
_promises.default.writeFile(nextServerTraceOutput, JSON.stringify({
|
||||
version: 1,
|
||||
files: Array.from(serverTracedFiles)
|
||||
})),
|
||||
_promises.default.writeFile(nextMinimalTraceOutput, JSON.stringify({
|
||||
version: 1,
|
||||
files: Array.from(minimalServerTracedFiles)
|
||||
}))
|
||||
]);
|
||||
});
|
||||
// apply outputFileTracingIncludes/outputFileTracingExcludes after runTurbotrace
|
||||
const includeExcludeSpan = nextBuildSpan.traceChild("apply-include-excludes");
|
||||
await includeExcludeSpan.traceAsyncFn(async ()=>{
|
||||
const globOrig = require("next/dist/compiled/glob");
|
||||
const glob = (pattern)=>{
|
||||
return new Promise((resolve, reject)=>{
|
||||
globOrig(pattern, {
|
||||
cwd: dir,
|
||||
nodir: true,
|
||||
dot: true
|
||||
}, (err, files)=>{
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
resolve(files);
|
||||
});
|
||||
});
|
||||
};
|
||||
const { entryNameFilesMap } = (buildTraceContext == null ? void 0 : buildTraceContext.chunksTrace) || {};
|
||||
const infos = pageInfos instanceof Map ? pageInfos : (0, _utils.deserializePageInfos)(pageInfos);
|
||||
await Promise.all([
|
||||
...entryNameFilesMap ? Object.entries(entryNameFilesMap) : new Map()
|
||||
].map(async ([entryName])=>{
|
||||
const isApp = entryName.startsWith("app/");
|
||||
const isPages = entryName.startsWith("pages/");
|
||||
let route = entryName;
|
||||
if (isApp) {
|
||||
route = (0, _apppaths.normalizeAppPath)(entryName);
|
||||
}
|
||||
if (isPages) {
|
||||
route = (0, _normalizepagepath.normalizePagePath)(entryName);
|
||||
}
|
||||
if (staticPages.includes(route)) {
|
||||
return;
|
||||
}
|
||||
// edge routes have no trace files
|
||||
const pageInfo = infos.get(route);
|
||||
if ((pageInfo == null ? void 0 : pageInfo.runtime) === "edge") {
|
||||
return;
|
||||
}
|
||||
const combinedIncludes = new Set();
|
||||
const combinedExcludes = new Set();
|
||||
for (const curGlob of includeGlobKeys){
|
||||
const isMatch = (0, _picomatch.default)(curGlob, {
|
||||
dot: true,
|
||||
contains: true
|
||||
});
|
||||
if (isMatch(route)) {
|
||||
for (const include of outputFileTracingIncludes[curGlob]){
|
||||
combinedIncludes.add(include.replace(/\\/g, "/"));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const curGlob of excludeGlobKeys){
|
||||
const isMatch = (0, _picomatch.default)(curGlob, {
|
||||
dot: true,
|
||||
contains: true
|
||||
});
|
||||
if (isMatch(route)) {
|
||||
for (const exclude of outputFileTracingExcludes[curGlob]){
|
||||
combinedExcludes.add(exclude);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!(combinedIncludes == null ? void 0 : combinedIncludes.size) && !(combinedExcludes == null ? void 0 : combinedExcludes.size)) {
|
||||
return;
|
||||
}
|
||||
const traceFile = _path.default.join(distDir, `server`, `${entryName}.js.nft.json`);
|
||||
const pageDir = _path.default.dirname(traceFile);
|
||||
const traceContent = JSON.parse(await _promises.default.readFile(traceFile, "utf8"));
|
||||
const includes = [];
|
||||
const resolvedTraceIncludes = new Map();
|
||||
if (combinedIncludes == null ? void 0 : combinedIncludes.size) {
|
||||
await Promise.all([
|
||||
...combinedIncludes
|
||||
].map(async (includeGlob)=>{
|
||||
const results = await glob(includeGlob);
|
||||
const resolvedInclude = resolvedTraceIncludes.get(includeGlob) || [
|
||||
...results.map((file)=>{
|
||||
return _path.default.relative(pageDir, _path.default.join(dir, file));
|
||||
})
|
||||
];
|
||||
includes.push(...resolvedInclude);
|
||||
resolvedTraceIncludes.set(includeGlob, resolvedInclude);
|
||||
}));
|
||||
}
|
||||
const combined = new Set([
|
||||
...traceContent.files,
|
||||
...includes
|
||||
]);
|
||||
if (combinedExcludes == null ? void 0 : combinedExcludes.size) {
|
||||
const resolvedGlobs = [
|
||||
...combinedExcludes
|
||||
].map((exclude)=>_path.default.join(dir, exclude));
|
||||
// pre compile before forEach
|
||||
const isMatch = (0, _picomatch.default)(resolvedGlobs, {
|
||||
dot: true,
|
||||
contains: true
|
||||
});
|
||||
combined.forEach((file)=>{
|
||||
if (isMatch(_path.default.join(pageDir, file))) {
|
||||
combined.delete(file);
|
||||
}
|
||||
});
|
||||
}
|
||||
// overwrite trace file with custom includes/excludes
|
||||
await _promises.default.writeFile(traceFile, JSON.stringify({
|
||||
version: traceContent.version,
|
||||
files: [
|
||||
...combined
|
||||
]
|
||||
}));
|
||||
}));
|
||||
});
|
||||
debug(`finished build tracing ${Date.now() - startTime}ms`);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=collect-build-traces.js.map
|
||||
1
node_modules/next/dist/build/collect-build-traces.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/collect-build-traces.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
14
node_modules/next/dist/build/compiler.d.ts
generated
vendored
Normal file
14
node_modules/next/dist/build/compiler.d.ts
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import { webpack } from 'next/dist/compiled/webpack/webpack';
|
||||
import type { Span } from '../trace';
|
||||
export type CompilerResult = {
|
||||
errors: webpack.StatsError[];
|
||||
warnings: webpack.StatsError[];
|
||||
stats: webpack.Stats | undefined;
|
||||
};
|
||||
export declare function runCompiler(config: webpack.Configuration, { runWebpackSpan, inputFileSystem, }: {
|
||||
runWebpackSpan: Span;
|
||||
inputFileSystem?: webpack.Compiler['inputFileSystem'];
|
||||
}): Promise<[
|
||||
result: CompilerResult,
|
||||
inputFileSystem?: webpack.Compiler['inputFileSystem']
|
||||
]>;
|
||||
79
node_modules/next/dist/build/compiler.js
generated
vendored
Normal file
79
node_modules/next/dist/build/compiler.js
generated
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "runCompiler", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return runCompiler;
|
||||
}
|
||||
});
|
||||
const _webpack = require("next/dist/compiled/webpack/webpack");
|
||||
function generateStats(result, stat) {
|
||||
const { errors, warnings } = stat.toJson({
|
||||
preset: "errors-warnings",
|
||||
moduleTrace: true
|
||||
});
|
||||
if (errors && errors.length > 0) {
|
||||
result.errors.push(...errors);
|
||||
}
|
||||
if (warnings && warnings.length > 0) {
|
||||
result.warnings.push(...warnings);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
// Webpack 5 requires the compiler to be closed (to save caches)
|
||||
// Webpack 4 does not have this close method so in order to be backwards compatible we check if it exists
|
||||
function closeCompiler(compiler) {
|
||||
return new Promise((resolve, reject)=>{
|
||||
// @ts-ignore Close only exists on the compiler in webpack 5
|
||||
return compiler.close((err)=>err ? reject(err) : resolve());
|
||||
});
|
||||
}
|
||||
function runCompiler(config, { runWebpackSpan, inputFileSystem }) {
|
||||
return new Promise((resolve, reject)=>{
|
||||
const compiler = (0, _webpack.webpack)(config);
|
||||
// Ensure we use the previous inputFileSystem
|
||||
if (inputFileSystem) {
|
||||
compiler.inputFileSystem = inputFileSystem;
|
||||
}
|
||||
compiler.fsStartTime = Date.now();
|
||||
compiler.run((err, stats)=>{
|
||||
const webpackCloseSpan = runWebpackSpan.traceChild("webpack-close", {
|
||||
name: config.name || "unknown"
|
||||
});
|
||||
webpackCloseSpan.traceAsyncFn(()=>closeCompiler(compiler)).then(()=>{
|
||||
if (err) {
|
||||
const reason = err.stack ?? err.toString();
|
||||
if (reason) {
|
||||
return resolve([
|
||||
{
|
||||
errors: [
|
||||
{
|
||||
message: reason,
|
||||
details: err.details
|
||||
}
|
||||
],
|
||||
warnings: [],
|
||||
stats
|
||||
},
|
||||
compiler.inputFileSystem
|
||||
]);
|
||||
}
|
||||
return reject(err);
|
||||
} else if (!stats) throw new Error("No Stats from webpack");
|
||||
const result = webpackCloseSpan.traceChild("webpack-generate-error-stats").traceFn(()=>generateStats({
|
||||
errors: [],
|
||||
warnings: [],
|
||||
stats
|
||||
}, stats));
|
||||
return resolve([
|
||||
result,
|
||||
compiler.inputFileSystem
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=compiler.js.map
|
||||
1
node_modules/next/dist/build/compiler.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/compiler.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/build/compiler.ts"],"names":["runCompiler","generateStats","result","stat","errors","warnings","toJson","preset","moduleTrace","length","push","closeCompiler","compiler","Promise","resolve","reject","close","err","config","runWebpackSpan","inputFileSystem","webpack","fsStartTime","Date","now","run","stats","webpackCloseSpan","traceChild","name","traceAsyncFn","then","reason","stack","toString","message","details","Error","traceFn"],"mappings":";;;;+BAqCgBA;;;eAAAA;;;yBArCQ;AASxB,SAASC,cACPC,MAAsB,EACtBC,IAAmB;IAEnB,MAAM,EAAEC,MAAM,EAAEC,QAAQ,EAAE,GAAGF,KAAKG,MAAM,CAAC;QACvCC,QAAQ;QACRC,aAAa;IACf;IACA,IAAIJ,UAAUA,OAAOK,MAAM,GAAG,GAAG;QAC/BP,OAAOE,MAAM,CAACM,IAAI,IAAIN;IACxB;IAEA,IAAIC,YAAYA,SAASI,MAAM,GAAG,GAAG;QACnCP,OAAOG,QAAQ,CAACK,IAAI,IAAIL;IAC1B;IAEA,OAAOH;AACT;AAEA,gEAAgE;AAChE,yGAAyG;AACzG,SAASS,cAAcC,QAAkD;IACvE,OAAO,IAAIC,QAAc,CAACC,SAASC;QACjC,4DAA4D;QAC5D,OAAOH,SAASI,KAAK,CAAC,CAACC,MAAcA,MAAMF,OAAOE,OAAOH;IAC3D;AACF;AAEO,SAASd,YACdkB,MAA6B,EAC7B,EACEC,cAAc,EACdC,eAAe,EAIhB;IAOD,OAAO,IAAIP,QAAQ,CAACC,SAASC;QAC3B,MAAMH,WAAWS,IAAAA,gBAAO,EAACH;QACzB,6CAA6C;QAC7C,IAAIE,iBAAiB;YACnBR,SAASQ,eAAe,GAAGA;QAC7B;QACAR,SAASU,WAAW,GAAGC,KAAKC,GAAG;QAC/BZ,SAASa,GAAG,CAAC,CAACR,KAAKS;YACjB,MAAMC,mBAAmBR,eAAeS,UAAU,CAAC,iBAAiB;gBAClEC,MAAMX,OAAOW,IAAI,IAAI;YACvB;YACAF,iBACGG,YAAY,CAAC,IAAMnB,cAAcC,WACjCmB,IAAI,CAAC;gBACJ,IAAId,KAAK;oBACP,MAAMe,SAASf,IAAIgB,KAAK,IAAIhB,IAAIiB,QAAQ;oBACxC,IAAIF,QAAQ;wBACV,OAAOlB,QAAQ;4BACb;gCACEV,QAAQ;oCAAC;wCAAE+B,SAASH;wCAAQI,SAAS,AAACnB,IAAYmB,OAAO;oCAAC;iCAAE;gCAC5D/B,UAAU,EAAE;gCACZqB;4BACF;4BACAd,SAASQ,eAAe;yBACzB;oBACH;oBACA,OAAOL,OAAOE;gBAChB,OAAO,IAAI,CAACS,OAAO,MAAM,IAAIW,MAAM;gBAEnC,MAAMnC,SAASyB,iBACZC,UAAU,CAAC,gCACXU,OAAO,CAAC,IACPrC,cAAc;wBAAEG,QAAQ,EAAE;wBAAEC,UAAU,EAAE;wBAAEqB;oBAAM,GAAGA;gBAEvD,OAAOZ,QAAQ;oBAACZ;oBAAQU,SAASQ,eAAe;iBAAC;YACnD;QACJ;IACF;AACF"}
|
||||
28
node_modules/next/dist/build/create-compiler-aliases.d.ts
generated
vendored
Normal file
28
node_modules/next/dist/build/create-compiler-aliases.d.ts
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
import { type WebpackLayerName } from '../lib/constants';
|
||||
import type { NextConfigComplete } from '../server/config-shared';
|
||||
interface CompilerAliases {
|
||||
[alias: string]: string | string[];
|
||||
}
|
||||
export declare function createWebpackAliases({ distDir, isClient, isEdgeServer, isNodeServer, dev, config, pagesDir, appDir, dir, reactProductionProfiling, hasRewrites, }: {
|
||||
distDir: string;
|
||||
isClient: boolean;
|
||||
isEdgeServer: boolean;
|
||||
isNodeServer: boolean;
|
||||
dev: boolean;
|
||||
config: NextConfigComplete;
|
||||
pagesDir: string | undefined;
|
||||
appDir: string | undefined;
|
||||
dir: string;
|
||||
reactProductionProfiling: boolean;
|
||||
hasRewrites: boolean;
|
||||
}): CompilerAliases;
|
||||
export declare function createServerOnlyClientOnlyAliases(isServer: boolean): CompilerAliases;
|
||||
export declare function createNextApiEsmAliases(): Record<string, string>;
|
||||
export declare function createAppRouterApiAliases(isServerOnlyLayer: boolean): Record<string, string>;
|
||||
export declare function createRSCAliases(bundledReactChannel: string, { layer, isEdgeServer, reactProductionProfiling, }: {
|
||||
layer: WebpackLayerName;
|
||||
isEdgeServer: boolean;
|
||||
reactProductionProfiling: boolean;
|
||||
}): CompilerAliases;
|
||||
export declare function getOptimizedModuleAliases(): CompilerAliases;
|
||||
export {};
|
||||
281
node_modules/next/dist/build/create-compiler-aliases.js
generated
vendored
Normal file
281
node_modules/next/dist/build/create-compiler-aliases.js
generated
vendored
Normal file
@ -0,0 +1,281 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
createAppRouterApiAliases: null,
|
||||
createNextApiEsmAliases: null,
|
||||
createRSCAliases: null,
|
||||
createServerOnlyClientOnlyAliases: null,
|
||||
createWebpackAliases: null,
|
||||
getOptimizedModuleAliases: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
createAppRouterApiAliases: function() {
|
||||
return createAppRouterApiAliases;
|
||||
},
|
||||
createNextApiEsmAliases: function() {
|
||||
return createNextApiEsmAliases;
|
||||
},
|
||||
createRSCAliases: function() {
|
||||
return createRSCAliases;
|
||||
},
|
||||
createServerOnlyClientOnlyAliases: function() {
|
||||
return createServerOnlyClientOnlyAliases;
|
||||
},
|
||||
createWebpackAliases: function() {
|
||||
return createWebpackAliases;
|
||||
},
|
||||
getOptimizedModuleAliases: function() {
|
||||
return getOptimizedModuleAliases;
|
||||
}
|
||||
});
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _constants = require("../lib/constants");
|
||||
const _requirehook = require("../server/require-hook");
|
||||
const _webpackconfig = require("./webpack-config");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function createWebpackAliases({ distDir, isClient, isEdgeServer, isNodeServer, dev, config, pagesDir, appDir, dir, reactProductionProfiling, hasRewrites }) {
|
||||
const pageExtensions = config.pageExtensions;
|
||||
const clientResolveRewrites = require.resolve("../shared/lib/router/utils/resolve-rewrites");
|
||||
const customAppAliases = {};
|
||||
const customDocumentAliases = {};
|
||||
// tell webpack where to look for _app and _document
|
||||
// using aliases to allow falling back to the default
|
||||
// version when removed or not present
|
||||
if (dev) {
|
||||
const nextDistPath = "next/dist/" + (isEdgeServer ? "esm/" : "");
|
||||
customAppAliases[`${_constants.PAGES_DIR_ALIAS}/_app`] = [
|
||||
...pagesDir ? pageExtensions.reduce((prev, ext)=>{
|
||||
prev.push(_path.default.join(pagesDir, `_app.${ext}`));
|
||||
return prev;
|
||||
}, []) : [],
|
||||
`${nextDistPath}pages/_app.js`
|
||||
];
|
||||
customAppAliases[`${_constants.PAGES_DIR_ALIAS}/_error`] = [
|
||||
...pagesDir ? pageExtensions.reduce((prev, ext)=>{
|
||||
prev.push(_path.default.join(pagesDir, `_error.${ext}`));
|
||||
return prev;
|
||||
}, []) : [],
|
||||
`${nextDistPath}pages/_error.js`
|
||||
];
|
||||
customDocumentAliases[`${_constants.PAGES_DIR_ALIAS}/_document`] = [
|
||||
...pagesDir ? pageExtensions.reduce((prev, ext)=>{
|
||||
prev.push(_path.default.join(pagesDir, `_document.${ext}`));
|
||||
return prev;
|
||||
}, []) : [],
|
||||
`${nextDistPath}pages/_document.js`
|
||||
];
|
||||
}
|
||||
return {
|
||||
"@vercel/og$": "next/dist/server/og/image-response",
|
||||
// Alias next/dist imports to next/dist/esm assets,
|
||||
// let this alias hit before `next` alias.
|
||||
...isEdgeServer ? {
|
||||
"next/dist/api": "next/dist/esm/api",
|
||||
"next/dist/build": "next/dist/esm/build",
|
||||
"next/dist/client": "next/dist/esm/client",
|
||||
"next/dist/shared": "next/dist/esm/shared",
|
||||
"next/dist/pages": "next/dist/esm/pages",
|
||||
"next/dist/lib": "next/dist/esm/lib",
|
||||
"next/dist/server": "next/dist/esm/server",
|
||||
...createNextApiEsmAliases()
|
||||
} : undefined,
|
||||
// For RSC server bundle
|
||||
...!(0, _webpackconfig.hasExternalOtelApiPackage)() && {
|
||||
"@opentelemetry/api": "next/dist/compiled/@opentelemetry/api"
|
||||
},
|
||||
...config.images.loaderFile ? {
|
||||
"next/dist/shared/lib/image-loader": config.images.loaderFile,
|
||||
...isEdgeServer && {
|
||||
"next/dist/esm/shared/lib/image-loader": config.images.loaderFile
|
||||
}
|
||||
} : undefined,
|
||||
next: _webpackconfig.NEXT_PROJECT_ROOT,
|
||||
"styled-jsx/style$": _requirehook.defaultOverrides["styled-jsx/style"],
|
||||
"styled-jsx$": _requirehook.defaultOverrides["styled-jsx"],
|
||||
...customAppAliases,
|
||||
...customDocumentAliases,
|
||||
...pagesDir ? {
|
||||
[_constants.PAGES_DIR_ALIAS]: pagesDir
|
||||
} : {},
|
||||
...appDir ? {
|
||||
[_constants.APP_DIR_ALIAS]: appDir
|
||||
} : {},
|
||||
[_constants.ROOT_DIR_ALIAS]: dir,
|
||||
[_constants.DOT_NEXT_ALIAS]: distDir,
|
||||
...isClient || isEdgeServer ? getOptimizedModuleAliases() : {},
|
||||
...reactProductionProfiling ? getReactProfilingInProduction() : {},
|
||||
// For Node server, we need to re-alias the package imports to prefer to
|
||||
// resolve to the ESM export.
|
||||
...isNodeServer ? getBarrelOptimizationAliases(config.experimental.optimizePackageImports || []) : {},
|
||||
[_constants.RSC_ACTION_VALIDATE_ALIAS]: "next/dist/build/webpack/loaders/next-flight-loader/action-validate",
|
||||
[_constants.RSC_ACTION_CLIENT_WRAPPER_ALIAS]: "next/dist/build/webpack/loaders/next-flight-loader/action-client-wrapper",
|
||||
[_constants.RSC_ACTION_PROXY_ALIAS]: "next/dist/build/webpack/loaders/next-flight-loader/server-reference",
|
||||
[_constants.RSC_ACTION_ENCRYPTION_ALIAS]: "next/dist/server/app-render/encryption",
|
||||
...isClient || isEdgeServer ? {
|
||||
[clientResolveRewrites]: hasRewrites ? clientResolveRewrites : false
|
||||
} : {},
|
||||
"@swc/helpers/_": _path.default.join(_path.default.dirname(require.resolve("@swc/helpers/package.json")), "_"),
|
||||
setimmediate: "next/dist/compiled/setimmediate"
|
||||
};
|
||||
}
|
||||
function createServerOnlyClientOnlyAliases(isServer) {
|
||||
return isServer ? {
|
||||
"server-only$": "next/dist/compiled/server-only/empty",
|
||||
"client-only$": "next/dist/compiled/client-only/error",
|
||||
"next/dist/compiled/server-only$": "next/dist/compiled/server-only/empty",
|
||||
"next/dist/compiled/client-only$": "next/dist/compiled/client-only/error"
|
||||
} : {
|
||||
"server-only$": "next/dist/compiled/server-only/index",
|
||||
"client-only$": "next/dist/compiled/client-only/index",
|
||||
"next/dist/compiled/client-only$": "next/dist/compiled/client-only/index",
|
||||
"next/dist/compiled/server-only": "next/dist/compiled/server-only/index"
|
||||
};
|
||||
}
|
||||
function createNextApiEsmAliases() {
|
||||
const mapping = {
|
||||
head: "next/dist/api/head",
|
||||
image: "next/dist/api/image",
|
||||
constants: "next/dist/api/constants",
|
||||
router: "next/dist/api/router",
|
||||
dynamic: "next/dist/api/dynamic",
|
||||
script: "next/dist/api/script",
|
||||
link: "next/dist/api/link",
|
||||
navigation: "next/dist/api/navigation",
|
||||
headers: "next/dist/api/headers",
|
||||
og: "next/dist/api/og",
|
||||
server: "next/dist/api/server",
|
||||
// pages api
|
||||
document: "next/dist/api/document",
|
||||
app: "next/dist/api/app"
|
||||
};
|
||||
const aliasMap = {};
|
||||
// Handle fully specified imports like `next/image.js`
|
||||
for (const [key, value] of Object.entries(mapping)){
|
||||
const nextApiFilePath = _path.default.join(_webpackconfig.NEXT_PROJECT_ROOT, key);
|
||||
aliasMap[nextApiFilePath + ".js"] = value;
|
||||
}
|
||||
return aliasMap;
|
||||
}
|
||||
function createAppRouterApiAliases(isServerOnlyLayer) {
|
||||
const mapping = {
|
||||
head: "next/dist/client/components/noop-head",
|
||||
dynamic: "next/dist/api/app-dynamic"
|
||||
};
|
||||
if (isServerOnlyLayer) {
|
||||
mapping["navigation"] = "next/dist/api/navigation.react-server";
|
||||
}
|
||||
const aliasMap = {};
|
||||
for (const [key, value] of Object.entries(mapping)){
|
||||
const nextApiFilePath = _path.default.join(_webpackconfig.NEXT_PROJECT_ROOT, key);
|
||||
aliasMap[nextApiFilePath + ".js"] = value;
|
||||
}
|
||||
return aliasMap;
|
||||
}
|
||||
function createRSCAliases(bundledReactChannel, { layer, isEdgeServer, reactProductionProfiling }) {
|
||||
let alias = {
|
||||
react$: `next/dist/compiled/react${bundledReactChannel}`,
|
||||
"react-dom$": `next/dist/compiled/react-dom${bundledReactChannel}`,
|
||||
"react/jsx-runtime$": `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,
|
||||
"react/jsx-dev-runtime$": `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,
|
||||
"react-dom/client$": `next/dist/compiled/react-dom${bundledReactChannel}/client`,
|
||||
"react-dom/server$": `next/dist/compiled/react-dom${bundledReactChannel}/server`,
|
||||
"react-dom/static$": `next/dist/compiled/react-dom-experimental/static`,
|
||||
"react-dom/static.edge$": `next/dist/compiled/react-dom-experimental/static.edge`,
|
||||
"react-dom/static.browser$": `next/dist/compiled/react-dom-experimental/static.browser`,
|
||||
// optimizations to ignore the legacy build of react-dom/server in `server.browser` build
|
||||
"react-dom/server.edge$": `next/dist/build/webpack/alias/react-dom-server-edge${bundledReactChannel}.js`,
|
||||
"react-dom/server.browser$": `next/dist/build/webpack/alias/react-dom-server-browser${bundledReactChannel}.js`,
|
||||
// react-server-dom-webpack alias
|
||||
"react-server-dom-webpack/client$": `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client`,
|
||||
"react-server-dom-webpack/client.edge$": `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.edge`,
|
||||
"react-server-dom-webpack/server.edge$": `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.edge`,
|
||||
"react-server-dom-webpack/server.node$": `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`
|
||||
};
|
||||
if (!isEdgeServer) {
|
||||
if (layer === _constants.WEBPACK_LAYERS.serverSideRendering) {
|
||||
alias = Object.assign(alias, {
|
||||
"react/jsx-runtime$": `next/dist/server/future/route-modules/app-page/vendored/${layer}/react-jsx-runtime`,
|
||||
"react/jsx-dev-runtime$": `next/dist/server/future/route-modules/app-page/vendored/${layer}/react-jsx-dev-runtime`,
|
||||
react$: `next/dist/server/future/route-modules/app-page/vendored/${layer}/react`,
|
||||
"react-dom$": `next/dist/server/future/route-modules/app-page/vendored/${layer}/react-dom`,
|
||||
"react-server-dom-webpack/client.edge$": `next/dist/server/future/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-client-edge`
|
||||
});
|
||||
} else if (layer === _constants.WEBPACK_LAYERS.reactServerComponents) {
|
||||
alias = Object.assign(alias, {
|
||||
"react/jsx-runtime$": `next/dist/server/future/route-modules/app-page/vendored/${layer}/react-jsx-runtime`,
|
||||
"react/jsx-dev-runtime$": `next/dist/server/future/route-modules/app-page/vendored/${layer}/react-jsx-dev-runtime`,
|
||||
react$: `next/dist/server/future/route-modules/app-page/vendored/${layer}/react`,
|
||||
"react-dom$": `next/dist/server/future/route-modules/app-page/vendored/${layer}/react-dom`,
|
||||
"react-server-dom-webpack/server.edge$": `next/dist/server/future/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-server-edge`,
|
||||
"react-server-dom-webpack/server.node$": `next/dist/server/future/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-server-node`
|
||||
});
|
||||
}
|
||||
}
|
||||
if (isEdgeServer) {
|
||||
if (layer === _constants.WEBPACK_LAYERS.reactServerComponents) {
|
||||
alias["react$"] = `next/dist/compiled/react${bundledReactChannel}/react.react-server`;
|
||||
alias["react-dom$"] = `next/dist/compiled/react-dom${bundledReactChannel}/react-dom.react-server`;
|
||||
} else {
|
||||
// x-ref: https://github.com/facebook/react/pull/25436
|
||||
alias["react-dom$"] = `next/dist/compiled/react-dom${bundledReactChannel}/server-rendering-stub`;
|
||||
}
|
||||
}
|
||||
if (reactProductionProfiling) {
|
||||
alias["react-dom$"] = `next/dist/compiled/react-dom${bundledReactChannel}/profiling`;
|
||||
}
|
||||
alias["@vercel/turbopack-ecmascript-runtime/dev/client/hmr-client.ts"] = `next/dist/client/dev/noop-turbopack-hmr`;
|
||||
return alias;
|
||||
}
|
||||
function getOptimizedModuleAliases() {
|
||||
return {
|
||||
unfetch: require.resolve("next/dist/build/polyfills/fetch/index.js"),
|
||||
"isomorphic-unfetch": require.resolve("next/dist/build/polyfills/fetch/index.js"),
|
||||
"whatwg-fetch": require.resolve("next/dist/build/polyfills/fetch/whatwg-fetch.js"),
|
||||
"object-assign": require.resolve("next/dist/build/polyfills/object-assign.js"),
|
||||
"object.assign/auto": require.resolve("next/dist/build/polyfills/object.assign/auto.js"),
|
||||
"object.assign/implementation": require.resolve("next/dist/build/polyfills/object.assign/implementation.js"),
|
||||
"object.assign/polyfill": require.resolve("next/dist/build/polyfills/object.assign/polyfill.js"),
|
||||
"object.assign/shim": require.resolve("next/dist/build/polyfills/object.assign/shim.js"),
|
||||
url: require.resolve("next/dist/compiled/native-url")
|
||||
};
|
||||
}
|
||||
// Alias these modules to be resolved with "module" if possible.
|
||||
function getBarrelOptimizationAliases(packages) {
|
||||
const aliases = {};
|
||||
const mainFields = [
|
||||
"module",
|
||||
"main"
|
||||
];
|
||||
for (const pkg of packages){
|
||||
try {
|
||||
const descriptionFileData = require(`${pkg}/package.json`);
|
||||
const descriptionFilePath = require.resolve(`${pkg}/package.json`);
|
||||
for (const field of mainFields){
|
||||
if (descriptionFileData.hasOwnProperty(field)) {
|
||||
aliases[pkg + "$"] = _path.default.join(_path.default.dirname(descriptionFilePath), descriptionFileData[field]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
return aliases;
|
||||
}
|
||||
function getReactProfilingInProduction() {
|
||||
return {
|
||||
"react-dom$": "react-dom/profiling"
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=create-compiler-aliases.js.map
|
||||
1
node_modules/next/dist/build/create-compiler-aliases.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/create-compiler-aliases.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/next/dist/build/deployment-id.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/build/deployment-id.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function getDeploymentIdQueryOrEmptyString(): string;
|
||||
18
node_modules/next/dist/build/deployment-id.js
generated
vendored
Normal file
18
node_modules/next/dist/build/deployment-id.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "getDeploymentIdQueryOrEmptyString", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return getDeploymentIdQueryOrEmptyString;
|
||||
}
|
||||
});
|
||||
function getDeploymentIdQueryOrEmptyString() {
|
||||
if (process.env.NEXT_DEPLOYMENT_ID) {
|
||||
return `?dpl=${process.env.NEXT_DEPLOYMENT_ID}`;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
//# sourceMappingURL=deployment-id.js.map
|
||||
1
node_modules/next/dist/build/deployment-id.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/deployment-id.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/build/deployment-id.ts"],"names":["getDeploymentIdQueryOrEmptyString","process","env","NEXT_DEPLOYMENT_ID"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA;IACd,IAAIC,QAAQC,GAAG,CAACC,kBAAkB,EAAE;QAClC,OAAO,CAAC,KAAK,EAAEF,QAAQC,GAAG,CAACC,kBAAkB,CAAC,CAAC;IACjD;IACA,OAAO;AACT"}
|
||||
122
node_modules/next/dist/build/entries.d.ts
generated
vendored
Normal file
122
node_modules/next/dist/build/entries.d.ts
generated
vendored
Normal file
@ -0,0 +1,122 @@
|
||||
import type { NextConfigComplete } from '../server/config-shared';
|
||||
import type { webpack } from 'next/dist/compiled/webpack/webpack';
|
||||
import type { MiddlewareConfigParsed, MiddlewareConfig, PageStaticInfo } from './analysis/get-page-static-info';
|
||||
import type { LoadedEnvFiles } from '@next/env';
|
||||
import type { AppLoaderOptions } from './webpack/loaders/next-app-loader';
|
||||
import type { CompilerNameValues } from '../shared/lib/constants';
|
||||
import type { __ApiPreviewProps } from '../server/api-utils';
|
||||
import type { ServerRuntime } from '../../types';
|
||||
import type { PageExtensions } from './page-extensions-type';
|
||||
import type { MappedPages } from './build-context';
|
||||
import { PAGE_TYPES } from '../lib/page-types';
|
||||
export declare function sortByPageExts(pageExtensions: PageExtensions): (a: string, b: string) => number;
|
||||
export declare function getStaticInfoIncludingLayouts({ isInsideAppDir, pageExtensions, pageFilePath, appDir, config, isDev, page, }: {
|
||||
isInsideAppDir: boolean;
|
||||
pageExtensions: PageExtensions;
|
||||
pageFilePath: string;
|
||||
appDir: string | undefined;
|
||||
config: NextConfigComplete;
|
||||
isDev: boolean | undefined;
|
||||
page: string;
|
||||
}): Promise<PageStaticInfo>;
|
||||
type ObjectValue<T> = T extends {
|
||||
[key: string]: infer V;
|
||||
} ? V : never;
|
||||
/**
|
||||
* For a given page path removes the provided extensions.
|
||||
*/
|
||||
export declare function getPageFromPath(pagePath: string, pageExtensions: PageExtensions): string;
|
||||
export declare function getPageFilePath({ absolutePagePath, pagesDir, appDir, rootDir, }: {
|
||||
absolutePagePath: string;
|
||||
pagesDir: string | undefined;
|
||||
appDir: string | undefined;
|
||||
rootDir: string;
|
||||
}): string;
|
||||
/**
|
||||
* Creates a mapping of route to page file path for a given list of page paths.
|
||||
* For example ['/middleware.ts'] is turned into { '/middleware': `${ROOT_DIR_ALIAS}/middleware.ts` }
|
||||
*/
|
||||
export declare function createPagesMapping({ isDev, pageExtensions, pagePaths, pagesType, pagesDir, }: {
|
||||
isDev: boolean;
|
||||
pageExtensions: PageExtensions;
|
||||
pagePaths: string[];
|
||||
pagesType: PAGE_TYPES;
|
||||
pagesDir: string | undefined;
|
||||
}): MappedPages;
|
||||
export interface CreateEntrypointsParams {
|
||||
buildId: string;
|
||||
config: NextConfigComplete;
|
||||
envFiles: LoadedEnvFiles;
|
||||
isDev?: boolean;
|
||||
pages: MappedPages;
|
||||
pagesDir?: string;
|
||||
previewMode: __ApiPreviewProps;
|
||||
rootDir: string;
|
||||
rootPaths?: MappedPages;
|
||||
appDir?: string;
|
||||
appPaths?: MappedPages;
|
||||
pageExtensions: PageExtensions;
|
||||
hasInstrumentationHook?: boolean;
|
||||
}
|
||||
export declare function getEdgeServerEntry(opts: {
|
||||
rootDir: string;
|
||||
absolutePagePath: string;
|
||||
buildId: string;
|
||||
bundlePath: string;
|
||||
config: NextConfigComplete;
|
||||
isDev: boolean;
|
||||
isServerComponent: boolean;
|
||||
page: string;
|
||||
pages: MappedPages;
|
||||
middleware?: Partial<MiddlewareConfigParsed>;
|
||||
pagesType: PAGE_TYPES;
|
||||
appDirLoader?: string;
|
||||
hasInstrumentationHook?: boolean;
|
||||
preferredRegion: string | string[] | undefined;
|
||||
middlewareConfig?: MiddlewareConfig;
|
||||
}): string | {
|
||||
import: string;
|
||||
layer: "rsc";
|
||||
} | {
|
||||
import: string;
|
||||
layer: "ssr" | undefined;
|
||||
};
|
||||
export declare function getInstrumentationEntry(opts: {
|
||||
absolutePagePath: string;
|
||||
isEdgeServer: boolean;
|
||||
isDev: boolean;
|
||||
}): {
|
||||
import: string;
|
||||
filename: string;
|
||||
layer: "instrument";
|
||||
};
|
||||
export declare function getAppEntry(opts: Readonly<AppLoaderOptions>): {
|
||||
import: string;
|
||||
layer: "rsc";
|
||||
};
|
||||
export declare function getClientEntry(opts: {
|
||||
absolutePagePath: string;
|
||||
page: string;
|
||||
}): string | string[];
|
||||
export declare function runDependingOnPageType<T>(params: {
|
||||
onClient: () => T;
|
||||
onEdgeServer: () => T;
|
||||
onServer: () => T;
|
||||
page: string;
|
||||
pageRuntime: ServerRuntime;
|
||||
pageType?: PAGE_TYPES;
|
||||
}): void;
|
||||
export declare function createEntrypoints(params: CreateEntrypointsParams): Promise<{
|
||||
client: webpack.EntryObject;
|
||||
server: webpack.EntryObject;
|
||||
edgeServer: webpack.EntryObject;
|
||||
middlewareMatchers: undefined;
|
||||
}>;
|
||||
export declare function finalizeEntrypoint({ name, compilerType, value, isServerComponent, hasAppDir, }: {
|
||||
compilerType?: CompilerNameValues;
|
||||
name: string;
|
||||
value: ObjectValue<webpack.EntryObject>;
|
||||
isServerComponent?: boolean;
|
||||
hasAppDir?: boolean;
|
||||
}): ObjectValue<webpack.EntryObject>;
|
||||
export {};
|
||||
624
node_modules/next/dist/build/entries.js
generated
vendored
Normal file
624
node_modules/next/dist/build/entries.js
generated
vendored
Normal file
@ -0,0 +1,624 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
createEntrypoints: null,
|
||||
createPagesMapping: null,
|
||||
finalizeEntrypoint: null,
|
||||
getAppEntry: null,
|
||||
getClientEntry: null,
|
||||
getEdgeServerEntry: null,
|
||||
getInstrumentationEntry: null,
|
||||
getPageFilePath: null,
|
||||
getPageFromPath: null,
|
||||
getStaticInfoIncludingLayouts: null,
|
||||
runDependingOnPageType: null,
|
||||
sortByPageExts: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
createEntrypoints: function() {
|
||||
return createEntrypoints;
|
||||
},
|
||||
createPagesMapping: function() {
|
||||
return createPagesMapping;
|
||||
},
|
||||
finalizeEntrypoint: function() {
|
||||
return finalizeEntrypoint;
|
||||
},
|
||||
getAppEntry: function() {
|
||||
return getAppEntry;
|
||||
},
|
||||
getClientEntry: function() {
|
||||
return getClientEntry;
|
||||
},
|
||||
getEdgeServerEntry: function() {
|
||||
return getEdgeServerEntry;
|
||||
},
|
||||
getInstrumentationEntry: function() {
|
||||
return getInstrumentationEntry;
|
||||
},
|
||||
getPageFilePath: function() {
|
||||
return getPageFilePath;
|
||||
},
|
||||
getPageFromPath: function() {
|
||||
return getPageFromPath;
|
||||
},
|
||||
getStaticInfoIncludingLayouts: function() {
|
||||
return getStaticInfoIncludingLayouts;
|
||||
},
|
||||
runDependingOnPageType: function() {
|
||||
return runDependingOnPageType;
|
||||
},
|
||||
sortByPageExts: function() {
|
||||
return sortByPageExts;
|
||||
}
|
||||
});
|
||||
const _path = require("path");
|
||||
const _querystring = require("querystring");
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _constants = require("../lib/constants");
|
||||
const _isapiroute = require("../lib/is-api-route");
|
||||
const _isedgeruntime = require("../lib/is-edge-runtime");
|
||||
const _constants1 = require("../shared/lib/constants");
|
||||
const _utils = require("./utils");
|
||||
const _getpagestaticinfo = require("./analysis/get-page-static-info");
|
||||
const _normalizepathsep = require("../shared/lib/page-path/normalize-path-sep");
|
||||
const _normalizepagepath = require("../shared/lib/page-path/normalize-page-path");
|
||||
const _apppaths = require("../shared/lib/router/utils/app-paths");
|
||||
const _nextmiddlewareloader = require("./webpack/loaders/next-middleware-loader");
|
||||
const _isapprouteroute = require("../lib/is-app-route-route");
|
||||
const _getmetadataroute = require("../lib/metadata/get-metadata-route");
|
||||
const _nextrouteloader = require("./webpack/loaders/next-route-loader");
|
||||
const _isinternalcomponent = require("../lib/is-internal-component");
|
||||
const _ismetadataroute = require("../lib/metadata/is-metadata-route");
|
||||
const _routekind = require("../server/future/route-kind");
|
||||
const _utils1 = require("./webpack/loaders/utils");
|
||||
const _normalizecatchallroutes = require("./normalize-catchall-routes");
|
||||
const _pagetypes = require("../lib/page-types");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function sortByPageExts(pageExtensions) {
|
||||
return (a, b)=>{
|
||||
// prioritize entries according to pageExtensions order
|
||||
// for consistency as fs order can differ across systems
|
||||
// NOTE: this is reversed so preferred comes last and
|
||||
// overrides prior
|
||||
const aExt = (0, _path.extname)(a);
|
||||
const bExt = (0, _path.extname)(b);
|
||||
const aNoExt = a.substring(0, a.length - aExt.length);
|
||||
const bNoExt = a.substring(0, b.length - bExt.length);
|
||||
if (aNoExt !== bNoExt) return 0;
|
||||
// find extension index (skip '.' as pageExtensions doesn't have it)
|
||||
const aExtIndex = pageExtensions.indexOf(aExt.substring(1));
|
||||
const bExtIndex = pageExtensions.indexOf(bExt.substring(1));
|
||||
return bExtIndex - aExtIndex;
|
||||
};
|
||||
}
|
||||
async function getStaticInfoIncludingLayouts({ isInsideAppDir, pageExtensions, pageFilePath, appDir, config, isDev, page }) {
|
||||
const pageStaticInfo = await (0, _getpagestaticinfo.getPageStaticInfo)({
|
||||
nextConfig: config,
|
||||
pageFilePath,
|
||||
isDev,
|
||||
page,
|
||||
pageType: isInsideAppDir ? _pagetypes.PAGE_TYPES.APP : _pagetypes.PAGE_TYPES.PAGES
|
||||
});
|
||||
const staticInfo = isInsideAppDir ? {
|
||||
// TODO-APP: Remove the rsc key altogether. It's no longer required.
|
||||
rsc: "server"
|
||||
} : pageStaticInfo;
|
||||
if (isInsideAppDir && appDir) {
|
||||
const layoutFiles = [];
|
||||
const potentialLayoutFiles = pageExtensions.map((ext)=>"layout." + ext);
|
||||
let dir = (0, _path.dirname)(pageFilePath);
|
||||
// Uses startsWith to not include directories further up.
|
||||
while(dir.startsWith(appDir)){
|
||||
for (const potentialLayoutFile of potentialLayoutFiles){
|
||||
const layoutFile = (0, _path.join)(dir, potentialLayoutFile);
|
||||
if (!_fs.default.existsSync(layoutFile)) {
|
||||
continue;
|
||||
}
|
||||
layoutFiles.unshift(layoutFile);
|
||||
}
|
||||
// Walk up the directory tree
|
||||
dir = (0, _path.join)(dir, "..");
|
||||
}
|
||||
for (const layoutFile of layoutFiles){
|
||||
const layoutStaticInfo = await (0, _getpagestaticinfo.getPageStaticInfo)({
|
||||
nextConfig: config,
|
||||
pageFilePath: layoutFile,
|
||||
isDev,
|
||||
page,
|
||||
pageType: isInsideAppDir ? _pagetypes.PAGE_TYPES.APP : _pagetypes.PAGE_TYPES.PAGES
|
||||
});
|
||||
// Only runtime is relevant here.
|
||||
if (layoutStaticInfo.runtime) {
|
||||
staticInfo.runtime = layoutStaticInfo.runtime;
|
||||
}
|
||||
if (layoutStaticInfo.preferredRegion) {
|
||||
staticInfo.preferredRegion = layoutStaticInfo.preferredRegion;
|
||||
}
|
||||
}
|
||||
if (pageStaticInfo.runtime) {
|
||||
staticInfo.runtime = pageStaticInfo.runtime;
|
||||
}
|
||||
if (pageStaticInfo.preferredRegion) {
|
||||
staticInfo.preferredRegion = pageStaticInfo.preferredRegion;
|
||||
}
|
||||
// if it's static metadata route, don't inherit runtime from layout
|
||||
const relativePath = pageFilePath.replace(appDir, "");
|
||||
if ((0, _ismetadataroute.isStaticMetadataRouteFile)(relativePath)) {
|
||||
delete staticInfo.runtime;
|
||||
delete staticInfo.preferredRegion;
|
||||
}
|
||||
}
|
||||
return staticInfo;
|
||||
}
|
||||
function getPageFromPath(pagePath, pageExtensions) {
|
||||
let page = (0, _normalizepathsep.normalizePathSep)(pagePath.replace(new RegExp(`\\.+(${pageExtensions.join("|")})$`), ""));
|
||||
page = page.replace(/\/index$/, "");
|
||||
return page === "" ? "/" : page;
|
||||
}
|
||||
function getPageFilePath({ absolutePagePath, pagesDir, appDir, rootDir }) {
|
||||
if (absolutePagePath.startsWith(_constants.PAGES_DIR_ALIAS) && pagesDir) {
|
||||
return absolutePagePath.replace(_constants.PAGES_DIR_ALIAS, pagesDir);
|
||||
}
|
||||
if (absolutePagePath.startsWith(_constants.APP_DIR_ALIAS) && appDir) {
|
||||
return absolutePagePath.replace(_constants.APP_DIR_ALIAS, appDir);
|
||||
}
|
||||
if (absolutePagePath.startsWith(_constants.ROOT_DIR_ALIAS)) {
|
||||
return absolutePagePath.replace(_constants.ROOT_DIR_ALIAS, rootDir);
|
||||
}
|
||||
return require.resolve(absolutePagePath);
|
||||
}
|
||||
function createPagesMapping({ isDev, pageExtensions, pagePaths, pagesType, pagesDir }) {
|
||||
const isAppRoute = pagesType === "app";
|
||||
const pages = pagePaths.reduce((result, pagePath)=>{
|
||||
// Do not process .d.ts files as routes
|
||||
if (pagePath.endsWith(".d.ts") && pageExtensions.includes("ts")) {
|
||||
return result;
|
||||
}
|
||||
let pageKey = getPageFromPath(pagePath, pageExtensions);
|
||||
if (isAppRoute) {
|
||||
pageKey = pageKey.replace(/%5F/g, "_");
|
||||
if (pageKey === "/not-found") {
|
||||
pageKey = _constants1.UNDERSCORE_NOT_FOUND_ROUTE_ENTRY;
|
||||
}
|
||||
}
|
||||
const normalizedPath = (0, _normalizepathsep.normalizePathSep)((0, _path.join)(pagesType === "pages" ? _constants.PAGES_DIR_ALIAS : pagesType === "app" ? _constants.APP_DIR_ALIAS : _constants.ROOT_DIR_ALIAS, pagePath));
|
||||
const route = pagesType === "app" ? (0, _getmetadataroute.normalizeMetadataRoute)(pageKey) : pageKey;
|
||||
result[route] = normalizedPath;
|
||||
return result;
|
||||
}, {});
|
||||
switch(pagesType){
|
||||
case _pagetypes.PAGE_TYPES.ROOT:
|
||||
{
|
||||
return pages;
|
||||
}
|
||||
case _pagetypes.PAGE_TYPES.APP:
|
||||
{
|
||||
const hasAppPages = Object.keys(pages).some((page)=>page.endsWith("/page"));
|
||||
return {
|
||||
// If there's any app pages existed, add a default not-found page.
|
||||
// If there's any custom not-found page existed, it will override the default one.
|
||||
...hasAppPages && {
|
||||
[_constants1.UNDERSCORE_NOT_FOUND_ROUTE_ENTRY]: "next/dist/client/components/not-found-error"
|
||||
},
|
||||
...pages
|
||||
};
|
||||
}
|
||||
case _pagetypes.PAGE_TYPES.PAGES:
|
||||
{
|
||||
if (isDev) {
|
||||
delete pages["/_app"];
|
||||
delete pages["/_error"];
|
||||
delete pages["/_document"];
|
||||
}
|
||||
// In development we always alias these to allow Webpack to fallback to
|
||||
// the correct source file so that HMR can work properly when a file is
|
||||
// added or removed.
|
||||
const root = isDev && pagesDir ? _constants.PAGES_DIR_ALIAS : "next/dist/pages";
|
||||
return {
|
||||
"/_app": `${root}/_app`,
|
||||
"/_error": `${root}/_error`,
|
||||
"/_document": `${root}/_document`,
|
||||
...pages
|
||||
};
|
||||
}
|
||||
default:
|
||||
{
|
||||
return {};
|
||||
}
|
||||
}
|
||||
}
|
||||
function getEdgeServerEntry(opts) {
|
||||
var _opts_config_experimental_sri;
|
||||
if (opts.pagesType === "app" && (0, _isapprouteroute.isAppRouteRoute)(opts.page) && opts.appDirLoader) {
|
||||
const loaderParams = {
|
||||
absolutePagePath: opts.absolutePagePath,
|
||||
page: opts.page,
|
||||
appDirLoader: Buffer.from(opts.appDirLoader || "").toString("base64"),
|
||||
nextConfigOutput: opts.config.output,
|
||||
preferredRegion: opts.preferredRegion,
|
||||
middlewareConfig: Buffer.from(JSON.stringify(opts.middlewareConfig || {})).toString("base64")
|
||||
};
|
||||
return {
|
||||
import: `next-edge-app-route-loader?${(0, _querystring.stringify)(loaderParams)}!`,
|
||||
layer: _constants.WEBPACK_LAYERS.reactServerComponents
|
||||
};
|
||||
}
|
||||
if ((0, _utils.isMiddlewareFile)(opts.page)) {
|
||||
var _opts_middleware;
|
||||
const loaderParams = {
|
||||
absolutePagePath: opts.absolutePagePath,
|
||||
page: opts.page,
|
||||
rootDir: opts.rootDir,
|
||||
matchers: ((_opts_middleware = opts.middleware) == null ? void 0 : _opts_middleware.matchers) ? (0, _nextmiddlewareloader.encodeMatchers)(opts.middleware.matchers) : "",
|
||||
preferredRegion: opts.preferredRegion,
|
||||
middlewareConfig: Buffer.from(JSON.stringify(opts.middlewareConfig || {})).toString("base64")
|
||||
};
|
||||
return `next-middleware-loader?${(0, _querystring.stringify)(loaderParams)}!`;
|
||||
}
|
||||
if ((0, _isapiroute.isAPIRoute)(opts.page)) {
|
||||
const loaderParams = {
|
||||
absolutePagePath: opts.absolutePagePath,
|
||||
page: opts.page,
|
||||
rootDir: opts.rootDir,
|
||||
preferredRegion: opts.preferredRegion,
|
||||
middlewareConfig: Buffer.from(JSON.stringify(opts.middlewareConfig || {})).toString("base64")
|
||||
};
|
||||
return `next-edge-function-loader?${(0, _querystring.stringify)(loaderParams)}!`;
|
||||
}
|
||||
const loaderParams = {
|
||||
absolute500Path: opts.pages["/500"] || "",
|
||||
absoluteAppPath: opts.pages["/_app"],
|
||||
absoluteDocumentPath: opts.pages["/_document"],
|
||||
absoluteErrorPath: opts.pages["/_error"],
|
||||
absolutePagePath: opts.absolutePagePath,
|
||||
dev: opts.isDev,
|
||||
isServerComponent: opts.isServerComponent,
|
||||
page: opts.page,
|
||||
stringifiedConfig: Buffer.from(JSON.stringify(opts.config)).toString("base64"),
|
||||
pagesType: opts.pagesType,
|
||||
appDirLoader: Buffer.from(opts.appDirLoader || "").toString("base64"),
|
||||
sriEnabled: !opts.isDev && !!((_opts_config_experimental_sri = opts.config.experimental.sri) == null ? void 0 : _opts_config_experimental_sri.algorithm),
|
||||
cacheHandler: opts.config.cacheHandler,
|
||||
preferredRegion: opts.preferredRegion,
|
||||
middlewareConfig: Buffer.from(JSON.stringify(opts.middlewareConfig || {})).toString("base64"),
|
||||
serverActions: opts.config.experimental.serverActions
|
||||
};
|
||||
return {
|
||||
import: `next-edge-ssr-loader?${JSON.stringify(loaderParams)}!`,
|
||||
// The Edge bundle includes the server in its entrypoint, so it has to
|
||||
// be in the SSR layer — we later convert the page request to the RSC layer
|
||||
// via a webpack rule.
|
||||
layer: opts.appDirLoader ? _constants.WEBPACK_LAYERS.serverSideRendering : undefined
|
||||
};
|
||||
}
|
||||
function getInstrumentationEntry(opts) {
|
||||
// the '../' is needed to make sure the file is not chunked
|
||||
const filename = `${opts.isEdgeServer ? "edge-" : opts.isDev ? "" : "../"}${_constants.INSTRUMENTATION_HOOK_FILENAME}.js`;
|
||||
return {
|
||||
import: opts.absolutePagePath,
|
||||
filename,
|
||||
layer: _constants.WEBPACK_LAYERS.instrument
|
||||
};
|
||||
}
|
||||
function getAppEntry(opts) {
|
||||
return {
|
||||
import: `next-app-loader?${(0, _querystring.stringify)(opts)}!`,
|
||||
layer: _constants.WEBPACK_LAYERS.reactServerComponents
|
||||
};
|
||||
}
|
||||
function getClientEntry(opts) {
|
||||
const loaderOptions = {
|
||||
absolutePagePath: opts.absolutePagePath,
|
||||
page: opts.page
|
||||
};
|
||||
const pageLoader = `next-client-pages-loader?${(0, _querystring.stringify)(loaderOptions)}!`;
|
||||
// Make sure next/router is a dependency of _app or else chunk splitting
|
||||
// might cause the router to not be able to load causing hydration
|
||||
// to fail
|
||||
return opts.page === "/_app" ? [
|
||||
pageLoader,
|
||||
require.resolve("../client/router")
|
||||
] : pageLoader;
|
||||
}
|
||||
function runDependingOnPageType(params) {
|
||||
if (params.pageType === _pagetypes.PAGE_TYPES.ROOT && (0, _utils.isInstrumentationHookFile)(params.page)) {
|
||||
params.onServer();
|
||||
params.onEdgeServer();
|
||||
return;
|
||||
}
|
||||
if ((0, _utils.isMiddlewareFile)(params.page)) {
|
||||
params.onEdgeServer();
|
||||
return;
|
||||
}
|
||||
if ((0, _isapiroute.isAPIRoute)(params.page)) {
|
||||
if ((0, _isedgeruntime.isEdgeRuntime)(params.pageRuntime)) {
|
||||
params.onEdgeServer();
|
||||
return;
|
||||
}
|
||||
params.onServer();
|
||||
return;
|
||||
}
|
||||
if (params.page === "/_document") {
|
||||
params.onServer();
|
||||
return;
|
||||
}
|
||||
if (params.page === "/_app" || params.page === "/_error" || params.page === "/404" || params.page === "/500") {
|
||||
params.onClient();
|
||||
params.onServer();
|
||||
return;
|
||||
}
|
||||
if ((0, _isedgeruntime.isEdgeRuntime)(params.pageRuntime)) {
|
||||
params.onClient();
|
||||
params.onEdgeServer();
|
||||
return;
|
||||
}
|
||||
params.onClient();
|
||||
params.onServer();
|
||||
return;
|
||||
}
|
||||
async function createEntrypoints(params) {
|
||||
const { config, pages, pagesDir, isDev, rootDir, rootPaths, appDir, appPaths, pageExtensions } = params;
|
||||
const edgeServer = {};
|
||||
const server = {};
|
||||
const client = {};
|
||||
let middlewareMatchers = undefined;
|
||||
let appPathsPerRoute = {};
|
||||
if (appDir && appPaths) {
|
||||
for(const pathname in appPaths){
|
||||
const normalizedPath = (0, _apppaths.normalizeAppPath)(pathname);
|
||||
const actualPath = appPaths[pathname];
|
||||
if (!appPathsPerRoute[normalizedPath]) {
|
||||
appPathsPerRoute[normalizedPath] = [];
|
||||
}
|
||||
appPathsPerRoute[normalizedPath].push(// TODO-APP: refactor to pass the page path from createPagesMapping instead.
|
||||
getPageFromPath(actualPath, pageExtensions).replace(_constants.APP_DIR_ALIAS, ""));
|
||||
}
|
||||
// TODO: find a better place to do this
|
||||
(0, _normalizecatchallroutes.normalizeCatchAllRoutes)(appPathsPerRoute);
|
||||
// Make sure to sort parallel routes to make the result deterministic.
|
||||
appPathsPerRoute = Object.fromEntries(Object.entries(appPathsPerRoute).map(([k, v])=>[
|
||||
k,
|
||||
v.sort()
|
||||
]));
|
||||
}
|
||||
const getEntryHandler = (mappings, pagesType)=>async (page)=>{
|
||||
const bundleFile = (0, _normalizepagepath.normalizePagePath)(page);
|
||||
const clientBundlePath = _path.posix.join(pagesType, bundleFile);
|
||||
const serverBundlePath = pagesType === _pagetypes.PAGE_TYPES.PAGES ? _path.posix.join("pages", bundleFile) : pagesType === _pagetypes.PAGE_TYPES.APP ? _path.posix.join("app", bundleFile) : bundleFile.slice(1);
|
||||
const absolutePagePath = mappings[page];
|
||||
// Handle paths that have aliases
|
||||
const pageFilePath = getPageFilePath({
|
||||
absolutePagePath,
|
||||
pagesDir,
|
||||
appDir,
|
||||
rootDir
|
||||
});
|
||||
const isInsideAppDir = !!appDir && (absolutePagePath.startsWith(_constants.APP_DIR_ALIAS) || absolutePagePath.startsWith(appDir));
|
||||
const staticInfo = await getStaticInfoIncludingLayouts({
|
||||
isInsideAppDir,
|
||||
pageExtensions,
|
||||
pageFilePath,
|
||||
appDir,
|
||||
config,
|
||||
isDev,
|
||||
page
|
||||
});
|
||||
// TODO(timneutkens): remove this
|
||||
const isServerComponent = isInsideAppDir && staticInfo.rsc !== _constants1.RSC_MODULE_TYPES.client;
|
||||
if ((0, _utils.isMiddlewareFile)(page)) {
|
||||
var _staticInfo_middleware;
|
||||
middlewareMatchers = ((_staticInfo_middleware = staticInfo.middleware) == null ? void 0 : _staticInfo_middleware.matchers) ?? [
|
||||
{
|
||||
regexp: ".*",
|
||||
originalSource: "/:path*"
|
||||
}
|
||||
];
|
||||
}
|
||||
const isInstrumentation = (0, _utils.isInstrumentationHookFile)(page) && pagesType === _pagetypes.PAGE_TYPES.ROOT;
|
||||
runDependingOnPageType({
|
||||
page,
|
||||
pageRuntime: staticInfo.runtime,
|
||||
pageType: pagesType,
|
||||
onClient: ()=>{
|
||||
if (isServerComponent || isInsideAppDir) {
|
||||
// We skip the initial entries for server component pages and let the
|
||||
// server compiler inject them instead.
|
||||
} else {
|
||||
client[clientBundlePath] = getClientEntry({
|
||||
absolutePagePath,
|
||||
page
|
||||
});
|
||||
}
|
||||
},
|
||||
onServer: ()=>{
|
||||
if (pagesType === "app" && appDir) {
|
||||
const matchedAppPaths = appPathsPerRoute[(0, _apppaths.normalizeAppPath)(page)];
|
||||
server[serverBundlePath] = getAppEntry({
|
||||
page,
|
||||
name: serverBundlePath,
|
||||
pagePath: absolutePagePath,
|
||||
appDir,
|
||||
appPaths: matchedAppPaths,
|
||||
pageExtensions,
|
||||
basePath: config.basePath,
|
||||
assetPrefix: config.assetPrefix,
|
||||
nextConfigOutput: config.output,
|
||||
nextConfigExperimentalUseEarlyImport: config.experimental.useEarlyImport,
|
||||
preferredRegion: staticInfo.preferredRegion,
|
||||
middlewareConfig: (0, _utils1.encodeToBase64)(staticInfo.middleware || {})
|
||||
});
|
||||
} else if (isInstrumentation) {
|
||||
server[serverBundlePath.replace("src/", "")] = getInstrumentationEntry({
|
||||
absolutePagePath,
|
||||
isEdgeServer: false,
|
||||
isDev: false
|
||||
});
|
||||
} else if ((0, _isapiroute.isAPIRoute)(page)) {
|
||||
server[serverBundlePath] = [
|
||||
(0, _nextrouteloader.getRouteLoaderEntry)({
|
||||
kind: _routekind.RouteKind.PAGES_API,
|
||||
page,
|
||||
absolutePagePath,
|
||||
preferredRegion: staticInfo.preferredRegion,
|
||||
middlewareConfig: staticInfo.middleware || {}
|
||||
})
|
||||
];
|
||||
} else if (!(0, _utils.isMiddlewareFile)(page) && !(0, _isinternalcomponent.isInternalComponent)(absolutePagePath) && !(0, _isinternalcomponent.isNonRoutePagesPage)(page)) {
|
||||
server[serverBundlePath] = [
|
||||
(0, _nextrouteloader.getRouteLoaderEntry)({
|
||||
kind: _routekind.RouteKind.PAGES,
|
||||
page,
|
||||
pages,
|
||||
absolutePagePath,
|
||||
preferredRegion: staticInfo.preferredRegion,
|
||||
middlewareConfig: staticInfo.middleware ?? {}
|
||||
})
|
||||
];
|
||||
} else {
|
||||
server[serverBundlePath] = [
|
||||
absolutePagePath
|
||||
];
|
||||
}
|
||||
},
|
||||
onEdgeServer: ()=>{
|
||||
let appDirLoader = "";
|
||||
if (isInstrumentation) {
|
||||
edgeServer[serverBundlePath.replace("src/", "")] = getInstrumentationEntry({
|
||||
absolutePagePath,
|
||||
isEdgeServer: true,
|
||||
isDev: false
|
||||
});
|
||||
} else {
|
||||
if (pagesType === "app") {
|
||||
const matchedAppPaths = appPathsPerRoute[(0, _apppaths.normalizeAppPath)(page)];
|
||||
appDirLoader = getAppEntry({
|
||||
name: serverBundlePath,
|
||||
page,
|
||||
pagePath: absolutePagePath,
|
||||
appDir: appDir,
|
||||
appPaths: matchedAppPaths,
|
||||
pageExtensions,
|
||||
basePath: config.basePath,
|
||||
assetPrefix: config.assetPrefix,
|
||||
nextConfigOutput: config.output,
|
||||
// This isn't used with edge as it needs to be set on the entry module, which will be the `edgeServerEntry` instead.
|
||||
// Still passing it here for consistency.
|
||||
preferredRegion: staticInfo.preferredRegion,
|
||||
middlewareConfig: Buffer.from(JSON.stringify(staticInfo.middleware || {})).toString("base64")
|
||||
}).import;
|
||||
}
|
||||
edgeServer[serverBundlePath] = getEdgeServerEntry({
|
||||
...params,
|
||||
rootDir,
|
||||
absolutePagePath: absolutePagePath,
|
||||
bundlePath: clientBundlePath,
|
||||
isDev: false,
|
||||
isServerComponent,
|
||||
page,
|
||||
middleware: staticInfo == null ? void 0 : staticInfo.middleware,
|
||||
pagesType,
|
||||
appDirLoader,
|
||||
preferredRegion: staticInfo.preferredRegion,
|
||||
middlewareConfig: staticInfo.middleware
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
const promises = [];
|
||||
if (appPaths) {
|
||||
const entryHandler = getEntryHandler(appPaths, _pagetypes.PAGE_TYPES.APP);
|
||||
promises.push(Promise.all(Object.keys(appPaths).map(entryHandler)));
|
||||
}
|
||||
if (rootPaths) {
|
||||
promises.push(Promise.all(Object.keys(rootPaths).map(getEntryHandler(rootPaths, _pagetypes.PAGE_TYPES.ROOT))));
|
||||
}
|
||||
promises.push(Promise.all(Object.keys(pages).map(getEntryHandler(pages, _pagetypes.PAGE_TYPES.PAGES))));
|
||||
await Promise.all(promises);
|
||||
return {
|
||||
client,
|
||||
server,
|
||||
edgeServer,
|
||||
middlewareMatchers
|
||||
};
|
||||
}
|
||||
function finalizeEntrypoint({ name, compilerType, value, isServerComponent, hasAppDir }) {
|
||||
const entry = typeof value !== "object" || Array.isArray(value) ? {
|
||||
import: value
|
||||
} : value;
|
||||
const isApi = name.startsWith("pages/api/");
|
||||
const isInstrumentation = (0, _utils.isInstrumentationHookFilename)(name);
|
||||
switch(compilerType){
|
||||
case _constants1.COMPILER_NAMES.server:
|
||||
{
|
||||
const layer = isApi ? _constants.WEBPACK_LAYERS.api : isInstrumentation ? _constants.WEBPACK_LAYERS.instrument : isServerComponent ? _constants.WEBPACK_LAYERS.reactServerComponents : undefined;
|
||||
return {
|
||||
publicPath: isApi ? "" : undefined,
|
||||
runtime: isApi ? "webpack-api-runtime" : "webpack-runtime",
|
||||
layer,
|
||||
...entry
|
||||
};
|
||||
}
|
||||
case _constants1.COMPILER_NAMES.edgeServer:
|
||||
{
|
||||
return {
|
||||
layer: (0, _utils.isMiddlewareFilename)(name) || isApi || isInstrumentation ? _constants.WEBPACK_LAYERS.middleware : undefined,
|
||||
library: {
|
||||
name: [
|
||||
"_ENTRIES",
|
||||
`middleware_[name]`
|
||||
],
|
||||
type: "assign"
|
||||
},
|
||||
runtime: _constants1.EDGE_RUNTIME_WEBPACK,
|
||||
asyncChunks: false,
|
||||
...entry
|
||||
};
|
||||
}
|
||||
case _constants1.COMPILER_NAMES.client:
|
||||
{
|
||||
const isAppLayer = hasAppDir && (name === _constants1.CLIENT_STATIC_FILES_RUNTIME_MAIN_APP || name === _constants1.APP_CLIENT_INTERNALS || name.startsWith("app/"));
|
||||
if (// Client special cases
|
||||
name !== _constants1.CLIENT_STATIC_FILES_RUNTIME_POLYFILLS && name !== _constants1.CLIENT_STATIC_FILES_RUNTIME_MAIN && name !== _constants1.CLIENT_STATIC_FILES_RUNTIME_MAIN_APP && name !== _constants1.CLIENT_STATIC_FILES_RUNTIME_AMP && name !== _constants1.CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH) {
|
||||
if (isAppLayer) {
|
||||
return {
|
||||
dependOn: _constants1.CLIENT_STATIC_FILES_RUNTIME_MAIN_APP,
|
||||
layer: _constants.WEBPACK_LAYERS.appPagesBrowser,
|
||||
...entry
|
||||
};
|
||||
}
|
||||
return {
|
||||
dependOn: name.startsWith("pages/") && name !== "pages/_app" ? "pages/_app" : _constants1.CLIENT_STATIC_FILES_RUNTIME_MAIN,
|
||||
...entry
|
||||
};
|
||||
}
|
||||
if (isAppLayer) {
|
||||
return {
|
||||
layer: _constants.WEBPACK_LAYERS.appPagesBrowser,
|
||||
...entry
|
||||
};
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
default:
|
||||
{
|
||||
// Should never happen.
|
||||
throw new Error("Invalid compiler type");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=entries.js.map
|
||||
1
node_modules/next/dist/build/entries.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/entries.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/next/dist/build/generate-build-id.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/build/generate-build-id.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function generateBuildId(generate: () => string | null | Promise<string | null>, fallback: () => string): Promise<string>;
|
||||
27
node_modules/next/dist/build/generate-build-id.js
generated
vendored
Normal file
27
node_modules/next/dist/build/generate-build-id.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "generateBuildId", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return generateBuildId;
|
||||
}
|
||||
});
|
||||
async function generateBuildId(generate, fallback) {
|
||||
let buildId = await generate();
|
||||
// If there's no buildId defined we'll fall back
|
||||
if (buildId === null) {
|
||||
// We also create a new buildId if it contains the word `ad` to avoid false
|
||||
// positives with ad blockers
|
||||
while(!buildId || /ad/i.test(buildId)){
|
||||
buildId = fallback();
|
||||
}
|
||||
}
|
||||
if (typeof buildId !== "string") {
|
||||
throw new Error("generateBuildId did not return a string. https://nextjs.org/docs/messages/generatebuildid-not-a-string");
|
||||
}
|
||||
return buildId.trim();
|
||||
}
|
||||
|
||||
//# sourceMappingURL=generate-build-id.js.map
|
||||
1
node_modules/next/dist/build/generate-build-id.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/generate-build-id.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/build/generate-build-id.ts"],"names":["generateBuildId","generate","fallback","buildId","test","Error","trim"],"mappings":";;;;+BAAsBA;;;eAAAA;;;AAAf,eAAeA,gBACpBC,QAAsD,EACtDC,QAAsB;IAEtB,IAAIC,UAAU,MAAMF;IACpB,gDAAgD;IAChD,IAAIE,YAAY,MAAM;QACpB,2EAA2E;QAC3E,6BAA6B;QAC7B,MAAO,CAACA,WAAW,MAAMC,IAAI,CAACD,SAAU;YACtCA,UAAUD;QACZ;IACF;IAEA,IAAI,OAAOC,YAAY,UAAU;QAC/B,MAAM,IAAIE,MACR;IAEJ;IAEA,OAAOF,QAAQG,IAAI;AACrB"}
|
||||
1
node_modules/next/dist/build/get-babel-config-file.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/build/get-babel-config-file.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function getBabelConfigFile(dir: string): string | undefined;
|
||||
35
node_modules/next/dist/build/get-babel-config-file.js
generated
vendored
Normal file
35
node_modules/next/dist/build/get-babel-config-file.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "getBabelConfigFile", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return getBabelConfigFile;
|
||||
}
|
||||
});
|
||||
const _path = require("path");
|
||||
const _fs = require("fs");
|
||||
const BABEL_CONFIG_FILES = [
|
||||
".babelrc",
|
||||
".babelrc.json",
|
||||
".babelrc.js",
|
||||
".babelrc.mjs",
|
||||
".babelrc.cjs",
|
||||
"babel.config.js",
|
||||
"babel.config.json",
|
||||
"babel.config.mjs",
|
||||
"babel.config.cjs"
|
||||
];
|
||||
function getBabelConfigFile(dir) {
|
||||
for (const filename of BABEL_CONFIG_FILES){
|
||||
const configFilePath = (0, _path.join)(dir, filename);
|
||||
const exists = (0, _fs.existsSync)(configFilePath);
|
||||
if (!exists) {
|
||||
continue;
|
||||
}
|
||||
return configFilePath;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=get-babel-config-file.js.map
|
||||
1
node_modules/next/dist/build/get-babel-config-file.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/get-babel-config-file.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/build/get-babel-config-file.ts"],"names":["getBabelConfigFile","BABEL_CONFIG_FILES","dir","filename","configFilePath","join","exists","existsSync"],"mappings":";;;;+BAegBA;;;eAAAA;;;sBAfK;oBACM;AAE3B,MAAMC,qBAAqB;IACzB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAEM,SAASD,mBAAmBE,GAAW;IAC5C,KAAK,MAAMC,YAAYF,mBAAoB;QACzC,MAAMG,iBAAiBC,IAAAA,UAAI,EAACH,KAAKC;QACjC,MAAMG,SAASC,IAAAA,cAAU,EAACH;QAC1B,IAAI,CAACE,QAAQ;YACX;QACF;QACA,OAAOF;IACT;AACF"}
|
||||
19
node_modules/next/dist/build/handle-externals.d.ts
generated
vendored
Normal file
19
node_modules/next/dist/build/handle-externals.d.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
import type { WebpackLayerName } from '../lib/constants';
|
||||
import type { NextConfigComplete } from '../server/config-shared';
|
||||
import type { ResolveOptions } from 'webpack';
|
||||
export declare function isResourceInPackages(resource: string, packageNames?: string[], packageDirMapping?: Map<string, string>): boolean;
|
||||
export declare function resolveExternal(dir: string, esmExternalsConfig: NextConfigComplete['experimental']['esmExternals'], context: string, request: string, isEsmRequested: boolean, _optOutBundlingPackages: string[], getResolve: (options: ResolveOptions) => (resolveContext: string, resolveRequest: string) => Promise<[string | null, boolean]>, isLocalCallback?: (res: string) => any, baseResolveCheck?: boolean, esmResolveOptions?: any, nodeResolveOptions?: any, baseEsmResolveOptions?: any, baseResolveOptions?: any): Promise<{
|
||||
localRes: any;
|
||||
res?: undefined;
|
||||
isEsm?: undefined;
|
||||
} | {
|
||||
res: string | null;
|
||||
isEsm: boolean;
|
||||
localRes?: undefined;
|
||||
}>;
|
||||
export declare function makeExternalHandler({ config, optOutBundlingPackages, optOutBundlingPackageRegex, dir, }: {
|
||||
config: NextConfigComplete;
|
||||
optOutBundlingPackages: string[];
|
||||
optOutBundlingPackageRegex: RegExp;
|
||||
dir: string;
|
||||
}): (context: string, request: string, dependencyType: string, layer: WebpackLayerName | null, getResolve: (options: any) => (resolveContext: string, resolveRequest: string) => Promise<[string | null, boolean]>) => Promise<any>;
|
||||
280
node_modules/next/dist/build/handle-externals.js
generated
vendored
Normal file
280
node_modules/next/dist/build/handle-externals.js
generated
vendored
Normal file
@ -0,0 +1,280 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
isResourceInPackages: null,
|
||||
makeExternalHandler: null,
|
||||
resolveExternal: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
isResourceInPackages: function() {
|
||||
return isResourceInPackages;
|
||||
},
|
||||
makeExternalHandler: function() {
|
||||
return makeExternalHandler;
|
||||
},
|
||||
resolveExternal: function() {
|
||||
return resolveExternal;
|
||||
}
|
||||
});
|
||||
const _requirehook = require("../server/require-hook");
|
||||
const _constants = require("../shared/lib/constants");
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("../shared/lib/isomorphic/path"));
|
||||
const _webpackconfig = require("./webpack-config");
|
||||
const _utils = require("./utils");
|
||||
const _normalizepathsep = require("../shared/lib/page-path/normalize-path-sep");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
const reactPackagesRegex = /^(react|react-dom|react-server-dom-webpack)($|\/)/;
|
||||
const pathSeparators = "[/\\\\]";
|
||||
const optionalEsmPart = `((${pathSeparators}esm)?${pathSeparators})`;
|
||||
const externalFileEnd = "(\\.external(\\.js)?)$";
|
||||
const nextDist = `next${pathSeparators}dist`;
|
||||
const externalPattern = new RegExp(`${nextDist}${optionalEsmPart}.*${externalFileEnd}`);
|
||||
const nodeModulesRegex = /node_modules[/\\].*\.[mc]?js$/;
|
||||
function isResourceInPackages(resource, packageNames, packageDirMapping) {
|
||||
if (!packageNames) return false;
|
||||
return packageNames.some((p)=>packageDirMapping && packageDirMapping.has(p) ? resource.startsWith(packageDirMapping.get(p) + _path.default.sep) : resource.includes(_path.default.sep + _path.default.join("node_modules", p.replace(/\//g, _path.default.sep)) + _path.default.sep));
|
||||
}
|
||||
async function resolveExternal(dir, esmExternalsConfig, context, request, isEsmRequested, _optOutBundlingPackages, getResolve, isLocalCallback, baseResolveCheck = true, esmResolveOptions = _webpackconfig.NODE_ESM_RESOLVE_OPTIONS, nodeResolveOptions = _webpackconfig.NODE_RESOLVE_OPTIONS, baseEsmResolveOptions = _webpackconfig.NODE_BASE_ESM_RESOLVE_OPTIONS, baseResolveOptions = _webpackconfig.NODE_BASE_RESOLVE_OPTIONS) {
|
||||
const esmExternals = !!esmExternalsConfig;
|
||||
const looseEsmExternals = esmExternalsConfig === "loose";
|
||||
let res = null;
|
||||
let isEsm = false;
|
||||
const preferEsmOptions = esmExternals && isEsmRequested ? [
|
||||
true,
|
||||
false
|
||||
] : [
|
||||
false
|
||||
];
|
||||
for (const preferEsm of preferEsmOptions){
|
||||
const resolveOptions = preferEsm ? esmResolveOptions : nodeResolveOptions;
|
||||
const resolve = getResolve(resolveOptions);
|
||||
// Resolve the import with the webpack provided context, this
|
||||
// ensures we're resolving the correct version when multiple
|
||||
// exist.
|
||||
try {
|
||||
[res, isEsm] = await resolve(context, request);
|
||||
} catch (err) {
|
||||
res = null;
|
||||
}
|
||||
if (!res) {
|
||||
continue;
|
||||
}
|
||||
// ESM externals can only be imported (and not required).
|
||||
// Make an exception in loose mode.
|
||||
if (!isEsmRequested && isEsm && !looseEsmExternals) {
|
||||
continue;
|
||||
}
|
||||
if (isLocalCallback) {
|
||||
return {
|
||||
localRes: isLocalCallback(res)
|
||||
};
|
||||
}
|
||||
// Bundled Node.js code is relocated without its node_modules tree.
|
||||
// This means we need to make sure its request resolves to the same
|
||||
// package that'll be available at runtime. If it's not identical,
|
||||
// we need to bundle the code (even if it _should_ be external).
|
||||
if (baseResolveCheck) {
|
||||
let baseRes;
|
||||
let baseIsEsm;
|
||||
try {
|
||||
const baseResolve = getResolve(isEsm ? baseEsmResolveOptions : baseResolveOptions);
|
||||
[baseRes, baseIsEsm] = await baseResolve(dir, request);
|
||||
} catch (err) {
|
||||
baseRes = null;
|
||||
baseIsEsm = false;
|
||||
}
|
||||
// Same as above: if the package, when required from the root,
|
||||
// would be different from what the real resolution would use, we
|
||||
// cannot externalize it.
|
||||
// if request is pointing to a symlink it could point to the the same file,
|
||||
// the resolver will resolve symlinks so this is handled
|
||||
if (baseRes !== res || isEsm !== baseIsEsm) {
|
||||
res = null;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return {
|
||||
res,
|
||||
isEsm
|
||||
};
|
||||
}
|
||||
function makeExternalHandler({ config, optOutBundlingPackages, optOutBundlingPackageRegex, dir }) {
|
||||
var _config_experimental;
|
||||
let resolvedExternalPackageDirs;
|
||||
const looseEsmExternals = ((_config_experimental = config.experimental) == null ? void 0 : _config_experimental.esmExternals) === "loose";
|
||||
return async function handleExternals(context, request, dependencyType, layer, getResolve) {
|
||||
// We need to externalize internal requests for files intended to
|
||||
// not be bundled.
|
||||
const isLocal = request.startsWith(".") || // Always check for unix-style path, as webpack sometimes
|
||||
// normalizes as posix.
|
||||
_path.default.posix.isAbsolute(request) || // When on Windows, we also want to check for Windows-specific
|
||||
// absolute paths.
|
||||
process.platform === "win32" && _path.default.win32.isAbsolute(request);
|
||||
// make sure import "next" shows a warning when imported
|
||||
// in pages/components
|
||||
if (request === "next") {
|
||||
return `commonjs next/dist/lib/import-next-warning`;
|
||||
}
|
||||
const isAppLayer = (0, _utils.isWebpackAppLayer)(layer);
|
||||
// Relative requires don't need custom resolution, because they
|
||||
// are relative to requests we've already resolved here.
|
||||
// Absolute requires (require('/foo')) are extremely uncommon, but
|
||||
// also have no need for customization as they're already resolved.
|
||||
if (!isLocal) {
|
||||
if (/^(?:next$)/.test(request)) {
|
||||
return `commonjs ${request}`;
|
||||
}
|
||||
if (reactPackagesRegex.test(request) && !isAppLayer) {
|
||||
return `commonjs ${request}`;
|
||||
}
|
||||
const notExternalModules = /^(?:private-next-pages\/|next\/(?:dist\/pages\/|(?:app|document|link|image|legacy\/image|constants|dynamic|script|navigation|headers|router)$)|string-hash|private-next-rsc-action-validate|private-next-rsc-action-client-wrapper|private-next-rsc-server-reference$)/;
|
||||
if (notExternalModules.test(request)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// @swc/helpers should not be external as it would
|
||||
// require hoisting the package which we can't rely on
|
||||
if (request.includes("@swc/helpers")) {
|
||||
return;
|
||||
}
|
||||
// BARREL_OPTIMIZATION_PREFIX is a special marker that tells Next.js to
|
||||
// optimize the import by removing unused exports. This has to be compiled.
|
||||
if (request.startsWith(_constants.BARREL_OPTIMIZATION_PREFIX)) {
|
||||
return;
|
||||
}
|
||||
// When in esm externals mode, and using import, we resolve with
|
||||
// ESM resolving options.
|
||||
// Also disable esm request when appDir is enabled
|
||||
const isEsmRequested = dependencyType === "esm";
|
||||
// Don't bundle @vercel/og nodejs bundle for nodejs runtime.
|
||||
// TODO-APP: bundle route.js with different layer that externals common node_module deps.
|
||||
// Make sure @vercel/og is loaded as ESM for Node.js runtime
|
||||
if ((0, _utils.isWebpackServerOnlyLayer)(layer) && request === "next/dist/compiled/@vercel/og/index.node.js") {
|
||||
return `module ${request}`;
|
||||
}
|
||||
// Specific Next.js imports that should remain external
|
||||
// TODO-APP: Investigate if we can remove this.
|
||||
if (request.startsWith("next/dist/")) {
|
||||
// Non external that needs to be transpiled
|
||||
// Image loader needs to be transpiled
|
||||
if (/^next[\\/]dist[\\/]shared[\\/]lib[\\/]image-loader/.test(request)) {
|
||||
return;
|
||||
}
|
||||
if (/^next[\\/]dist[\\/]compiled[\\/]next-server/.test(request)) {
|
||||
return `commonjs ${request}`;
|
||||
}
|
||||
if (/^next[\\/]dist[\\/]shared[\\/](?!lib[\\/]router[\\/]router)/.test(request) || /^next[\\/]dist[\\/]compiled[\\/].*\.c?js$/.test(request)) {
|
||||
return `commonjs ${request}`;
|
||||
}
|
||||
if (/^next[\\/]dist[\\/]esm[\\/]shared[\\/](?!lib[\\/]router[\\/]router)/.test(request) || /^next[\\/]dist[\\/]compiled[\\/].*\.mjs$/.test(request)) {
|
||||
return `module ${request}`;
|
||||
}
|
||||
return resolveNextExternal(request);
|
||||
}
|
||||
// TODO-APP: Let's avoid this resolve call as much as possible, and eventually get rid of it.
|
||||
const resolveResult = await resolveExternal(dir, config.experimental.esmExternals, context, request, isEsmRequested, optOutBundlingPackages, getResolve, isLocal ? resolveNextExternal : undefined);
|
||||
if ("localRes" in resolveResult) {
|
||||
return resolveResult.localRes;
|
||||
}
|
||||
// Forcedly resolve the styled-jsx installed by next.js,
|
||||
// since `resolveExternal` cannot find the styled-jsx dep with pnpm
|
||||
if (request === "styled-jsx/style") {
|
||||
resolveResult.res = _requirehook.defaultOverrides["styled-jsx/style"];
|
||||
}
|
||||
const { res, isEsm } = resolveResult;
|
||||
// If the request cannot be resolved we need to have
|
||||
// webpack "bundle" it so it surfaces the not found error.
|
||||
if (!res) {
|
||||
return;
|
||||
}
|
||||
const isOptOutBundling = optOutBundlingPackageRegex.test(res);
|
||||
// Apply bundling rules to all app layers.
|
||||
// Since handleExternals only handle the server layers, we don't need to exclude client here
|
||||
if (!isOptOutBundling && isAppLayer) {
|
||||
return;
|
||||
}
|
||||
// ESM externals can only be imported (and not required).
|
||||
// Make an exception in loose mode.
|
||||
if (!isEsmRequested && isEsm && !looseEsmExternals && !isLocal) {
|
||||
throw new Error(`ESM packages (${request}) need to be imported. Use 'import' to reference the package instead. https://nextjs.org/docs/messages/import-esm-externals`);
|
||||
}
|
||||
const externalType = isEsm ? "module" : "commonjs";
|
||||
// Default pages have to be transpiled
|
||||
if (// This is the @babel/plugin-transform-runtime "helpers: true" option
|
||||
/node_modules[/\\]@babel[/\\]runtime[/\\]/.test(res)) {
|
||||
return;
|
||||
}
|
||||
// Webpack itself has to be compiled because it doesn't always use module relative paths
|
||||
if (/node_modules[/\\]webpack/.test(res) || /node_modules[/\\]css-loader/.test(res)) {
|
||||
return;
|
||||
}
|
||||
// If a package should be transpiled by Next.js, we skip making it external.
|
||||
// It doesn't matter what the extension is, as we'll transpile it anyway.
|
||||
if (config.transpilePackages && !resolvedExternalPackageDirs) {
|
||||
resolvedExternalPackageDirs = new Map();
|
||||
// We need to resolve all the external package dirs initially.
|
||||
for (const pkg of config.transpilePackages){
|
||||
const pkgRes = await resolveExternal(dir, config.experimental.esmExternals, context, pkg + "/package.json", isEsmRequested, optOutBundlingPackages, getResolve, isLocal ? resolveNextExternal : undefined);
|
||||
if (pkgRes.res) {
|
||||
resolvedExternalPackageDirs.set(pkg, _path.default.dirname(pkgRes.res));
|
||||
}
|
||||
}
|
||||
}
|
||||
const resolvedBundlingOptOutRes = resolveBundlingOptOutPackages({
|
||||
resolvedRes: res,
|
||||
config,
|
||||
resolvedExternalPackageDirs,
|
||||
isAppLayer,
|
||||
externalType,
|
||||
isOptOutBundling,
|
||||
request
|
||||
});
|
||||
if (resolvedBundlingOptOutRes) {
|
||||
return resolvedBundlingOptOutRes;
|
||||
}
|
||||
// if here, we default to bundling the file
|
||||
return;
|
||||
};
|
||||
}
|
||||
function resolveBundlingOptOutPackages({ resolvedRes, config, resolvedExternalPackageDirs, isAppLayer, externalType, isOptOutBundling, request }) {
|
||||
if (nodeModulesRegex.test(resolvedRes)) {
|
||||
const shouldBundlePages = !isAppLayer && config.experimental.bundlePagesExternals && !isOptOutBundling;
|
||||
const shouldBeBundled = shouldBundlePages || isResourceInPackages(resolvedRes, config.transpilePackages, resolvedExternalPackageDirs);
|
||||
if (!shouldBeBundled) {
|
||||
return `${externalType} ${request}` // Externalize if not bundled or opted out
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param localRes the full path to the file
|
||||
* @returns the externalized path
|
||||
* @description returns an externalized path if the file is a Next.js file and ends with either `.shared-runtime.js` or `.external.js`
|
||||
* This is used to ensure that files used across the rendering runtime(s) and the user code are one and the same. The logic in this function
|
||||
* will rewrite the require to the correct bundle location depending on the layer at which the file is being used.
|
||||
*/ function resolveNextExternal(localRes) {
|
||||
const isExternal = externalPattern.test(localRes);
|
||||
// if the file ends with .external, we need to make it a commonjs require in all cases
|
||||
// this is used mainly to share the async local storage across the routing, rendering and user layers.
|
||||
if (isExternal) {
|
||||
// it's important we return the path that starts with `next/dist/` here instead of the absolute path
|
||||
// otherwise NFT will get tripped up
|
||||
return `commonjs ${(0, _normalizepathsep.normalizePathSep)(localRes.replace(/.*?next[/\\]dist/, "next/dist"))}`;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=handle-externals.js.map
|
||||
1
node_modules/next/dist/build/handle-externals.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/handle-externals.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
101
node_modules/next/dist/build/index.d.ts
generated
vendored
Normal file
101
node_modules/next/dist/build/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
import type { Revalidate } from '../server/lib/revalidate';
|
||||
import '../lib/setup-exception-listeners';
|
||||
import { RSC_PREFETCH_SUFFIX, RSC_SUFFIX } from '../lib/constants';
|
||||
import type { Header, Redirect, Rewrite, RouteHas } from '../lib/load-custom-routes';
|
||||
import type { __ApiPreviewProps } from '../server/api-utils';
|
||||
import { NEXT_ROUTER_PREFETCH_HEADER, RSC_HEADER, NEXT_DID_POSTPONE_HEADER } from '../client/components/app-router-headers';
|
||||
interface ExperimentalBypassForInfo {
|
||||
experimentalBypassFor?: RouteHas[];
|
||||
}
|
||||
interface ExperimentalPPRInfo {
|
||||
experimentalPPR: boolean | undefined;
|
||||
}
|
||||
interface DataRouteRouteInfo {
|
||||
dataRoute: string | null;
|
||||
prefetchDataRoute: string | null | undefined;
|
||||
}
|
||||
export interface SsgRoute extends ExperimentalBypassForInfo, DataRouteRouteInfo, ExperimentalPPRInfo {
|
||||
initialRevalidateSeconds: Revalidate;
|
||||
srcRoute: string | null;
|
||||
initialStatus?: number;
|
||||
initialHeaders?: Record<string, string>;
|
||||
}
|
||||
export interface DynamicSsgRoute extends ExperimentalBypassForInfo, DataRouteRouteInfo, ExperimentalPPRInfo {
|
||||
fallback: string | null | false;
|
||||
routeRegex: string;
|
||||
dataRouteRegex: string | null;
|
||||
prefetchDataRouteRegex: string | null | undefined;
|
||||
}
|
||||
export type PrerenderManifest = {
|
||||
version: 4;
|
||||
routes: {
|
||||
[route: string]: SsgRoute;
|
||||
};
|
||||
dynamicRoutes: {
|
||||
[route: string]: DynamicSsgRoute;
|
||||
};
|
||||
notFoundRoutes: string[];
|
||||
preview: __ApiPreviewProps;
|
||||
};
|
||||
type ManifestBuiltRoute = {
|
||||
/**
|
||||
* The route pattern used to match requests for this route.
|
||||
*/
|
||||
regex: string;
|
||||
};
|
||||
export type ManifestRewriteRoute = ManifestBuiltRoute & Rewrite;
|
||||
export type ManifestRedirectRoute = ManifestBuiltRoute & Redirect;
|
||||
export type ManifestHeaderRoute = ManifestBuiltRoute & Header;
|
||||
export type ManifestRoute = ManifestBuiltRoute & {
|
||||
page: string;
|
||||
namedRegex?: string;
|
||||
routeKeys?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
};
|
||||
export type ManifestDataRoute = {
|
||||
page: string;
|
||||
routeKeys?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
dataRouteRegex: string;
|
||||
namedDataRouteRegex?: string;
|
||||
};
|
||||
export type RoutesManifest = {
|
||||
version: number;
|
||||
pages404: boolean;
|
||||
basePath: string;
|
||||
redirects: Array<Redirect>;
|
||||
rewrites?: Array<ManifestRewriteRoute> | {
|
||||
beforeFiles: Array<ManifestRewriteRoute>;
|
||||
afterFiles: Array<ManifestRewriteRoute>;
|
||||
fallback: Array<ManifestRewriteRoute>;
|
||||
};
|
||||
headers: Array<ManifestHeaderRoute>;
|
||||
staticRoutes: Array<ManifestRoute>;
|
||||
dynamicRoutes: Array<ManifestRoute>;
|
||||
dataRoutes: Array<ManifestDataRoute>;
|
||||
i18n?: {
|
||||
domains?: Array<{
|
||||
http?: true;
|
||||
domain: string;
|
||||
locales?: string[];
|
||||
defaultLocale: string;
|
||||
}>;
|
||||
locales: string[];
|
||||
defaultLocale: string;
|
||||
localeDetection?: false;
|
||||
};
|
||||
rsc: {
|
||||
header: typeof RSC_HEADER;
|
||||
didPostponeHeader: typeof NEXT_DID_POSTPONE_HEADER;
|
||||
varyHeader: string;
|
||||
prefetchHeader: typeof NEXT_ROUTER_PREFETCH_HEADER;
|
||||
suffix: typeof RSC_SUFFIX;
|
||||
prefetchSuffix: typeof RSC_PREFETCH_SUFFIX;
|
||||
};
|
||||
skipMiddlewareUrlNormalize?: boolean;
|
||||
caseSensitive?: boolean;
|
||||
};
|
||||
export default function build(dir: string, reactProductionProfiling: boolean | undefined, debugOutput: boolean | undefined, runLint: boolean | undefined, noMangling: boolean | undefined, appDirOnly: boolean | undefined, turboNextBuild: boolean | undefined, experimentalBuildMode: 'default' | 'compile' | 'generate'): Promise<void>;
|
||||
export {};
|
||||
2161
node_modules/next/dist/build/index.js
generated
vendored
Normal file
2161
node_modules/next/dist/build/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/next/dist/build/index.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/next/dist/build/is-writeable.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/build/is-writeable.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function isWriteable(directory: string): Promise<boolean>;
|
||||
26
node_modules/next/dist/build/is-writeable.js
generated
vendored
Normal file
26
node_modules/next/dist/build/is-writeable.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "isWriteable", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return isWriteable;
|
||||
}
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
async function isWriteable(directory) {
|
||||
try {
|
||||
await _fs.default.promises.access(directory, (_fs.default.constants || _fs.default).W_OK);
|
||||
return true;
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=is-writeable.js.map
|
||||
1
node_modules/next/dist/build/is-writeable.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/is-writeable.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/build/is-writeable.ts"],"names":["isWriteable","directory","fs","promises","access","constants","W_OK","err"],"mappings":";;;;+BAEsBA;;;eAAAA;;;2DAFP;;;;;;AAER,eAAeA,YAAYC,SAAiB;IACjD,IAAI;QACF,MAAMC,WAAE,CAACC,QAAQ,CAACC,MAAM,CAACH,WAAW,AAACC,CAAAA,WAAE,CAACG,SAAS,IAAIH,WAAE,AAAD,EAAGI,IAAI;QAC7D,OAAO;IACT,EAAE,OAAOC,KAAK;QACZ,OAAO;IACT;AACF"}
|
||||
0
node_modules/next/dist/build/jest/__mocks__/empty.d.ts
generated
vendored
Normal file
0
node_modules/next/dist/build/jest/__mocks__/empty.d.ts
generated
vendored
Normal file
10
node_modules/next/dist/build/jest/__mocks__/empty.js
generated
vendored
Normal file
10
node_modules/next/dist/build/jest/__mocks__/empty.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
// this empty files is only here to mock server-only imports
|
||||
"use strict";
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=empty.js.map
|
||||
1
node_modules/next/dist/build/jest/__mocks__/empty.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/jest/__mocks__/empty.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/build/jest/__mocks__/empty.ts"],"names":[],"mappings":"AAAA,4DAA4D"}
|
||||
0
node_modules/next/dist/build/jest/__mocks__/fileMock.d.ts
generated
vendored
Normal file
0
node_modules/next/dist/build/jest/__mocks__/fileMock.d.ts
generated
vendored
Normal file
15
node_modules/next/dist/build/jest/__mocks__/fileMock.js
generated
vendored
Normal file
15
node_modules/next/dist/build/jest/__mocks__/fileMock.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
module.exports = {
|
||||
src: "/img.jpg",
|
||||
height: 40,
|
||||
width: 40,
|
||||
blurDataURL: "data:image/png;base64,imagedata"
|
||||
};
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=fileMock.js.map
|
||||
1
node_modules/next/dist/build/jest/__mocks__/fileMock.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/jest/__mocks__/fileMock.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/build/jest/__mocks__/fileMock.ts"],"names":["module","exports","src","height","width","blurDataURL"],"mappings":";AAAAA,OAAOC,OAAO,GAAG;IACfC,KAAK;IACLC,QAAQ;IACRC,OAAO;IACPC,aAAa;AACf"}
|
||||
0
node_modules/next/dist/build/jest/__mocks__/nextFontMock.d.ts
generated
vendored
Normal file
0
node_modules/next/dist/build/jest/__mocks__/nextFontMock.d.ts
generated
vendored
Normal file
20
node_modules/next/dist/build/jest/__mocks__/nextFontMock.js
generated
vendored
Normal file
20
node_modules/next/dist/build/jest/__mocks__/nextFontMock.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
module.exports = new Proxy({}, {
|
||||
get: function getter() {
|
||||
return ()=>({
|
||||
className: "className",
|
||||
variable: "variable",
|
||||
style: {
|
||||
fontFamily: "fontFamily"
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=nextFontMock.js.map
|
||||
1
node_modules/next/dist/build/jest/__mocks__/nextFontMock.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/jest/__mocks__/nextFontMock.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/build/jest/__mocks__/nextFontMock.ts"],"names":["module","exports","Proxy","get","getter","className","variable","style","fontFamily"],"mappings":";AAAAA,OAAOC,OAAO,GAAG,IAAIC,MACnB,CAAC,GACD;IACEC,KAAK,SAASC;QACZ,OAAO,IAAO,CAAA;gBACZC,WAAW;gBACXC,UAAU;gBACVC,OAAO;oBAAEC,YAAY;gBAAa;YACpC,CAAA;IACF;AACF"}
|
||||
0
node_modules/next/dist/build/jest/__mocks__/styleMock.d.ts
generated
vendored
Normal file
0
node_modules/next/dist/build/jest/__mocks__/styleMock.d.ts
generated
vendored
Normal file
10
node_modules/next/dist/build/jest/__mocks__/styleMock.js
generated
vendored
Normal file
10
node_modules/next/dist/build/jest/__mocks__/styleMock.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
module.exports = {};
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=styleMock.js.map
|
||||
1
node_modules/next/dist/build/jest/__mocks__/styleMock.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/jest/__mocks__/styleMock.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/build/jest/__mocks__/styleMock.ts"],"names":["module","exports"],"mappings":";AAAAA,OAAOC,OAAO,GAAG,CAAC"}
|
||||
24
node_modules/next/dist/build/jest/jest.d.ts
generated
vendored
Normal file
24
node_modules/next/dist/build/jest/jest.d.ts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
import type { Config } from '@jest/types';
|
||||
/**
|
||||
* @example
|
||||
* ```ts
|
||||
* // Usage in jest.config.js
|
||||
* const nextJest = require('next/jest');
|
||||
*
|
||||
* // Optionally provide path to Next.js app which will enable loading next.config.js and .env files
|
||||
* const createJestConfig = nextJest({ dir })
|
||||
*
|
||||
* // Any custom config you want to pass to Jest
|
||||
* const customJestConfig = {
|
||||
* setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
||||
* }
|
||||
*
|
||||
* // createJestConfig is exported in this way to ensure that next/jest can load the Next.js config which is async
|
||||
* module.exports = createJestConfig(customJestConfig)
|
||||
* ```
|
||||
*
|
||||
* Read more: [Next.js Docs: Setting up Jest with Next.js](https://nextjs.org/docs/app/building-your-application/testing/jest)
|
||||
*/
|
||||
export default function nextJest(options?: {
|
||||
dir?: string;
|
||||
}): (customJestConfig?: Config.InitialProjectOptions | (() => Promise<Config.InitialProjectOptions>)) => () => Promise<Config.InitialProjectOptions>;
|
||||
221
node_modules/next/dist/build/jest/jest.js
generated
vendored
Normal file
221
node_modules/next/dist/build/jest/jest.js
generated
vendored
Normal file
@ -0,0 +1,221 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, /**
|
||||
* @example
|
||||
* ```ts
|
||||
* // Usage in jest.config.js
|
||||
* const nextJest = require('next/jest');
|
||||
*
|
||||
* // Optionally provide path to Next.js app which will enable loading next.config.js and .env files
|
||||
* const createJestConfig = nextJest({ dir })
|
||||
*
|
||||
* // Any custom config you want to pass to Jest
|
||||
* const customJestConfig = {
|
||||
* setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
||||
* }
|
||||
*
|
||||
* // createJestConfig is exported in this way to ensure that next/jest can load the Next.js config which is async
|
||||
* module.exports = createJestConfig(customJestConfig)
|
||||
* ```
|
||||
*
|
||||
* Read more: [Next.js Docs: Setting up Jest with Next.js](https://nextjs.org/docs/app/building-your-application/testing/jest)
|
||||
*/ "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return nextJest;
|
||||
}
|
||||
});
|
||||
const _env = require("@next/env");
|
||||
const _path = require("path");
|
||||
const _config = /*#__PURE__*/ _interop_require_default(require("../../server/config"));
|
||||
const _constants = require("../../shared/lib/constants");
|
||||
const _loadjsconfig = /*#__PURE__*/ _interop_require_default(require("../load-jsconfig"));
|
||||
const _log = /*#__PURE__*/ _interop_require_wildcard(require("../output/log"));
|
||||
const _findpagesdir = require("../../lib/find-pages-dir");
|
||||
const _swc = require("../swc");
|
||||
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;
|
||||
}
|
||||
async function getConfig(dir) {
|
||||
const conf = await (0, _config.default)(_constants.PHASE_TEST, dir);
|
||||
return conf;
|
||||
}
|
||||
/**
|
||||
* Loads closest package.json in the directory hierarchy
|
||||
*/ function loadClosestPackageJson(dir, attempts = 1) {
|
||||
if (attempts > 5) {
|
||||
throw new Error("Can't resolve main package.json file");
|
||||
}
|
||||
var mainPath = attempts === 1 ? "./" : Array(attempts).join("../");
|
||||
try {
|
||||
return require((0, _path.join)(dir, mainPath + "package.json"));
|
||||
} catch (e) {
|
||||
return loadClosestPackageJson(dir, attempts + 1);
|
||||
}
|
||||
}
|
||||
/** Loads dotenv files and sets environment variables based on next config. */ function setUpEnv(dir) {
|
||||
const dev = false;
|
||||
(0, _env.loadEnvConfig)(dir, dev, _log);
|
||||
}
|
||||
function nextJest(options = {}) {
|
||||
// createJestConfig
|
||||
return (customJestConfig)=>{
|
||||
// Function that is provided as the module.exports of jest.config.js
|
||||
// Will be called and awaited by Jest
|
||||
return async ()=>{
|
||||
var _nextConfig_experimental, _nextConfig_experimental1;
|
||||
let nextConfig;
|
||||
let jsConfig;
|
||||
let resolvedBaseUrl;
|
||||
let isEsmProject = false;
|
||||
let pagesDir;
|
||||
let serverComponents;
|
||||
if (options.dir) {
|
||||
const resolvedDir = (0, _path.resolve)(options.dir);
|
||||
const packageConfig = loadClosestPackageJson(resolvedDir);
|
||||
isEsmProject = packageConfig.type === "module";
|
||||
nextConfig = await getConfig(resolvedDir);
|
||||
const findPagesDirResult = (0, _findpagesdir.findPagesDir)(resolvedDir);
|
||||
serverComponents = !!findPagesDirResult.appDir;
|
||||
pagesDir = findPagesDirResult.pagesDir;
|
||||
setUpEnv(resolvedDir);
|
||||
// TODO: revisit when bug in SWC is fixed that strips `.css`
|
||||
const result = await (0, _loadjsconfig.default)(resolvedDir, nextConfig);
|
||||
jsConfig = result.jsConfig;
|
||||
resolvedBaseUrl = result.resolvedBaseUrl;
|
||||
}
|
||||
// Ensure provided async config is supported
|
||||
const resolvedJestConfig = (typeof customJestConfig === "function" ? await customJestConfig() : customJestConfig) ?? {};
|
||||
// eagerly load swc bindings instead of waiting for transform calls
|
||||
await (0, _swc.loadBindings)(nextConfig == null ? void 0 : (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.useWasmBinary);
|
||||
if (_swc.lockfilePatchPromise.cur) {
|
||||
await _swc.lockfilePatchPromise.cur;
|
||||
}
|
||||
const transpiled = ((nextConfig == null ? void 0 : nextConfig.transpilePackages) ?? []).join("|");
|
||||
const jestTransformerConfig = {
|
||||
modularizeImports: nextConfig == null ? void 0 : nextConfig.modularizeImports,
|
||||
swcPlugins: nextConfig == null ? void 0 : (_nextConfig_experimental1 = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental1.swcPlugins,
|
||||
compilerOptions: nextConfig == null ? void 0 : nextConfig.compiler,
|
||||
jsConfig,
|
||||
resolvedBaseUrl,
|
||||
serverComponents,
|
||||
isEsmProject,
|
||||
pagesDir
|
||||
};
|
||||
return {
|
||||
...resolvedJestConfig,
|
||||
moduleNameMapper: {
|
||||
// Handle CSS imports (with CSS modules)
|
||||
// https://jestjs.io/docs/webpack#mocking-css-modules
|
||||
"^.+\\.module\\.(css|sass|scss)$": require.resolve("./object-proxy.js"),
|
||||
// Handle CSS imports (without CSS modules)
|
||||
"^.+\\.(css|sass|scss)$": require.resolve("./__mocks__/styleMock.js"),
|
||||
// Handle image imports
|
||||
"^.+\\.(png|jpg|jpeg|gif|webp|avif|ico|bmp)$": require.resolve(`./__mocks__/fileMock.js`),
|
||||
// Keep .svg to it's own rule to make overriding easy
|
||||
"^.+\\.(svg)$": require.resolve(`./__mocks__/fileMock.js`),
|
||||
// Handle @next/font
|
||||
"@next/font/(.*)": require.resolve("./__mocks__/nextFontMock.js"),
|
||||
// Handle next/font
|
||||
"next/font/(.*)": require.resolve("./__mocks__/nextFontMock.js"),
|
||||
// Disable server-only
|
||||
"server-only": require.resolve("./__mocks__/empty.js"),
|
||||
// custom config comes last to ensure the above rules are matched,
|
||||
// fixes the case where @pages/(.*) -> src/pages/$! doesn't break
|
||||
// CSS/image mocks
|
||||
...resolvedJestConfig.moduleNameMapper || {}
|
||||
},
|
||||
testPathIgnorePatterns: [
|
||||
// Don't look for tests in node_modules
|
||||
"/node_modules/",
|
||||
// Don't look for tests in the Next.js build output
|
||||
"/.next/",
|
||||
// Custom config can append to testPathIgnorePatterns but not modify it
|
||||
// This is to ensure `.next` and `node_modules` are always excluded
|
||||
...resolvedJestConfig.testPathIgnorePatterns || []
|
||||
],
|
||||
transform: {
|
||||
// Use SWC to compile tests
|
||||
"^.+\\.(js|jsx|ts|tsx|mjs)$": [
|
||||
require.resolve("../swc/jest-transformer"),
|
||||
jestTransformerConfig
|
||||
],
|
||||
// Allow for appending/overriding the default transforms
|
||||
...resolvedJestConfig.transform || {}
|
||||
},
|
||||
transformIgnorePatterns: [
|
||||
// To match Next.js behavior node_modules is not transformed, only `transpiledPackages`
|
||||
...transpiled ? [
|
||||
`/node_modules/(?!.pnpm)(?!(${transpiled})/)`,
|
||||
`/node_modules/.pnpm/(?!(${transpiled.replace(/\//g, "\\+")})@)`
|
||||
] : [
|
||||
"/node_modules/"
|
||||
],
|
||||
// CSS modules are mocked so they don't need to be transformed
|
||||
"^.+\\.module\\.(css|sass|scss)$",
|
||||
// Custom config can append to transformIgnorePatterns but not modify it
|
||||
// This is to ensure `node_modules` and .module.css/sass/scss are always excluded
|
||||
...resolvedJestConfig.transformIgnorePatterns || []
|
||||
],
|
||||
watchPathIgnorePatterns: [
|
||||
// Don't re-run tests when the Next.js build output changes
|
||||
"/.next/",
|
||||
...resolvedJestConfig.watchPathIgnorePatterns || []
|
||||
]
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=jest.js.map
|
||||
1
node_modules/next/dist/build/jest/jest.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/jest/jest.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/build/jest/jest.ts"],"names":["nextJest","getConfig","dir","conf","loadConfig","PHASE_TEST","loadClosestPackageJson","attempts","Error","mainPath","Array","join","require","e","setUpEnv","dev","loadEnvConfig","Log","options","customJestConfig","nextConfig","jsConfig","resolvedBaseUrl","isEsmProject","pagesDir","serverComponents","resolvedDir","resolve","packageConfig","type","findPagesDirResult","findPagesDir","appDir","result","loadJsConfig","resolvedJestConfig","loadBindings","experimental","useWasmBinary","lockfilePatchPromise","cur","transpiled","transpilePackages","jestTransformerConfig","modularizeImports","swcPlugins","compilerOptions","compiler","moduleNameMapper","testPathIgnorePatterns","transform","transformIgnorePatterns","replace","watchPathIgnorePatterns"],"mappings":"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"}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user