Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
47
node_modules/next/dist/lib/batcher.d.ts
generated
vendored
Normal file
47
node_modules/next/dist/lib/batcher.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import type { SchedulerFn } from './scheduler';
|
||||
type CacheKeyFn<K, C extends string | number | null> = (key: K) => PromiseLike<C> | C;
|
||||
type BatcherOptions<K, C extends string | number | null> = {
|
||||
cacheKeyFn?: CacheKeyFn<K, C>;
|
||||
schedulerFn?: SchedulerFn<void>;
|
||||
};
|
||||
type WorkFn<V, C> = (key: C, resolve: (value: V | PromiseLike<V>) => void) => Promise<V>;
|
||||
/**
|
||||
* A wrapper for a function that will only allow one call to the function to
|
||||
* execute at a time.
|
||||
*/
|
||||
export declare class Batcher<K, V, C extends string | number | null> {
|
||||
private readonly cacheKeyFn?;
|
||||
/**
|
||||
* A function that will be called to schedule the wrapped function to be
|
||||
* executed. This defaults to a function that will execute the function
|
||||
* immediately.
|
||||
*/
|
||||
private readonly schedulerFn;
|
||||
private readonly pending;
|
||||
protected constructor(cacheKeyFn?: CacheKeyFn<K, C> | undefined,
|
||||
/**
|
||||
* A function that will be called to schedule the wrapped function to be
|
||||
* executed. This defaults to a function that will execute the function
|
||||
* immediately.
|
||||
*/
|
||||
schedulerFn?: SchedulerFn<void>);
|
||||
/**
|
||||
* Creates a new instance of PendingWrapper. If the key extends a string or
|
||||
* number, the key will be used as the cache key. If the key is an object, a
|
||||
* cache key function must be provided.
|
||||
*/
|
||||
static create<K extends string | number | null, V>(options?: BatcherOptions<K, K>): Batcher<K, V, K>;
|
||||
static create<K, V, C extends string | number | null>(options: BatcherOptions<K, C> & Required<Pick<BatcherOptions<K, C>, 'cacheKeyFn'>>): Batcher<K, V, C>;
|
||||
/**
|
||||
* Wraps a function in a promise that will be resolved or rejected only once
|
||||
* for a given key. This will allow multiple calls to the function to be
|
||||
* made, but only one will be executed at a time. The result of the first
|
||||
* call will be returned to all callers.
|
||||
*
|
||||
* @param key the key to use for the cache
|
||||
* @param fn the function to wrap
|
||||
* @returns a promise that resolves to the result of the function
|
||||
*/
|
||||
batch(key: K, fn: WorkFn<V, C>): Promise<V>;
|
||||
}
|
||||
export {};
|
||||
59
node_modules/next/dist/lib/batcher.js
generated
vendored
Normal file
59
node_modules/next/dist/lib/batcher.js
generated
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "Batcher", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return Batcher;
|
||||
}
|
||||
});
|
||||
const _detachedpromise = require("./detached-promise");
|
||||
class Batcher {
|
||||
constructor(cacheKeyFn, /**
|
||||
* A function that will be called to schedule the wrapped function to be
|
||||
* executed. This defaults to a function that will execute the function
|
||||
* immediately.
|
||||
*/ schedulerFn = (fn)=>fn()){
|
||||
this.cacheKeyFn = cacheKeyFn;
|
||||
this.schedulerFn = schedulerFn;
|
||||
this.pending = new Map();
|
||||
}
|
||||
static create(options) {
|
||||
return new Batcher(options == null ? void 0 : options.cacheKeyFn, options == null ? void 0 : options.schedulerFn);
|
||||
}
|
||||
/**
|
||||
* Wraps a function in a promise that will be resolved or rejected only once
|
||||
* for a given key. This will allow multiple calls to the function to be
|
||||
* made, but only one will be executed at a time. The result of the first
|
||||
* call will be returned to all callers.
|
||||
*
|
||||
* @param key the key to use for the cache
|
||||
* @param fn the function to wrap
|
||||
* @returns a promise that resolves to the result of the function
|
||||
*/ async batch(key, fn) {
|
||||
const cacheKey = this.cacheKeyFn ? await this.cacheKeyFn(key) : key;
|
||||
if (cacheKey === null) {
|
||||
return fn(cacheKey, Promise.resolve);
|
||||
}
|
||||
const pending = this.pending.get(cacheKey);
|
||||
if (pending) return pending;
|
||||
const { promise, resolve, reject } = new _detachedpromise.DetachedPromise();
|
||||
this.pending.set(cacheKey, promise);
|
||||
this.schedulerFn(async ()=>{
|
||||
try {
|
||||
const result = await fn(cacheKey, resolve);
|
||||
// Resolving a promise multiple times is a no-op, so we can safely
|
||||
// resolve all pending promises with the same result.
|
||||
resolve(result);
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
} finally{
|
||||
this.pending.delete(cacheKey);
|
||||
}
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=batcher.js.map
|
||||
1
node_modules/next/dist/lib/batcher.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/batcher.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/batcher.ts"],"sourcesContent":["import type { SchedulerFn } from './scheduler'\n\nimport { DetachedPromise } from './detached-promise'\n\ntype CacheKeyFn<K, C extends string | number | null> = (\n key: K\n) => PromiseLike<C> | C\n\ntype BatcherOptions<K, C extends string | number | null> = {\n cacheKeyFn?: CacheKeyFn<K, C>\n schedulerFn?: SchedulerFn<void>\n}\n\ntype WorkFn<V, C> = (\n key: C,\n resolve: (value: V | PromiseLike<V>) => void\n) => Promise<V>\n\n/**\n * A wrapper for a function that will only allow one call to the function to\n * execute at a time.\n */\nexport class Batcher<K, V, C extends string | number | null> {\n private readonly pending = new Map<C, Promise<V>>()\n\n protected constructor(\n private readonly cacheKeyFn?: CacheKeyFn<K, C>,\n /**\n * A function that will be called to schedule the wrapped function to be\n * executed. This defaults to a function that will execute the function\n * immediately.\n */\n private readonly schedulerFn: SchedulerFn<void> = (fn) => fn()\n ) {}\n\n /**\n * Creates a new instance of PendingWrapper. If the key extends a string or\n * number, the key will be used as the cache key. If the key is an object, a\n * cache key function must be provided.\n */\n public static create<K extends string | number | null, V>(\n options?: BatcherOptions<K, K>\n ): Batcher<K, V, K>\n public static create<K, V, C extends string | number | null>(\n options: BatcherOptions<K, C> &\n Required<Pick<BatcherOptions<K, C>, 'cacheKeyFn'>>\n ): Batcher<K, V, C>\n public static create<K, V, C extends string | number | null>(\n options?: BatcherOptions<K, C>\n ): Batcher<K, V, C> {\n return new Batcher<K, V, C>(options?.cacheKeyFn, options?.schedulerFn)\n }\n\n /**\n * Wraps a function in a promise that will be resolved or rejected only once\n * for a given key. This will allow multiple calls to the function to be\n * made, but only one will be executed at a time. The result of the first\n * call will be returned to all callers.\n *\n * @param key the key to use for the cache\n * @param fn the function to wrap\n * @returns a promise that resolves to the result of the function\n */\n public async batch(key: K, fn: WorkFn<V, C>): Promise<V> {\n const cacheKey = (this.cacheKeyFn ? await this.cacheKeyFn(key) : key) as C\n if (cacheKey === null) {\n return fn(cacheKey, Promise.resolve)\n }\n\n const pending = this.pending.get(cacheKey)\n if (pending) return pending\n\n const { promise, resolve, reject } = new DetachedPromise<V>()\n this.pending.set(cacheKey, promise)\n\n this.schedulerFn(async () => {\n try {\n const result = await fn(cacheKey, resolve)\n\n // Resolving a promise multiple times is a no-op, so we can safely\n // resolve all pending promises with the same result.\n resolve(result)\n } catch (err) {\n reject(err)\n } finally {\n this.pending.delete(cacheKey)\n }\n })\n\n return promise\n }\n}\n"],"names":["Batcher","cacheKeyFn","schedulerFn","fn","pending","Map","create","options","batch","key","cacheKey","Promise","resolve","get","promise","reject","DetachedPromise","set","result","err","delete"],"mappings":";;;;+BAsBaA;;;eAAAA;;;iCApBmB;AAoBzB,MAAMA;IAGX,YACE,AAAiBC,UAA6B,EAC9C;;;;KAIC,GACD,AAAiBC,cAAiC,CAACC,KAAOA,IAAI,CAC9D;aAPiBF,aAAAA;aAMAC,cAAAA;aATFE,UAAU,IAAIC;IAU5B;IAcH,OAAcC,OACZC,OAA8B,EACZ;QAClB,OAAO,IAAIP,QAAiBO,2BAAAA,QAASN,UAAU,EAAEM,2BAAAA,QAASL,WAAW;IACvE;IAEA;;;;;;;;;GASC,GACD,MAAaM,MAAMC,GAAM,EAAEN,EAAgB,EAAc;QACvD,MAAMO,WAAY,IAAI,CAACT,UAAU,GAAG,MAAM,IAAI,CAACA,UAAU,CAACQ,OAAOA;QACjE,IAAIC,aAAa,MAAM;YACrB,OAAOP,GAAGO,UAAUC,QAAQC,OAAO;QACrC;QAEA,MAAMR,UAAU,IAAI,CAACA,OAAO,CAACS,GAAG,CAACH;QACjC,IAAIN,SAAS,OAAOA;QAEpB,MAAM,EAAEU,OAAO,EAAEF,OAAO,EAAEG,MAAM,EAAE,GAAG,IAAIC,gCAAe;QACxD,IAAI,CAACZ,OAAO,CAACa,GAAG,CAACP,UAAUI;QAE3B,IAAI,CAACZ,WAAW,CAAC;YACf,IAAI;gBACF,MAAMgB,SAAS,MAAMf,GAAGO,UAAUE;gBAElC,kEAAkE;gBAClE,qDAAqD;gBACrDA,QAAQM;YACV,EAAE,OAAOC,KAAK;gBACZJ,OAAOI;YACT,SAAU;gBACR,IAAI,CAACf,OAAO,CAACgB,MAAM,CAACV;YACtB;QACF;QAEA,OAAOI;IACT;AACF"}
|
||||
5
node_modules/next/dist/lib/build-custom-route.d.ts
generated
vendored
Normal file
5
node_modules/next/dist/lib/build-custom-route.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import type { ManifestHeaderRoute, ManifestRedirectRoute, ManifestRewriteRoute } from '../build';
|
||||
import { type Header, type Redirect, type Rewrite } from './load-custom-routes';
|
||||
export declare function buildCustomRoute(type: 'header', route: Header): ManifestHeaderRoute;
|
||||
export declare function buildCustomRoute(type: 'rewrite', route: Rewrite): ManifestRewriteRoute;
|
||||
export declare function buildCustomRoute(type: 'redirect', route: Redirect, restrictedRedirectPaths: string[]): ManifestRedirectRoute;
|
||||
39
node_modules/next/dist/lib/build-custom-route.js
generated
vendored
Normal file
39
node_modules/next/dist/lib/build-custom-route.js
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "buildCustomRoute", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return buildCustomRoute;
|
||||
}
|
||||
});
|
||||
const _pathtoregexp = require("next/dist/compiled/path-to-regexp");
|
||||
const _loadcustomroutes = require("./load-custom-routes");
|
||||
const _redirectstatus = require("./redirect-status");
|
||||
function buildCustomRoute(type, route, restrictedRedirectPaths) {
|
||||
const compiled = (0, _pathtoregexp.pathToRegexp)(route.source, [], {
|
||||
strict: true,
|
||||
sensitive: false,
|
||||
delimiter: '/'
|
||||
});
|
||||
let source = compiled.source;
|
||||
if (!route.internal) {
|
||||
source = (0, _redirectstatus.modifyRouteRegex)(source, type === 'redirect' ? restrictedRedirectPaths : undefined);
|
||||
}
|
||||
const regex = (0, _loadcustomroutes.normalizeRouteRegex)(source);
|
||||
if (type !== 'redirect') {
|
||||
return {
|
||||
...route,
|
||||
regex
|
||||
};
|
||||
}
|
||||
return {
|
||||
...route,
|
||||
statusCode: (0, _redirectstatus.getRedirectStatus)(route),
|
||||
permanent: undefined,
|
||||
regex
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=build-custom-route.js.map
|
||||
1
node_modules/next/dist/lib/build-custom-route.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/build-custom-route.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/build-custom-route.ts"],"sourcesContent":["import { pathToRegexp } from 'next/dist/compiled/path-to-regexp'\nimport type {\n ManifestHeaderRoute,\n ManifestRedirectRoute,\n ManifestRewriteRoute,\n} from '../build'\nimport {\n normalizeRouteRegex,\n type Header,\n type Redirect,\n type Rewrite,\n type RouteType,\n} from './load-custom-routes'\nimport { getRedirectStatus, modifyRouteRegex } from './redirect-status'\n\nexport function buildCustomRoute(\n type: 'header',\n route: Header\n): ManifestHeaderRoute\nexport function buildCustomRoute(\n type: 'rewrite',\n route: Rewrite\n): ManifestRewriteRoute\nexport function buildCustomRoute(\n type: 'redirect',\n route: Redirect,\n restrictedRedirectPaths: string[]\n): ManifestRedirectRoute\nexport function buildCustomRoute(\n type: RouteType,\n route: Redirect | Rewrite | Header,\n restrictedRedirectPaths?: string[]\n): ManifestHeaderRoute | ManifestRewriteRoute | ManifestRedirectRoute {\n const compiled = pathToRegexp(route.source, [], {\n strict: true,\n sensitive: false,\n delimiter: '/', // default is `/#?`, but Next does not pass query info\n })\n\n let source = compiled.source\n if (!route.internal) {\n source = modifyRouteRegex(\n source,\n type === 'redirect' ? restrictedRedirectPaths : undefined\n )\n }\n\n const regex = normalizeRouteRegex(source)\n\n if (type !== 'redirect') {\n return { ...route, regex }\n }\n\n return {\n ...route,\n statusCode: getRedirectStatus(route as Redirect),\n permanent: undefined,\n regex,\n }\n}\n"],"names":["buildCustomRoute","type","route","restrictedRedirectPaths","compiled","pathToRegexp","source","strict","sensitive","delimiter","internal","modifyRouteRegex","undefined","regex","normalizeRouteRegex","statusCode","getRedirectStatus","permanent"],"mappings":";;;;+BA4BgBA;;;eAAAA;;;8BA5Ba;kCAYtB;gCAC6C;AAe7C,SAASA,iBACdC,IAAe,EACfC,KAAkC,EAClCC,uBAAkC;IAElC,MAAMC,WAAWC,IAAAA,0BAAY,EAACH,MAAMI,MAAM,EAAE,EAAE,EAAE;QAC9CC,QAAQ;QACRC,WAAW;QACXC,WAAW;IACb;IAEA,IAAIH,SAASF,SAASE,MAAM;IAC5B,IAAI,CAACJ,MAAMQ,QAAQ,EAAE;QACnBJ,SAASK,IAAAA,gCAAgB,EACvBL,QACAL,SAAS,aAAaE,0BAA0BS;IAEpD;IAEA,MAAMC,QAAQC,IAAAA,qCAAmB,EAACR;IAElC,IAAIL,SAAS,YAAY;QACvB,OAAO;YAAE,GAAGC,KAAK;YAAEW;QAAM;IAC3B;IAEA,OAAO;QACL,GAAGX,KAAK;QACRa,YAAYC,IAAAA,iCAAiB,EAACd;QAC9Be,WAAWL;QACXC;IACF;AACF"}
|
||||
8
node_modules/next/dist/lib/client-and-server-references.d.ts
generated
vendored
Normal file
8
node_modules/next/dist/lib/client-and-server-references.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
export interface ServerReference {
|
||||
$$typeof: Symbol;
|
||||
$$id: string;
|
||||
}
|
||||
export type ServerFunction = ServerReference & ((...args: unknown[]) => Promise<unknown>);
|
||||
export declare function isServerReference<T>(value: T & Partial<ServerReference>): value is T & ServerFunction;
|
||||
export declare function isUseCacheFunction<T>(value: T & Partial<ServerReference>): value is T & ServerFunction;
|
||||
export declare function isClientReference(mod: any): boolean;
|
||||
43
node_modules/next/dist/lib/client-and-server-references.js
generated
vendored
Normal file
43
node_modules/next/dist/lib/client-and-server-references.js
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
isClientReference: null,
|
||||
isServerReference: null,
|
||||
isUseCacheFunction: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
isClientReference: function() {
|
||||
return isClientReference;
|
||||
},
|
||||
isServerReference: function() {
|
||||
return isServerReference;
|
||||
},
|
||||
isUseCacheFunction: function() {
|
||||
return isUseCacheFunction;
|
||||
}
|
||||
});
|
||||
const _serverreferenceinfo = require("../shared/lib/server-reference-info");
|
||||
function isServerReference(value) {
|
||||
return value.$$typeof === Symbol.for('react.server.reference');
|
||||
}
|
||||
function isUseCacheFunction(value) {
|
||||
if (!isServerReference(value)) {
|
||||
return false;
|
||||
}
|
||||
const { type } = (0, _serverreferenceinfo.extractInfoFromServerReferenceId)(value.$$id);
|
||||
return type === 'use-cache';
|
||||
}
|
||||
function isClientReference(mod) {
|
||||
const defaultExport = (mod == null ? void 0 : mod.default) || mod;
|
||||
return (defaultExport == null ? void 0 : defaultExport.$$typeof) === Symbol.for('react.client.reference');
|
||||
}
|
||||
|
||||
//# sourceMappingURL=client-and-server-references.js.map
|
||||
1
node_modules/next/dist/lib/client-and-server-references.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/client-and-server-references.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/client-and-server-references.ts"],"sourcesContent":["import { extractInfoFromServerReferenceId } from '../shared/lib/server-reference-info'\n\n// Only contains the properties we're interested in.\nexport interface ServerReference {\n $$typeof: Symbol\n $$id: string\n}\n\nexport type ServerFunction = ServerReference &\n ((...args: unknown[]) => Promise<unknown>)\n\nexport function isServerReference<T>(\n value: T & Partial<ServerReference>\n): value is T & ServerFunction {\n return value.$$typeof === Symbol.for('react.server.reference')\n}\n\nexport function isUseCacheFunction<T>(\n value: T & Partial<ServerReference>\n): value is T & ServerFunction {\n if (!isServerReference(value)) {\n return false\n }\n\n const { type } = extractInfoFromServerReferenceId(value.$$id)\n\n return type === 'use-cache'\n}\n\nexport function isClientReference(mod: any): boolean {\n const defaultExport = mod?.default || mod\n return defaultExport?.$$typeof === Symbol.for('react.client.reference')\n}\n"],"names":["isClientReference","isServerReference","isUseCacheFunction","value","$$typeof","Symbol","for","type","extractInfoFromServerReferenceId","$$id","mod","defaultExport","default"],"mappings":";;;;;;;;;;;;;;;;IA6BgBA,iBAAiB;eAAjBA;;IAlBAC,iBAAiB;eAAjBA;;IAMAC,kBAAkB;eAAlBA;;;qCAjBiC;AAW1C,SAASD,kBACdE,KAAmC;IAEnC,OAAOA,MAAMC,QAAQ,KAAKC,OAAOC,GAAG,CAAC;AACvC;AAEO,SAASJ,mBACdC,KAAmC;IAEnC,IAAI,CAACF,kBAAkBE,QAAQ;QAC7B,OAAO;IACT;IAEA,MAAM,EAAEI,IAAI,EAAE,GAAGC,IAAAA,qDAAgC,EAACL,MAAMM,IAAI;IAE5D,OAAOF,SAAS;AAClB;AAEO,SAASP,kBAAkBU,GAAQ;IACxC,MAAMC,gBAAgBD,CAAAA,uBAAAA,IAAKE,OAAO,KAAIF;IACtC,OAAOC,CAAAA,iCAAAA,cAAeP,QAAQ,MAAKC,OAAOC,GAAG,CAAC;AAChD"}
|
||||
7
node_modules/next/dist/lib/coalesced-function.d.ts
generated
vendored
Normal file
7
node_modules/next/dist/lib/coalesced-function.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
type CoalescedInvoke<T> = {
|
||||
isOrigin: boolean;
|
||||
value: T;
|
||||
};
|
||||
export type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
|
||||
export declare function withCoalescedInvoke<F extends (...args: any) => any>(func: F): (key: string, args: Parameters<F>) => Promise<CoalescedInvoke<UnwrapPromise<ReturnType<F>>>>;
|
||||
export {};
|
||||
39
node_modules/next/dist/lib/coalesced-function.js
generated
vendored
Normal file
39
node_modules/next/dist/lib/coalesced-function.js
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "withCoalescedInvoke", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return withCoalescedInvoke;
|
||||
}
|
||||
});
|
||||
const globalInvokeCache = new Map();
|
||||
function withCoalescedInvoke(func) {
|
||||
return async function(key, args) {
|
||||
const entry = globalInvokeCache.get(key);
|
||||
if (entry) {
|
||||
return entry.then((res)=>({
|
||||
isOrigin: false,
|
||||
value: res.value
|
||||
}));
|
||||
}
|
||||
async function __wrapper() {
|
||||
return await func.apply(undefined, args);
|
||||
}
|
||||
const future = __wrapper().then((res)=>{
|
||||
globalInvokeCache.delete(key);
|
||||
return {
|
||||
isOrigin: true,
|
||||
value: res
|
||||
};
|
||||
}).catch((err)=>{
|
||||
globalInvokeCache.delete(key);
|
||||
return Promise.reject(err);
|
||||
});
|
||||
globalInvokeCache.set(key, future);
|
||||
return future;
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=coalesced-function.js.map
|
||||
1
node_modules/next/dist/lib/coalesced-function.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/coalesced-function.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/coalesced-function.ts"],"sourcesContent":["type CoalescedInvoke<T> = {\n isOrigin: boolean\n value: T\n}\n\nexport type UnwrapPromise<T> = T extends Promise<infer U> ? U : T\n\nconst globalInvokeCache = new Map<string, Promise<CoalescedInvoke<unknown>>>()\n\nexport function withCoalescedInvoke<F extends (...args: any) => any>(\n func: F\n): (\n key: string,\n args: Parameters<F>\n) => Promise<CoalescedInvoke<UnwrapPromise<ReturnType<F>>>> {\n return async function (key: string, args: Parameters<F>) {\n const entry = globalInvokeCache.get(key)\n if (entry) {\n return entry.then((res) => ({\n isOrigin: false,\n value: res.value as UnwrapPromise<ReturnType<F>>,\n }))\n }\n\n async function __wrapper() {\n return await func.apply(undefined, args)\n }\n\n const future = __wrapper()\n .then((res) => {\n globalInvokeCache.delete(key)\n return { isOrigin: true, value: res as UnwrapPromise<ReturnType<F>> }\n })\n .catch((err) => {\n globalInvokeCache.delete(key)\n return Promise.reject(err)\n })\n globalInvokeCache.set(key, future)\n return future\n }\n}\n"],"names":["withCoalescedInvoke","globalInvokeCache","Map","func","key","args","entry","get","then","res","isOrigin","value","__wrapper","apply","undefined","future","delete","catch","err","Promise","reject","set"],"mappings":";;;;+BASgBA;;;eAAAA;;;AAFhB,MAAMC,oBAAoB,IAAIC;AAEvB,SAASF,oBACdG,IAAO;IAKP,OAAO,eAAgBC,GAAW,EAAEC,IAAmB;QACrD,MAAMC,QAAQL,kBAAkBM,GAAG,CAACH;QACpC,IAAIE,OAAO;YACT,OAAOA,MAAME,IAAI,CAAC,CAACC,MAAS,CAAA;oBAC1BC,UAAU;oBACVC,OAAOF,IAAIE,KAAK;gBAClB,CAAA;QACF;QAEA,eAAeC;YACb,OAAO,MAAMT,KAAKU,KAAK,CAACC,WAAWT;QACrC;QAEA,MAAMU,SAASH,YACZJ,IAAI,CAAC,CAACC;YACLR,kBAAkBe,MAAM,CAACZ;YACzB,OAAO;gBAAEM,UAAU;gBAAMC,OAAOF;YAAoC;QACtE,GACCQ,KAAK,CAAC,CAACC;YACNjB,kBAAkBe,MAAM,CAACZ;YACzB,OAAOe,QAAQC,MAAM,CAACF;QACxB;QACFjB,kBAAkBoB,GAAG,CAACjB,KAAKW;QAC3B,OAAOA;IACT;AACF"}
|
||||
2
node_modules/next/dist/lib/compile-error.d.ts
generated
vendored
Normal file
2
node_modules/next/dist/lib/compile-error.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
export declare class CompileError extends Error {
|
||||
}
|
||||
14
node_modules/next/dist/lib/compile-error.js
generated
vendored
Normal file
14
node_modules/next/dist/lib/compile-error.js
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "CompileError", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return CompileError;
|
||||
}
|
||||
});
|
||||
class CompileError extends Error {
|
||||
}
|
||||
|
||||
//# sourceMappingURL=compile-error.js.map
|
||||
1
node_modules/next/dist/lib/compile-error.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/compile-error.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/compile-error.ts"],"sourcesContent":["export class CompileError extends Error {}\n"],"names":["CompileError","Error"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,qBAAqBC;AAAO"}
|
||||
141
node_modules/next/dist/lib/constants.d.ts
generated
vendored
Normal file
141
node_modules/next/dist/lib/constants.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
import type { ServerRuntime } from '../types';
|
||||
export declare const NEXT_QUERY_PARAM_PREFIX = "nxtP";
|
||||
export declare const NEXT_INTERCEPTION_MARKER_PREFIX = "nxtI";
|
||||
export declare const MATCHED_PATH_HEADER = "x-matched-path";
|
||||
export declare const PRERENDER_REVALIDATE_HEADER = "x-prerender-revalidate";
|
||||
export declare const PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER = "x-prerender-revalidate-if-generated";
|
||||
export declare const RSC_PREFETCH_SUFFIX = ".prefetch.rsc";
|
||||
export declare const RSC_SEGMENTS_DIR_SUFFIX = ".segments";
|
||||
export declare const RSC_SEGMENT_SUFFIX = ".segment.rsc";
|
||||
export declare const RSC_SUFFIX = ".rsc";
|
||||
export declare const ACTION_SUFFIX = ".action";
|
||||
export declare const NEXT_DATA_SUFFIX = ".json";
|
||||
export declare const NEXT_META_SUFFIX = ".meta";
|
||||
export declare const NEXT_BODY_SUFFIX = ".body";
|
||||
export declare const NEXT_CACHE_TAGS_HEADER = "x-next-cache-tags";
|
||||
export declare const NEXT_CACHE_REVALIDATED_TAGS_HEADER = "x-next-revalidated-tags";
|
||||
export declare const NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER = "x-next-revalidate-tag-token";
|
||||
export declare const NEXT_RESUME_HEADER = "next-resume";
|
||||
export declare const NEXT_CACHE_TAG_MAX_ITEMS = 128;
|
||||
export declare const NEXT_CACHE_TAG_MAX_LENGTH = 256;
|
||||
export declare const NEXT_CACHE_SOFT_TAG_MAX_LENGTH = 1024;
|
||||
export declare const NEXT_CACHE_IMPLICIT_TAG_ID = "_N_T_";
|
||||
export declare const CACHE_ONE_YEAR = 31536000;
|
||||
export declare const INFINITE_CACHE = 4294967294;
|
||||
export declare const MIDDLEWARE_FILENAME = "middleware";
|
||||
export declare const MIDDLEWARE_LOCATION_REGEXP = "(?:src/)?middleware";
|
||||
export declare const INSTRUMENTATION_HOOK_FILENAME = "instrumentation";
|
||||
export declare const PAGES_DIR_ALIAS = "private-next-pages";
|
||||
export declare const DOT_NEXT_ALIAS = "private-dot-next";
|
||||
export declare const ROOT_DIR_ALIAS = "private-next-root-dir";
|
||||
export declare const APP_DIR_ALIAS = "private-next-app-dir";
|
||||
export declare const RSC_MOD_REF_PROXY_ALIAS = "private-next-rsc-mod-ref-proxy";
|
||||
export declare const RSC_ACTION_VALIDATE_ALIAS = "private-next-rsc-action-validate";
|
||||
export declare const RSC_ACTION_PROXY_ALIAS = "private-next-rsc-server-reference";
|
||||
export declare const RSC_CACHE_WRAPPER_ALIAS = "private-next-rsc-cache-wrapper";
|
||||
export declare const RSC_ACTION_ENCRYPTION_ALIAS = "private-next-rsc-action-encryption";
|
||||
export declare const RSC_ACTION_CLIENT_WRAPPER_ALIAS = "private-next-rsc-action-client-wrapper";
|
||||
export declare const PUBLIC_DIR_MIDDLEWARE_CONFLICT = "You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict";
|
||||
export declare const SSG_GET_INITIAL_PROPS_CONFLICT = "You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps";
|
||||
export declare const SERVER_PROPS_GET_INIT_PROPS_CONFLICT = "You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.";
|
||||
export declare const SERVER_PROPS_SSG_CONFLICT = "You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps";
|
||||
export declare const STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = "can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props";
|
||||
export declare const SERVER_PROPS_EXPORT_ERROR = "pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export";
|
||||
export declare const GSP_NO_RETURNED_VALUE = "Your `getStaticProps` function did not return an object. Did you forget to add a `return`?";
|
||||
export declare const GSSP_NO_RETURNED_VALUE = "Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?";
|
||||
export declare const UNSTABLE_REVALIDATE_RENAME_ERROR: string;
|
||||
export declare const GSSP_COMPONENT_MEMBER_ERROR = "can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member";
|
||||
export declare const NON_STANDARD_NODE_ENV = "You are using a non-standard \"NODE_ENV\" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env";
|
||||
export declare const SSG_FALLBACK_EXPORT_ERROR = "Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export";
|
||||
export declare const ESLINT_DEFAULT_DIRS: string[];
|
||||
export declare const SERVER_RUNTIME: Record<string, ServerRuntime>;
|
||||
/**
|
||||
* The names of the webpack layers. These layers are the primitives for the
|
||||
* webpack chunks.
|
||||
*/
|
||||
declare const WEBPACK_LAYERS_NAMES: {
|
||||
/**
|
||||
* The layer for the shared code between the client and server bundles.
|
||||
*/
|
||||
readonly shared: "shared";
|
||||
/**
|
||||
* The layer for server-only runtime and picking up `react-server` export conditions.
|
||||
* Including app router RSC pages and app router custom routes and metadata routes.
|
||||
*/
|
||||
readonly reactServerComponents: "rsc";
|
||||
/**
|
||||
* Server Side Rendering layer for app (ssr).
|
||||
*/
|
||||
readonly serverSideRendering: "ssr";
|
||||
/**
|
||||
* The browser client bundle layer for actions.
|
||||
*/
|
||||
readonly actionBrowser: "action-browser";
|
||||
/**
|
||||
* The Node.js bundle layer for the API routes.
|
||||
*/
|
||||
readonly apiNode: "api-node";
|
||||
/**
|
||||
* The Edge Lite bundle layer for the API routes.
|
||||
*/
|
||||
readonly apiEdge: "api-edge";
|
||||
/**
|
||||
* The layer for the middleware code.
|
||||
*/
|
||||
readonly middleware: "middleware";
|
||||
/**
|
||||
* The layer for the instrumentation hooks.
|
||||
*/
|
||||
readonly instrument: "instrument";
|
||||
/**
|
||||
* The layer for assets on the edge.
|
||||
*/
|
||||
readonly edgeAsset: "edge-asset";
|
||||
/**
|
||||
* The browser client bundle layer for App directory.
|
||||
*/
|
||||
readonly appPagesBrowser: "app-pages-browser";
|
||||
/**
|
||||
* The browser client bundle layer for Pages directory.
|
||||
*/
|
||||
readonly pagesDirBrowser: "pages-dir-browser";
|
||||
/**
|
||||
* The Edge Lite bundle layer for Pages directory.
|
||||
*/
|
||||
readonly pagesDirEdge: "pages-dir-edge";
|
||||
/**
|
||||
* The Node.js bundle layer for Pages directory.
|
||||
*/
|
||||
readonly pagesDirNode: "pages-dir-node";
|
||||
};
|
||||
export type WebpackLayerName = (typeof WEBPACK_LAYERS_NAMES)[keyof typeof WEBPACK_LAYERS_NAMES];
|
||||
declare const WEBPACK_LAYERS: {
|
||||
GROUP: {
|
||||
builtinReact: ("rsc" | "action-browser")[];
|
||||
serverOnly: ("middleware" | "rsc" | "action-browser" | "instrument")[];
|
||||
neutralTarget: ("api-node" | "api-edge")[];
|
||||
clientOnly: ("ssr" | "app-pages-browser")[];
|
||||
bundled: ("shared" | "middleware" | "rsc" | "ssr" | "action-browser" | "instrument" | "app-pages-browser")[];
|
||||
appPages: ("rsc" | "ssr" | "action-browser" | "app-pages-browser")[];
|
||||
};
|
||||
shared: "shared";
|
||||
reactServerComponents: "rsc";
|
||||
serverSideRendering: "ssr";
|
||||
actionBrowser: "action-browser";
|
||||
apiNode: "api-node";
|
||||
apiEdge: "api-edge";
|
||||
middleware: "middleware";
|
||||
instrument: "instrument";
|
||||
edgeAsset: "edge-asset";
|
||||
appPagesBrowser: "app-pages-browser";
|
||||
pagesDirBrowser: "pages-dir-browser";
|
||||
pagesDirEdge: "pages-dir-edge";
|
||||
pagesDirNode: "pages-dir-node";
|
||||
};
|
||||
declare const WEBPACK_RESOURCE_QUERIES: {
|
||||
edgeSSREntry: string;
|
||||
metadata: string;
|
||||
metadataRoute: string;
|
||||
metadataImageMeta: string;
|
||||
};
|
||||
export { WEBPACK_LAYERS, WEBPACK_RESOURCE_QUERIES };
|
||||
375
node_modules/next/dist/lib/constants.js
generated
vendored
Normal file
375
node_modules/next/dist/lib/constants.js
generated
vendored
Normal file
|
|
@ -0,0 +1,375 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
ACTION_SUFFIX: null,
|
||||
APP_DIR_ALIAS: null,
|
||||
CACHE_ONE_YEAR: null,
|
||||
DOT_NEXT_ALIAS: null,
|
||||
ESLINT_DEFAULT_DIRS: null,
|
||||
GSP_NO_RETURNED_VALUE: null,
|
||||
GSSP_COMPONENT_MEMBER_ERROR: null,
|
||||
GSSP_NO_RETURNED_VALUE: null,
|
||||
INFINITE_CACHE: null,
|
||||
INSTRUMENTATION_HOOK_FILENAME: null,
|
||||
MATCHED_PATH_HEADER: null,
|
||||
MIDDLEWARE_FILENAME: null,
|
||||
MIDDLEWARE_LOCATION_REGEXP: null,
|
||||
NEXT_BODY_SUFFIX: null,
|
||||
NEXT_CACHE_IMPLICIT_TAG_ID: null,
|
||||
NEXT_CACHE_REVALIDATED_TAGS_HEADER: null,
|
||||
NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER: null,
|
||||
NEXT_CACHE_SOFT_TAG_MAX_LENGTH: null,
|
||||
NEXT_CACHE_TAGS_HEADER: null,
|
||||
NEXT_CACHE_TAG_MAX_ITEMS: null,
|
||||
NEXT_CACHE_TAG_MAX_LENGTH: null,
|
||||
NEXT_DATA_SUFFIX: null,
|
||||
NEXT_INTERCEPTION_MARKER_PREFIX: null,
|
||||
NEXT_META_SUFFIX: null,
|
||||
NEXT_QUERY_PARAM_PREFIX: null,
|
||||
NEXT_RESUME_HEADER: null,
|
||||
NON_STANDARD_NODE_ENV: null,
|
||||
PAGES_DIR_ALIAS: null,
|
||||
PRERENDER_REVALIDATE_HEADER: null,
|
||||
PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER: null,
|
||||
PUBLIC_DIR_MIDDLEWARE_CONFLICT: null,
|
||||
ROOT_DIR_ALIAS: null,
|
||||
RSC_ACTION_CLIENT_WRAPPER_ALIAS: null,
|
||||
RSC_ACTION_ENCRYPTION_ALIAS: null,
|
||||
RSC_ACTION_PROXY_ALIAS: null,
|
||||
RSC_ACTION_VALIDATE_ALIAS: null,
|
||||
RSC_CACHE_WRAPPER_ALIAS: null,
|
||||
RSC_MOD_REF_PROXY_ALIAS: null,
|
||||
RSC_PREFETCH_SUFFIX: null,
|
||||
RSC_SEGMENTS_DIR_SUFFIX: null,
|
||||
RSC_SEGMENT_SUFFIX: null,
|
||||
RSC_SUFFIX: null,
|
||||
SERVER_PROPS_EXPORT_ERROR: null,
|
||||
SERVER_PROPS_GET_INIT_PROPS_CONFLICT: null,
|
||||
SERVER_PROPS_SSG_CONFLICT: null,
|
||||
SERVER_RUNTIME: null,
|
||||
SSG_FALLBACK_EXPORT_ERROR: null,
|
||||
SSG_GET_INITIAL_PROPS_CONFLICT: null,
|
||||
STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR: null,
|
||||
UNSTABLE_REVALIDATE_RENAME_ERROR: null,
|
||||
WEBPACK_LAYERS: null,
|
||||
WEBPACK_RESOURCE_QUERIES: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
ACTION_SUFFIX: function() {
|
||||
return ACTION_SUFFIX;
|
||||
},
|
||||
APP_DIR_ALIAS: function() {
|
||||
return APP_DIR_ALIAS;
|
||||
},
|
||||
CACHE_ONE_YEAR: function() {
|
||||
return CACHE_ONE_YEAR;
|
||||
},
|
||||
DOT_NEXT_ALIAS: function() {
|
||||
return DOT_NEXT_ALIAS;
|
||||
},
|
||||
ESLINT_DEFAULT_DIRS: function() {
|
||||
return ESLINT_DEFAULT_DIRS;
|
||||
},
|
||||
GSP_NO_RETURNED_VALUE: function() {
|
||||
return GSP_NO_RETURNED_VALUE;
|
||||
},
|
||||
GSSP_COMPONENT_MEMBER_ERROR: function() {
|
||||
return GSSP_COMPONENT_MEMBER_ERROR;
|
||||
},
|
||||
GSSP_NO_RETURNED_VALUE: function() {
|
||||
return GSSP_NO_RETURNED_VALUE;
|
||||
},
|
||||
INFINITE_CACHE: function() {
|
||||
return INFINITE_CACHE;
|
||||
},
|
||||
INSTRUMENTATION_HOOK_FILENAME: function() {
|
||||
return INSTRUMENTATION_HOOK_FILENAME;
|
||||
},
|
||||
MATCHED_PATH_HEADER: function() {
|
||||
return MATCHED_PATH_HEADER;
|
||||
},
|
||||
MIDDLEWARE_FILENAME: function() {
|
||||
return MIDDLEWARE_FILENAME;
|
||||
},
|
||||
MIDDLEWARE_LOCATION_REGEXP: function() {
|
||||
return MIDDLEWARE_LOCATION_REGEXP;
|
||||
},
|
||||
NEXT_BODY_SUFFIX: function() {
|
||||
return NEXT_BODY_SUFFIX;
|
||||
},
|
||||
NEXT_CACHE_IMPLICIT_TAG_ID: function() {
|
||||
return NEXT_CACHE_IMPLICIT_TAG_ID;
|
||||
},
|
||||
NEXT_CACHE_REVALIDATED_TAGS_HEADER: function() {
|
||||
return NEXT_CACHE_REVALIDATED_TAGS_HEADER;
|
||||
},
|
||||
NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER: function() {
|
||||
return NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER;
|
||||
},
|
||||
NEXT_CACHE_SOFT_TAG_MAX_LENGTH: function() {
|
||||
return NEXT_CACHE_SOFT_TAG_MAX_LENGTH;
|
||||
},
|
||||
NEXT_CACHE_TAGS_HEADER: function() {
|
||||
return NEXT_CACHE_TAGS_HEADER;
|
||||
},
|
||||
NEXT_CACHE_TAG_MAX_ITEMS: function() {
|
||||
return NEXT_CACHE_TAG_MAX_ITEMS;
|
||||
},
|
||||
NEXT_CACHE_TAG_MAX_LENGTH: function() {
|
||||
return NEXT_CACHE_TAG_MAX_LENGTH;
|
||||
},
|
||||
NEXT_DATA_SUFFIX: function() {
|
||||
return NEXT_DATA_SUFFIX;
|
||||
},
|
||||
NEXT_INTERCEPTION_MARKER_PREFIX: function() {
|
||||
return NEXT_INTERCEPTION_MARKER_PREFIX;
|
||||
},
|
||||
NEXT_META_SUFFIX: function() {
|
||||
return NEXT_META_SUFFIX;
|
||||
},
|
||||
NEXT_QUERY_PARAM_PREFIX: function() {
|
||||
return NEXT_QUERY_PARAM_PREFIX;
|
||||
},
|
||||
NEXT_RESUME_HEADER: function() {
|
||||
return NEXT_RESUME_HEADER;
|
||||
},
|
||||
NON_STANDARD_NODE_ENV: function() {
|
||||
return NON_STANDARD_NODE_ENV;
|
||||
},
|
||||
PAGES_DIR_ALIAS: function() {
|
||||
return PAGES_DIR_ALIAS;
|
||||
},
|
||||
PRERENDER_REVALIDATE_HEADER: function() {
|
||||
return PRERENDER_REVALIDATE_HEADER;
|
||||
},
|
||||
PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER: function() {
|
||||
return PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER;
|
||||
},
|
||||
PUBLIC_DIR_MIDDLEWARE_CONFLICT: function() {
|
||||
return PUBLIC_DIR_MIDDLEWARE_CONFLICT;
|
||||
},
|
||||
ROOT_DIR_ALIAS: function() {
|
||||
return ROOT_DIR_ALIAS;
|
||||
},
|
||||
RSC_ACTION_CLIENT_WRAPPER_ALIAS: function() {
|
||||
return RSC_ACTION_CLIENT_WRAPPER_ALIAS;
|
||||
},
|
||||
RSC_ACTION_ENCRYPTION_ALIAS: function() {
|
||||
return RSC_ACTION_ENCRYPTION_ALIAS;
|
||||
},
|
||||
RSC_ACTION_PROXY_ALIAS: function() {
|
||||
return RSC_ACTION_PROXY_ALIAS;
|
||||
},
|
||||
RSC_ACTION_VALIDATE_ALIAS: function() {
|
||||
return RSC_ACTION_VALIDATE_ALIAS;
|
||||
},
|
||||
RSC_CACHE_WRAPPER_ALIAS: function() {
|
||||
return RSC_CACHE_WRAPPER_ALIAS;
|
||||
},
|
||||
RSC_MOD_REF_PROXY_ALIAS: function() {
|
||||
return RSC_MOD_REF_PROXY_ALIAS;
|
||||
},
|
||||
RSC_PREFETCH_SUFFIX: function() {
|
||||
return RSC_PREFETCH_SUFFIX;
|
||||
},
|
||||
RSC_SEGMENTS_DIR_SUFFIX: function() {
|
||||
return RSC_SEGMENTS_DIR_SUFFIX;
|
||||
},
|
||||
RSC_SEGMENT_SUFFIX: function() {
|
||||
return RSC_SEGMENT_SUFFIX;
|
||||
},
|
||||
RSC_SUFFIX: function() {
|
||||
return RSC_SUFFIX;
|
||||
},
|
||||
SERVER_PROPS_EXPORT_ERROR: function() {
|
||||
return SERVER_PROPS_EXPORT_ERROR;
|
||||
},
|
||||
SERVER_PROPS_GET_INIT_PROPS_CONFLICT: function() {
|
||||
return SERVER_PROPS_GET_INIT_PROPS_CONFLICT;
|
||||
},
|
||||
SERVER_PROPS_SSG_CONFLICT: function() {
|
||||
return SERVER_PROPS_SSG_CONFLICT;
|
||||
},
|
||||
SERVER_RUNTIME: function() {
|
||||
return SERVER_RUNTIME;
|
||||
},
|
||||
SSG_FALLBACK_EXPORT_ERROR: function() {
|
||||
return SSG_FALLBACK_EXPORT_ERROR;
|
||||
},
|
||||
SSG_GET_INITIAL_PROPS_CONFLICT: function() {
|
||||
return SSG_GET_INITIAL_PROPS_CONFLICT;
|
||||
},
|
||||
STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR: function() {
|
||||
return STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR;
|
||||
},
|
||||
UNSTABLE_REVALIDATE_RENAME_ERROR: function() {
|
||||
return UNSTABLE_REVALIDATE_RENAME_ERROR;
|
||||
},
|
||||
WEBPACK_LAYERS: function() {
|
||||
return WEBPACK_LAYERS;
|
||||
},
|
||||
WEBPACK_RESOURCE_QUERIES: function() {
|
||||
return WEBPACK_RESOURCE_QUERIES;
|
||||
}
|
||||
});
|
||||
const NEXT_QUERY_PARAM_PREFIX = 'nxtP';
|
||||
const NEXT_INTERCEPTION_MARKER_PREFIX = 'nxtI';
|
||||
const MATCHED_PATH_HEADER = 'x-matched-path';
|
||||
const PRERENDER_REVALIDATE_HEADER = 'x-prerender-revalidate';
|
||||
const PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER = 'x-prerender-revalidate-if-generated';
|
||||
const RSC_PREFETCH_SUFFIX = '.prefetch.rsc';
|
||||
const RSC_SEGMENTS_DIR_SUFFIX = '.segments';
|
||||
const RSC_SEGMENT_SUFFIX = '.segment.rsc';
|
||||
const RSC_SUFFIX = '.rsc';
|
||||
const ACTION_SUFFIX = '.action';
|
||||
const NEXT_DATA_SUFFIX = '.json';
|
||||
const NEXT_META_SUFFIX = '.meta';
|
||||
const NEXT_BODY_SUFFIX = '.body';
|
||||
const NEXT_CACHE_TAGS_HEADER = 'x-next-cache-tags';
|
||||
const NEXT_CACHE_REVALIDATED_TAGS_HEADER = 'x-next-revalidated-tags';
|
||||
const NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER = 'x-next-revalidate-tag-token';
|
||||
const NEXT_RESUME_HEADER = 'next-resume';
|
||||
const NEXT_CACHE_TAG_MAX_ITEMS = 128;
|
||||
const NEXT_CACHE_TAG_MAX_LENGTH = 256;
|
||||
const NEXT_CACHE_SOFT_TAG_MAX_LENGTH = 1024;
|
||||
const NEXT_CACHE_IMPLICIT_TAG_ID = '_N_T_';
|
||||
const CACHE_ONE_YEAR = 31536000;
|
||||
const INFINITE_CACHE = 0xfffffffe;
|
||||
const MIDDLEWARE_FILENAME = 'middleware';
|
||||
const MIDDLEWARE_LOCATION_REGEXP = `(?:src/)?${MIDDLEWARE_FILENAME}`;
|
||||
const INSTRUMENTATION_HOOK_FILENAME = 'instrumentation';
|
||||
const PAGES_DIR_ALIAS = 'private-next-pages';
|
||||
const DOT_NEXT_ALIAS = 'private-dot-next';
|
||||
const ROOT_DIR_ALIAS = 'private-next-root-dir';
|
||||
const APP_DIR_ALIAS = 'private-next-app-dir';
|
||||
const RSC_MOD_REF_PROXY_ALIAS = 'private-next-rsc-mod-ref-proxy';
|
||||
const RSC_ACTION_VALIDATE_ALIAS = 'private-next-rsc-action-validate';
|
||||
const RSC_ACTION_PROXY_ALIAS = 'private-next-rsc-server-reference';
|
||||
const RSC_CACHE_WRAPPER_ALIAS = 'private-next-rsc-cache-wrapper';
|
||||
const RSC_ACTION_ENCRYPTION_ALIAS = 'private-next-rsc-action-encryption';
|
||||
const RSC_ACTION_CLIENT_WRAPPER_ALIAS = 'private-next-rsc-action-client-wrapper';
|
||||
const PUBLIC_DIR_MIDDLEWARE_CONFLICT = `You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict`;
|
||||
const SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`;
|
||||
const SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`;
|
||||
const SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`;
|
||||
const STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`;
|
||||
const SERVER_PROPS_EXPORT_ERROR = `pages with \`getServerSideProps\` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export`;
|
||||
const GSP_NO_RETURNED_VALUE = 'Your `getStaticProps` function did not return an object. Did you forget to add a `return`?';
|
||||
const GSSP_NO_RETURNED_VALUE = 'Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?';
|
||||
const UNSTABLE_REVALIDATE_RENAME_ERROR = 'The `unstable_revalidate` property is available for general use.\n' + 'Please use `revalidate` instead.';
|
||||
const GSSP_COMPONENT_MEMBER_ERROR = `can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member`;
|
||||
const NON_STANDARD_NODE_ENV = `You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env`;
|
||||
const SSG_FALLBACK_EXPORT_ERROR = `Pages with \`fallback\` enabled in \`getStaticPaths\` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export`;
|
||||
const ESLINT_DEFAULT_DIRS = [
|
||||
'app',
|
||||
'pages',
|
||||
'components',
|
||||
'lib',
|
||||
'src'
|
||||
];
|
||||
const SERVER_RUNTIME = {
|
||||
edge: 'edge',
|
||||
experimentalEdge: 'experimental-edge',
|
||||
nodejs: 'nodejs'
|
||||
};
|
||||
/**
|
||||
* The names of the webpack layers. These layers are the primitives for the
|
||||
* webpack chunks.
|
||||
*/ const WEBPACK_LAYERS_NAMES = {
|
||||
/**
|
||||
* The layer for the shared code between the client and server bundles.
|
||||
*/ shared: 'shared',
|
||||
/**
|
||||
* The layer for server-only runtime and picking up `react-server` export conditions.
|
||||
* Including app router RSC pages and app router custom routes and metadata routes.
|
||||
*/ reactServerComponents: 'rsc',
|
||||
/**
|
||||
* Server Side Rendering layer for app (ssr).
|
||||
*/ serverSideRendering: 'ssr',
|
||||
/**
|
||||
* The browser client bundle layer for actions.
|
||||
*/ actionBrowser: 'action-browser',
|
||||
/**
|
||||
* The Node.js bundle layer for the API routes.
|
||||
*/ apiNode: 'api-node',
|
||||
/**
|
||||
* The Edge Lite bundle layer for the API routes.
|
||||
*/ apiEdge: 'api-edge',
|
||||
/**
|
||||
* The layer for the middleware code.
|
||||
*/ middleware: 'middleware',
|
||||
/**
|
||||
* The layer for the instrumentation hooks.
|
||||
*/ instrument: 'instrument',
|
||||
/**
|
||||
* The layer for assets on the edge.
|
||||
*/ edgeAsset: 'edge-asset',
|
||||
/**
|
||||
* The browser client bundle layer for App directory.
|
||||
*/ appPagesBrowser: 'app-pages-browser',
|
||||
/**
|
||||
* The browser client bundle layer for Pages directory.
|
||||
*/ pagesDirBrowser: 'pages-dir-browser',
|
||||
/**
|
||||
* The Edge Lite bundle layer for Pages directory.
|
||||
*/ pagesDirEdge: 'pages-dir-edge',
|
||||
/**
|
||||
* The Node.js bundle layer for Pages directory.
|
||||
*/ pagesDirNode: 'pages-dir-node'
|
||||
};
|
||||
const WEBPACK_LAYERS = {
|
||||
...WEBPACK_LAYERS_NAMES,
|
||||
GROUP: {
|
||||
builtinReact: [
|
||||
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
||||
WEBPACK_LAYERS_NAMES.actionBrowser
|
||||
],
|
||||
serverOnly: [
|
||||
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
||||
WEBPACK_LAYERS_NAMES.actionBrowser,
|
||||
WEBPACK_LAYERS_NAMES.instrument,
|
||||
WEBPACK_LAYERS_NAMES.middleware
|
||||
],
|
||||
neutralTarget: [
|
||||
// pages api
|
||||
WEBPACK_LAYERS_NAMES.apiNode,
|
||||
WEBPACK_LAYERS_NAMES.apiEdge
|
||||
],
|
||||
clientOnly: [
|
||||
WEBPACK_LAYERS_NAMES.serverSideRendering,
|
||||
WEBPACK_LAYERS_NAMES.appPagesBrowser
|
||||
],
|
||||
bundled: [
|
||||
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
||||
WEBPACK_LAYERS_NAMES.actionBrowser,
|
||||
WEBPACK_LAYERS_NAMES.serverSideRendering,
|
||||
WEBPACK_LAYERS_NAMES.appPagesBrowser,
|
||||
WEBPACK_LAYERS_NAMES.shared,
|
||||
WEBPACK_LAYERS_NAMES.instrument,
|
||||
WEBPACK_LAYERS_NAMES.middleware
|
||||
],
|
||||
appPages: [
|
||||
// app router pages and layouts
|
||||
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
||||
WEBPACK_LAYERS_NAMES.serverSideRendering,
|
||||
WEBPACK_LAYERS_NAMES.appPagesBrowser,
|
||||
WEBPACK_LAYERS_NAMES.actionBrowser
|
||||
]
|
||||
}
|
||||
};
|
||||
const WEBPACK_RESOURCE_QUERIES = {
|
||||
edgeSSREntry: '__next_edge_ssr_entry__',
|
||||
metadata: '__next_metadata__',
|
||||
metadataRoute: '__next_metadata_route__',
|
||||
metadataImageMeta: '__next_metadata_image_meta__'
|
||||
};
|
||||
|
||||
//# sourceMappingURL=constants.js.map
|
||||
1
node_modules/next/dist/lib/constants.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/constants.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
6
node_modules/next/dist/lib/create-client-router-filter.d.ts
generated
vendored
Normal file
6
node_modules/next/dist/lib/create-client-router-filter.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { BloomFilter } from '../shared/lib/bloom-filter';
|
||||
import type { Redirect } from './load-custom-routes';
|
||||
export declare function createClientRouterFilter(paths: string[], redirects: Redirect[], allowedErrorRate?: number): {
|
||||
staticFilter: ReturnType<BloomFilter['export']>;
|
||||
dynamicFilter: ReturnType<BloomFilter['export']>;
|
||||
};
|
||||
67
node_modules/next/dist/lib/create-client-router-filter.js
generated
vendored
Normal file
67
node_modules/next/dist/lib/create-client-router-filter.js
generated
vendored
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "createClientRouterFilter", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return createClientRouterFilter;
|
||||
}
|
||||
});
|
||||
const _bloomfilter = require("../shared/lib/bloom-filter");
|
||||
const _utils = require("../shared/lib/router/utils");
|
||||
const _removetrailingslash = require("../shared/lib/router/utils/remove-trailing-slash");
|
||||
const _trytoparsepath = require("./try-to-parse-path");
|
||||
const _interceptionroutes = require("../shared/lib/router/utils/interception-routes");
|
||||
function createClientRouterFilter(paths, redirects, allowedErrorRate) {
|
||||
const staticPaths = new Set();
|
||||
const dynamicPaths = new Set();
|
||||
for (let path of paths){
|
||||
if ((0, _utils.isDynamicRoute)(path)) {
|
||||
if ((0, _interceptionroutes.isInterceptionRouteAppPath)(path)) {
|
||||
path = (0, _interceptionroutes.extractInterceptionRouteInformation)(path).interceptedRoute;
|
||||
}
|
||||
let subPath = '';
|
||||
const pathParts = path.split('/');
|
||||
// start at 1 since we split on '/' and the path starts
|
||||
// with this so the first entry is an empty string
|
||||
for(let i = 1; i < pathParts.length; i++){
|
||||
const curPart = pathParts[i];
|
||||
if (curPart.startsWith('[')) {
|
||||
break;
|
||||
}
|
||||
subPath = `${subPath}/${curPart}`;
|
||||
}
|
||||
if (subPath) {
|
||||
dynamicPaths.add(subPath);
|
||||
}
|
||||
} else {
|
||||
staticPaths.add(path);
|
||||
}
|
||||
}
|
||||
for (const redirect of redirects){
|
||||
const { source } = redirect;
|
||||
const path = (0, _removetrailingslash.removeTrailingSlash)(source);
|
||||
let tokens = [];
|
||||
try {
|
||||
tokens = (0, _trytoparsepath.tryToParsePath)(source).tokens || [];
|
||||
} catch {}
|
||||
if (tokens.every((token)=>typeof token === 'string')) {
|
||||
// only include static redirects initially
|
||||
staticPaths.add(path);
|
||||
}
|
||||
}
|
||||
const staticFilter = _bloomfilter.BloomFilter.from([
|
||||
...staticPaths
|
||||
], allowedErrorRate);
|
||||
const dynamicFilter = _bloomfilter.BloomFilter.from([
|
||||
...dynamicPaths
|
||||
], allowedErrorRate);
|
||||
const data = {
|
||||
staticFilter: staticFilter.export(),
|
||||
dynamicFilter: dynamicFilter.export()
|
||||
};
|
||||
return data;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=create-client-router-filter.js.map
|
||||
1
node_modules/next/dist/lib/create-client-router-filter.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/create-client-router-filter.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/create-client-router-filter.ts"],"sourcesContent":["import type { Token } from 'next/dist/compiled/path-to-regexp'\nimport { BloomFilter } from '../shared/lib/bloom-filter'\nimport { isDynamicRoute } from '../shared/lib/router/utils'\nimport { removeTrailingSlash } from '../shared/lib/router/utils/remove-trailing-slash'\nimport type { Redirect } from './load-custom-routes'\nimport { tryToParsePath } from './try-to-parse-path'\nimport {\n extractInterceptionRouteInformation,\n isInterceptionRouteAppPath,\n} from '../shared/lib/router/utils/interception-routes'\n\nexport function createClientRouterFilter(\n paths: string[],\n redirects: Redirect[],\n allowedErrorRate?: number\n): {\n staticFilter: ReturnType<BloomFilter['export']>\n dynamicFilter: ReturnType<BloomFilter['export']>\n} {\n const staticPaths = new Set<string>()\n const dynamicPaths = new Set<string>()\n\n for (let path of paths) {\n if (isDynamicRoute(path)) {\n if (isInterceptionRouteAppPath(path)) {\n path = extractInterceptionRouteInformation(path).interceptedRoute\n }\n\n let subPath = ''\n const pathParts = path.split('/')\n\n // start at 1 since we split on '/' and the path starts\n // with this so the first entry is an empty string\n for (let i = 1; i < pathParts.length; i++) {\n const curPart = pathParts[i]\n\n if (curPart.startsWith('[')) {\n break\n }\n subPath = `${subPath}/${curPart}`\n }\n\n if (subPath) {\n dynamicPaths.add(subPath)\n }\n } else {\n staticPaths.add(path)\n }\n }\n\n for (const redirect of redirects) {\n const { source } = redirect\n const path = removeTrailingSlash(source)\n let tokens: Token[] = []\n\n try {\n tokens = tryToParsePath(source).tokens || []\n } catch {}\n\n if (tokens.every((token) => typeof token === 'string')) {\n // only include static redirects initially\n staticPaths.add(path)\n }\n }\n\n const staticFilter = BloomFilter.from([...staticPaths], allowedErrorRate)\n\n const dynamicFilter = BloomFilter.from([...dynamicPaths], allowedErrorRate)\n const data = {\n staticFilter: staticFilter.export(),\n dynamicFilter: dynamicFilter.export(),\n }\n return data\n}\n"],"names":["createClientRouterFilter","paths","redirects","allowedErrorRate","staticPaths","Set","dynamicPaths","path","isDynamicRoute","isInterceptionRouteAppPath","extractInterceptionRouteInformation","interceptedRoute","subPath","pathParts","split","i","length","curPart","startsWith","add","redirect","source","removeTrailingSlash","tokens","tryToParsePath","every","token","staticFilter","BloomFilter","from","dynamicFilter","data","export"],"mappings":";;;;+BAWgBA;;;eAAAA;;;6BAVY;uBACG;qCACK;gCAEL;oCAIxB;AAEA,SAASA,yBACdC,KAAe,EACfC,SAAqB,EACrBC,gBAAyB;IAKzB,MAAMC,cAAc,IAAIC;IACxB,MAAMC,eAAe,IAAID;IAEzB,KAAK,IAAIE,QAAQN,MAAO;QACtB,IAAIO,IAAAA,qBAAc,EAACD,OAAO;YACxB,IAAIE,IAAAA,8CAA0B,EAACF,OAAO;gBACpCA,OAAOG,IAAAA,uDAAmC,EAACH,MAAMI,gBAAgB;YACnE;YAEA,IAAIC,UAAU;YACd,MAAMC,YAAYN,KAAKO,KAAK,CAAC;YAE7B,uDAAuD;YACvD,kDAAkD;YAClD,IAAK,IAAIC,IAAI,GAAGA,IAAIF,UAAUG,MAAM,EAAED,IAAK;gBACzC,MAAME,UAAUJ,SAAS,CAACE,EAAE;gBAE5B,IAAIE,QAAQC,UAAU,CAAC,MAAM;oBAC3B;gBACF;gBACAN,UAAU,GAAGA,QAAQ,CAAC,EAAEK,SAAS;YACnC;YAEA,IAAIL,SAAS;gBACXN,aAAaa,GAAG,CAACP;YACnB;QACF,OAAO;YACLR,YAAYe,GAAG,CAACZ;QAClB;IACF;IAEA,KAAK,MAAMa,YAAYlB,UAAW;QAChC,MAAM,EAAEmB,MAAM,EAAE,GAAGD;QACnB,MAAMb,OAAOe,IAAAA,wCAAmB,EAACD;QACjC,IAAIE,SAAkB,EAAE;QAExB,IAAI;YACFA,SAASC,IAAAA,8BAAc,EAACH,QAAQE,MAAM,IAAI,EAAE;QAC9C,EAAE,OAAM,CAAC;QAET,IAAIA,OAAOE,KAAK,CAAC,CAACC,QAAU,OAAOA,UAAU,WAAW;YACtD,0CAA0C;YAC1CtB,YAAYe,GAAG,CAACZ;QAClB;IACF;IAEA,MAAMoB,eAAeC,wBAAW,CAACC,IAAI,CAAC;WAAIzB;KAAY,EAAED;IAExD,MAAM2B,gBAAgBF,wBAAW,CAACC,IAAI,CAAC;WAAIvB;KAAa,EAAEH;IAC1D,MAAM4B,OAAO;QACXJ,cAAcA,aAAaK,MAAM;QACjCF,eAAeA,cAAcE,MAAM;IACrC;IACA,OAAOD;AACT"}
|
||||
1
node_modules/next/dist/lib/default-transpiled-packages.json
generated
vendored
Normal file
1
node_modules/next/dist/lib/default-transpiled-packages.json
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
["geist"]
|
||||
12
node_modules/next/dist/lib/detached-promise.d.ts
generated
vendored
Normal file
12
node_modules/next/dist/lib/detached-promise.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* A `Promise.withResolvers` implementation that exposes the `resolve` and
|
||||
* `reject` functions on a `Promise`.
|
||||
*
|
||||
* @see https://tc39.es/proposal-promise-with-resolvers/
|
||||
*/
|
||||
export declare class DetachedPromise<T = any> {
|
||||
readonly resolve: (value: T | PromiseLike<T>) => void;
|
||||
readonly reject: (reason: any) => void;
|
||||
readonly promise: Promise<T>;
|
||||
constructor();
|
||||
}
|
||||
32
node_modules/next/dist/lib/detached-promise.js
generated
vendored
Normal file
32
node_modules/next/dist/lib/detached-promise.js
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/**
|
||||
* A `Promise.withResolvers` implementation that exposes the `resolve` and
|
||||
* `reject` functions on a `Promise`.
|
||||
*
|
||||
* @see https://tc39.es/proposal-promise-with-resolvers/
|
||||
*/ "use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "DetachedPromise", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return DetachedPromise;
|
||||
}
|
||||
});
|
||||
class DetachedPromise {
|
||||
constructor(){
|
||||
let resolve;
|
||||
let reject;
|
||||
// Create the promise and assign the resolvers to the object.
|
||||
this.promise = new Promise((res, rej)=>{
|
||||
resolve = res;
|
||||
reject = rej;
|
||||
});
|
||||
// We know that resolvers is defined because the Promise constructor runs
|
||||
// synchronously.
|
||||
this.resolve = resolve;
|
||||
this.reject = reject;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=detached-promise.js.map
|
||||
1
node_modules/next/dist/lib/detached-promise.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/detached-promise.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/detached-promise.ts"],"sourcesContent":["/**\n * A `Promise.withResolvers` implementation that exposes the `resolve` and\n * `reject` functions on a `Promise`.\n *\n * @see https://tc39.es/proposal-promise-with-resolvers/\n */\nexport class DetachedPromise<T = any> {\n public readonly resolve: (value: T | PromiseLike<T>) => void\n public readonly reject: (reason: any) => void\n public readonly promise: Promise<T>\n\n constructor() {\n let resolve: (value: T | PromiseLike<T>) => void\n let reject: (reason: any) => void\n\n // Create the promise and assign the resolvers to the object.\n this.promise = new Promise<T>((res, rej) => {\n resolve = res\n reject = rej\n })\n\n // We know that resolvers is defined because the Promise constructor runs\n // synchronously.\n this.resolve = resolve!\n this.reject = reject!\n }\n}\n"],"names":["DetachedPromise","constructor","resolve","reject","promise","Promise","res","rej"],"mappings":"AAAA;;;;;CAKC;;;;+BACYA;;;eAAAA;;;AAAN,MAAMA;IAKXC,aAAc;QACZ,IAAIC;QACJ,IAAIC;QAEJ,6DAA6D;QAC7D,IAAI,CAACC,OAAO,GAAG,IAAIC,QAAW,CAACC,KAAKC;YAClCL,UAAUI;YACVH,SAASI;QACX;QAEA,yEAAyE;QACzE,iBAAiB;QACjB,IAAI,CAACL,OAAO,GAAGA;QACf,IAAI,CAACC,MAAM,GAAGA;IAChB;AACF"}
|
||||
1
node_modules/next/dist/lib/detect-typo.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/lib/detect-typo.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export declare function detectTypo(input: string, options: string[], threshold?: number): string | null;
|
||||
51
node_modules/next/dist/lib/detect-typo.js
generated
vendored
Normal file
51
node_modules/next/dist/lib/detect-typo.js
generated
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
// the minimum number of operations required to convert string a to string b.
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "detectTypo", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return detectTypo;
|
||||
}
|
||||
});
|
||||
function minDistance(a, b, threshold) {
|
||||
const m = a.length;
|
||||
const n = b.length;
|
||||
if (m < n) {
|
||||
return minDistance(b, a, threshold);
|
||||
}
|
||||
if (n === 0) {
|
||||
return m;
|
||||
}
|
||||
let previousRow = Array.from({
|
||||
length: n + 1
|
||||
}, (_, i)=>i);
|
||||
for(let i = 0; i < m; i++){
|
||||
const s1 = a[i];
|
||||
let currentRow = [
|
||||
i + 1
|
||||
];
|
||||
for(let j = 0; j < n; j++){
|
||||
const s2 = b[j];
|
||||
const insertions = previousRow[j + 1] + 1;
|
||||
const deletions = currentRow[j] + 1;
|
||||
const substitutions = previousRow[j] + Number(s1 !== s2);
|
||||
currentRow.push(Math.min(insertions, deletions, substitutions));
|
||||
}
|
||||
previousRow = currentRow;
|
||||
}
|
||||
return previousRow[previousRow.length - 1];
|
||||
}
|
||||
function detectTypo(input, options, threshold = 2) {
|
||||
const potentialTypos = options.map((o)=>({
|
||||
option: o,
|
||||
distance: minDistance(o, input, threshold)
|
||||
})).filter(({ distance })=>distance <= threshold && distance > 0).sort((a, b)=>a.distance - b.distance);
|
||||
if (potentialTypos.length) {
|
||||
return potentialTypos[0].option;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=detect-typo.js.map
|
||||
1
node_modules/next/dist/lib/detect-typo.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/detect-typo.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/detect-typo.ts"],"sourcesContent":["// the minimum number of operations required to convert string a to string b.\nfunction minDistance(a: string, b: string, threshold: number): number {\n const m = a.length\n const n = b.length\n\n if (m < n) {\n return minDistance(b, a, threshold)\n }\n\n if (n === 0) {\n return m\n }\n\n let previousRow = Array.from({ length: n + 1 }, (_, i) => i)\n\n for (let i = 0; i < m; i++) {\n const s1 = a[i]\n let currentRow = [i + 1]\n for (let j = 0; j < n; j++) {\n const s2 = b[j]\n const insertions = previousRow[j + 1] + 1\n const deletions = currentRow[j] + 1\n const substitutions = previousRow[j] + Number(s1 !== s2)\n currentRow.push(Math.min(insertions, deletions, substitutions))\n }\n previousRow = currentRow\n }\n return previousRow[previousRow.length - 1]\n}\n\nexport function detectTypo(input: string, options: string[], threshold = 2) {\n const potentialTypos = options\n .map((o) => ({\n option: o,\n distance: minDistance(o, input, threshold),\n }))\n .filter(({ distance }) => distance <= threshold && distance > 0)\n .sort((a, b) => a.distance - b.distance)\n\n if (potentialTypos.length) {\n return potentialTypos[0].option\n }\n return null\n}\n"],"names":["detectTypo","minDistance","a","b","threshold","m","length","n","previousRow","Array","from","_","i","s1","currentRow","j","s2","insertions","deletions","substitutions","Number","push","Math","min","input","options","potentialTypos","map","o","option","distance","filter","sort"],"mappings":"AAAA,6EAA6E;;;;;+BA8B7DA;;;eAAAA;;;AA7BhB,SAASC,YAAYC,CAAS,EAAEC,CAAS,EAAEC,SAAiB;IAC1D,MAAMC,IAAIH,EAAEI,MAAM;IAClB,MAAMC,IAAIJ,EAAEG,MAAM;IAElB,IAAID,IAAIE,GAAG;QACT,OAAON,YAAYE,GAAGD,GAAGE;IAC3B;IAEA,IAAIG,MAAM,GAAG;QACX,OAAOF;IACT;IAEA,IAAIG,cAAcC,MAAMC,IAAI,CAAC;QAAEJ,QAAQC,IAAI;IAAE,GAAG,CAACI,GAAGC,IAAMA;IAE1D,IAAK,IAAIA,IAAI,GAAGA,IAAIP,GAAGO,IAAK;QAC1B,MAAMC,KAAKX,CAAC,CAACU,EAAE;QACf,IAAIE,aAAa;YAACF,IAAI;SAAE;QACxB,IAAK,IAAIG,IAAI,GAAGA,IAAIR,GAAGQ,IAAK;YAC1B,MAAMC,KAAKb,CAAC,CAACY,EAAE;YACf,MAAME,aAAaT,WAAW,CAACO,IAAI,EAAE,GAAG;YACxC,MAAMG,YAAYJ,UAAU,CAACC,EAAE,GAAG;YAClC,MAAMI,gBAAgBX,WAAW,CAACO,EAAE,GAAGK,OAAOP,OAAOG;YACrDF,WAAWO,IAAI,CAACC,KAAKC,GAAG,CAACN,YAAYC,WAAWC;QAClD;QACAX,cAAcM;IAChB;IACA,OAAON,WAAW,CAACA,YAAYF,MAAM,GAAG,EAAE;AAC5C;AAEO,SAASN,WAAWwB,KAAa,EAAEC,OAAiB,EAAErB,YAAY,CAAC;IACxE,MAAMsB,iBAAiBD,QACpBE,GAAG,CAAC,CAACC,IAAO,CAAA;YACXC,QAAQD;YACRE,UAAU7B,YAAY2B,GAAGJ,OAAOpB;QAClC,CAAA,GACC2B,MAAM,CAAC,CAAC,EAAED,QAAQ,EAAE,GAAKA,YAAY1B,aAAa0B,WAAW,GAC7DE,IAAI,CAAC,CAAC9B,GAAGC,IAAMD,EAAE4B,QAAQ,GAAG3B,EAAE2B,QAAQ;IAEzC,IAAIJ,eAAepB,MAAM,EAAE;QACzB,OAAOoB,cAAc,CAAC,EAAE,CAACG,MAAM;IACjC;IACA,OAAO;AACT"}
|
||||
2
node_modules/next/dist/lib/download-swc.d.ts
generated
vendored
Normal file
2
node_modules/next/dist/lib/download-swc.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
export declare function downloadNativeNextSwc(version: string, bindingsDirectory: string, triplesABI: Array<string>): Promise<void>;
|
||||
export declare function downloadWasmSwc(version: string, wasmDirectory: string, variant?: 'nodejs' | 'web'): Promise<void>;
|
||||
183
node_modules/next/dist/lib/download-swc.js
generated
vendored
Normal file
183
node_modules/next/dist/lib/download-swc.js
generated
vendored
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
downloadNativeNextSwc: null,
|
||||
downloadWasmSwc: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
downloadNativeNextSwc: function() {
|
||||
return downloadNativeNextSwc;
|
||||
},
|
||||
downloadWasmSwc: function() {
|
||||
return downloadWasmSwc;
|
||||
}
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _log = /*#__PURE__*/ _interop_require_wildcard(require("../build/output/log"));
|
||||
const _tar = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/tar"));
|
||||
const _getregistry = require("./helpers/get-registry");
|
||||
const _getcachedirectory = require("./helpers/get-cache-directory");
|
||||
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 { WritableStream } = require('node:stream/web');
|
||||
const MAX_VERSIONS_TO_CACHE = 8;
|
||||
async function extractBinary(outputDirectory, pkgName, tarFileName) {
|
||||
const cacheDirectory = (0, _getcachedirectory.getCacheDirectory)('next-swc', process.env['NEXT_SWC_PATH']);
|
||||
const extractFromTar = ()=>_tar.default.x({
|
||||
file: _path.default.join(cacheDirectory, tarFileName),
|
||||
cwd: outputDirectory,
|
||||
strip: 1
|
||||
});
|
||||
if (!_fs.default.existsSync(_path.default.join(cacheDirectory, tarFileName))) {
|
||||
_log.info(`Downloading swc package ${pkgName}... to ${cacheDirectory}`);
|
||||
await _fs.default.promises.mkdir(cacheDirectory, {
|
||||
recursive: true
|
||||
});
|
||||
const tempFile = _path.default.join(cacheDirectory, `${tarFileName}.temp-${Date.now()}`);
|
||||
const registry = (0, _getregistry.getRegistry)();
|
||||
const downloadUrl = `${registry}${pkgName}/-/${tarFileName}`;
|
||||
await fetch(downloadUrl).then((res)=>{
|
||||
const { ok, body } = res;
|
||||
if (!ok || !body) {
|
||||
_log.error(`Failed to download swc package from ${downloadUrl}`);
|
||||
}
|
||||
if (!ok) {
|
||||
throw Object.defineProperty(new Error(`request failed with status ${res.status}`), "__NEXT_ERROR_CODE", {
|
||||
value: "E109",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
if (!body) {
|
||||
throw Object.defineProperty(new Error('request failed with empty body'), "__NEXT_ERROR_CODE", {
|
||||
value: "E143",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
const cacheWriteStream = _fs.default.createWriteStream(tempFile);
|
||||
return body.pipeTo(new WritableStream({
|
||||
write (chunk) {
|
||||
return new Promise((resolve, reject)=>cacheWriteStream.write(chunk, (error)=>{
|
||||
if (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
resolve();
|
||||
}));
|
||||
},
|
||||
close () {
|
||||
return new Promise((resolve, reject)=>cacheWriteStream.close((error)=>{
|
||||
if (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
resolve();
|
||||
}));
|
||||
}
|
||||
}));
|
||||
});
|
||||
await _fs.default.promises.access(tempFile) // ensure the temp file existed
|
||||
;
|
||||
await _fs.default.promises.rename(tempFile, _path.default.join(cacheDirectory, tarFileName));
|
||||
} else {
|
||||
_log.info(`Using cached swc package ${pkgName}...`);
|
||||
}
|
||||
await extractFromTar();
|
||||
const cacheFiles = await _fs.default.promises.readdir(cacheDirectory);
|
||||
if (cacheFiles.length > MAX_VERSIONS_TO_CACHE) {
|
||||
cacheFiles.sort((a, b)=>{
|
||||
if (a.length < b.length) return -1;
|
||||
return a.localeCompare(b);
|
||||
});
|
||||
// prune oldest versions in cache
|
||||
for(let i = 0; i++; i < cacheFiles.length - MAX_VERSIONS_TO_CACHE){
|
||||
await _fs.default.promises.unlink(_path.default.join(cacheDirectory, cacheFiles[i])).catch(()=>{});
|
||||
}
|
||||
}
|
||||
}
|
||||
async function downloadNativeNextSwc(version, bindingsDirectory, triplesABI) {
|
||||
for (const triple of triplesABI){
|
||||
const pkgName = `@next/swc-${triple}`;
|
||||
const tarFileName = `${pkgName.substring(6)}-${version}.tgz`;
|
||||
const outputDirectory = _path.default.join(bindingsDirectory, pkgName);
|
||||
if (_fs.default.existsSync(outputDirectory)) {
|
||||
// if the package is already downloaded a different
|
||||
// failure occurred than not being present
|
||||
return;
|
||||
}
|
||||
await _fs.default.promises.mkdir(outputDirectory, {
|
||||
recursive: true
|
||||
});
|
||||
await extractBinary(outputDirectory, pkgName, tarFileName);
|
||||
}
|
||||
}
|
||||
async function downloadWasmSwc(version, wasmDirectory, variant = 'nodejs') {
|
||||
const pkgName = `@next/swc-wasm-${variant}`;
|
||||
const tarFileName = `${pkgName.substring(6)}-${version}.tgz`;
|
||||
const outputDirectory = _path.default.join(wasmDirectory, pkgName);
|
||||
if (_fs.default.existsSync(outputDirectory)) {
|
||||
// if the package is already downloaded a different
|
||||
// failure occurred than not being present
|
||||
return;
|
||||
}
|
||||
await _fs.default.promises.mkdir(outputDirectory, {
|
||||
recursive: true
|
||||
});
|
||||
await extractBinary(outputDirectory, pkgName, tarFileName);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=download-swc.js.map
|
||||
1
node_modules/next/dist/lib/download-swc.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/download-swc.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
15
node_modules/next/dist/lib/error-telemetry-utils.d.ts
generated
vendored
Normal file
15
node_modules/next/dist/lib/error-telemetry-utils.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/**
|
||||
* Augments the digest field of errors thrown in React Server Components (RSC) with an error code.
|
||||
* Since RSC errors can only be serialized through the digest field, this provides a way to include
|
||||
* an additional error code that can be extracted client-side via `extractNextErrorCode`.
|
||||
*
|
||||
* The error code is appended to the digest string with a semicolon separator, allowing it to be
|
||||
* parsed out later while preserving the original digest value.
|
||||
*/
|
||||
export declare const createDigestWithErrorCode: (thrownValue: unknown, originalDigest: string) => string;
|
||||
/**
|
||||
* Copies the error code from one error to another by setting the __NEXT_ERROR_CODE property.
|
||||
* This allows error codes to be preserved when wrapping or transforming errors.
|
||||
*/
|
||||
export declare const copyNextErrorCode: (source: unknown, target: unknown) => void;
|
||||
export declare const extractNextErrorCode: (error: unknown) => string | undefined;
|
||||
56
node_modules/next/dist/lib/error-telemetry-utils.js
generated
vendored
Normal file
56
node_modules/next/dist/lib/error-telemetry-utils.js
generated
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
copyNextErrorCode: null,
|
||||
createDigestWithErrorCode: null,
|
||||
extractNextErrorCode: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
copyNextErrorCode: function() {
|
||||
return copyNextErrorCode;
|
||||
},
|
||||
createDigestWithErrorCode: function() {
|
||||
return createDigestWithErrorCode;
|
||||
},
|
||||
extractNextErrorCode: function() {
|
||||
return extractNextErrorCode;
|
||||
}
|
||||
});
|
||||
const ERROR_CODE_DELIMITER = '@';
|
||||
const createDigestWithErrorCode = (thrownValue, originalDigest)=>{
|
||||
if (typeof thrownValue === 'object' && thrownValue !== null && '__NEXT_ERROR_CODE' in thrownValue) {
|
||||
return `${originalDigest}${ERROR_CODE_DELIMITER}${thrownValue.__NEXT_ERROR_CODE}`;
|
||||
}
|
||||
return originalDigest;
|
||||
};
|
||||
const copyNextErrorCode = (source, target)=>{
|
||||
const errorCode = extractNextErrorCode(source);
|
||||
if (errorCode && typeof target === 'object' && target !== null) {
|
||||
Object.defineProperty(target, '__NEXT_ERROR_CODE', {
|
||||
value: errorCode,
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
};
|
||||
const extractNextErrorCode = (error)=>{
|
||||
if (typeof error === 'object' && error !== null && '__NEXT_ERROR_CODE' in error && typeof error.__NEXT_ERROR_CODE === 'string') {
|
||||
return error.__NEXT_ERROR_CODE;
|
||||
}
|
||||
if (typeof error === 'object' && error !== null && 'digest' in error && typeof error.digest === 'string') {
|
||||
const segments = error.digest.split(ERROR_CODE_DELIMITER);
|
||||
const errorCode = segments.find((segment)=>segment.startsWith('E'));
|
||||
return errorCode;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
//# sourceMappingURL=error-telemetry-utils.js.map
|
||||
1
node_modules/next/dist/lib/error-telemetry-utils.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/error-telemetry-utils.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/error-telemetry-utils.ts"],"sourcesContent":["const ERROR_CODE_DELIMITER = '@'\n\n/**\n * Augments the digest field of errors thrown in React Server Components (RSC) with an error code.\n * Since RSC errors can only be serialized through the digest field, this provides a way to include\n * an additional error code that can be extracted client-side via `extractNextErrorCode`.\n *\n * The error code is appended to the digest string with a semicolon separator, allowing it to be\n * parsed out later while preserving the original digest value.\n */\nexport const createDigestWithErrorCode = (\n thrownValue: unknown,\n originalDigest: string\n): string => {\n if (\n typeof thrownValue === 'object' &&\n thrownValue !== null &&\n '__NEXT_ERROR_CODE' in thrownValue\n ) {\n return `${originalDigest}${ERROR_CODE_DELIMITER}${thrownValue.__NEXT_ERROR_CODE}`\n }\n return originalDigest\n}\n\n/**\n * Copies the error code from one error to another by setting the __NEXT_ERROR_CODE property.\n * This allows error codes to be preserved when wrapping or transforming errors.\n */\nexport const copyNextErrorCode = (source: unknown, target: unknown): void => {\n const errorCode = extractNextErrorCode(source)\n if (errorCode && typeof target === 'object' && target !== null) {\n Object.defineProperty(target, '__NEXT_ERROR_CODE', {\n value: errorCode,\n enumerable: false,\n configurable: true,\n })\n }\n}\n\nexport const extractNextErrorCode = (error: unknown): string | undefined => {\n if (\n typeof error === 'object' &&\n error !== null &&\n '__NEXT_ERROR_CODE' in error &&\n typeof error.__NEXT_ERROR_CODE === 'string'\n ) {\n return error.__NEXT_ERROR_CODE\n }\n\n if (\n typeof error === 'object' &&\n error !== null &&\n 'digest' in error &&\n typeof error.digest === 'string'\n ) {\n const segments = error.digest.split(ERROR_CODE_DELIMITER)\n const errorCode = segments.find((segment) => segment.startsWith('E'))\n return errorCode\n }\n\n return undefined\n}\n"],"names":["copyNextErrorCode","createDigestWithErrorCode","extractNextErrorCode","ERROR_CODE_DELIMITER","thrownValue","originalDigest","__NEXT_ERROR_CODE","source","target","errorCode","Object","defineProperty","value","enumerable","configurable","error","digest","segments","split","find","segment","startsWith","undefined"],"mappings":";;;;;;;;;;;;;;;;IA4BaA,iBAAiB;eAAjBA;;IAlBAC,yBAAyB;eAAzBA;;IA6BAC,oBAAoB;eAApBA;;;AAvCb,MAAMC,uBAAuB;AAUtB,MAAMF,4BAA4B,CACvCG,aACAC;IAEA,IACE,OAAOD,gBAAgB,YACvBA,gBAAgB,QAChB,uBAAuBA,aACvB;QACA,OAAO,GAAGC,iBAAiBF,uBAAuBC,YAAYE,iBAAiB,EAAE;IACnF;IACA,OAAOD;AACT;AAMO,MAAML,oBAAoB,CAACO,QAAiBC;IACjD,MAAMC,YAAYP,qBAAqBK;IACvC,IAAIE,aAAa,OAAOD,WAAW,YAAYA,WAAW,MAAM;QAC9DE,OAAOC,cAAc,CAACH,QAAQ,qBAAqB;YACjDI,OAAOH;YACPI,YAAY;YACZC,cAAc;QAChB;IACF;AACF;AAEO,MAAMZ,uBAAuB,CAACa;IACnC,IACE,OAAOA,UAAU,YACjBA,UAAU,QACV,uBAAuBA,SACvB,OAAOA,MAAMT,iBAAiB,KAAK,UACnC;QACA,OAAOS,MAAMT,iBAAiB;IAChC;IAEA,IACE,OAAOS,UAAU,YACjBA,UAAU,QACV,YAAYA,SACZ,OAAOA,MAAMC,MAAM,KAAK,UACxB;QACA,MAAMC,WAAWF,MAAMC,MAAM,CAACE,KAAK,CAACf;QACpC,MAAMM,YAAYQ,SAASE,IAAI,CAAC,CAACC,UAAYA,QAAQC,UAAU,CAAC;QAChE,OAAOZ;IACT;IAEA,OAAOa;AACT"}
|
||||
26
node_modules/next/dist/lib/eslint/customFormatter.d.ts
generated
vendored
Normal file
26
node_modules/next/dist/lib/eslint/customFormatter.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
export declare enum MessageSeverity {
|
||||
Warning = 1,
|
||||
Error = 2
|
||||
}
|
||||
interface LintMessage {
|
||||
ruleId: string | null;
|
||||
severity: 1 | 2;
|
||||
message: string;
|
||||
line: number;
|
||||
column: number;
|
||||
}
|
||||
export interface LintResult {
|
||||
filePath: string;
|
||||
messages: LintMessage[];
|
||||
errorCount: number;
|
||||
warningCount: number;
|
||||
output?: string;
|
||||
source?: string;
|
||||
}
|
||||
export declare function formatResults(baseDir: string, results: LintResult[], format: (r: LintResult[]) => string | Promise<string>): Promise<{
|
||||
output: string;
|
||||
outputWithMessages: string;
|
||||
totalNextPluginErrorCount: number;
|
||||
totalNextPluginWarningCount: number;
|
||||
}>;
|
||||
export {};
|
||||
97
node_modules/next/dist/lib/eslint/customFormatter.js
generated
vendored
Normal file
97
node_modules/next/dist/lib/eslint/customFormatter.js
generated
vendored
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
MessageSeverity: null,
|
||||
formatResults: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
MessageSeverity: function() {
|
||||
return MessageSeverity;
|
||||
},
|
||||
formatResults: function() {
|
||||
return formatResults;
|
||||
}
|
||||
});
|
||||
const _picocolors = require("../picocolors");
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var MessageSeverity = /*#__PURE__*/ function(MessageSeverity) {
|
||||
MessageSeverity[MessageSeverity["Warning"] = 1] = "Warning";
|
||||
MessageSeverity[MessageSeverity["Error"] = 2] = "Error";
|
||||
return MessageSeverity;
|
||||
}({});
|
||||
function pluginCount(messages) {
|
||||
let nextPluginWarningCount = 0;
|
||||
let nextPluginErrorCount = 0;
|
||||
for(let i = 0; i < messages.length; i++){
|
||||
const { severity, ruleId } = messages[i];
|
||||
if (ruleId == null ? void 0 : ruleId.includes('@next/next')) {
|
||||
if (severity === 1) {
|
||||
nextPluginWarningCount += 1;
|
||||
} else {
|
||||
nextPluginErrorCount += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
nextPluginErrorCount,
|
||||
nextPluginWarningCount
|
||||
};
|
||||
}
|
||||
function formatMessage(dir, messages, filePath) {
|
||||
let fileName = _path.default.posix.normalize(_path.default.relative(dir, filePath).replace(/\\/g, '/'));
|
||||
if (!fileName.startsWith('.')) {
|
||||
fileName = './' + fileName;
|
||||
}
|
||||
let output = '\n' + (0, _picocolors.cyan)(fileName);
|
||||
for(let i = 0; i < messages.length; i++){
|
||||
const { message, severity, line, column, ruleId } = messages[i];
|
||||
output = output + '\n';
|
||||
if (line && column) {
|
||||
output = output + (0, _picocolors.yellow)(line.toString()) + ':' + (0, _picocolors.yellow)(column.toString()) + ' ';
|
||||
}
|
||||
if (severity === 1) {
|
||||
output += (0, _picocolors.yellow)((0, _picocolors.bold)('Warning')) + ': ';
|
||||
} else {
|
||||
output += (0, _picocolors.red)((0, _picocolors.bold)('Error')) + ': ';
|
||||
}
|
||||
output += message;
|
||||
if (ruleId) {
|
||||
output += ' ' + (0, _picocolors.gray)((0, _picocolors.bold)(ruleId));
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
async function formatResults(baseDir, results, format) {
|
||||
let totalNextPluginErrorCount = 0;
|
||||
let totalNextPluginWarningCount = 0;
|
||||
let resultsWithMessages = results.filter(({ messages })=>messages == null ? void 0 : messages.length);
|
||||
// Track number of Next.js plugin errors and warnings
|
||||
resultsWithMessages.forEach(({ messages })=>{
|
||||
const res = pluginCount(messages);
|
||||
totalNextPluginErrorCount += res.nextPluginErrorCount;
|
||||
totalNextPluginWarningCount += res.nextPluginWarningCount;
|
||||
});
|
||||
// Use user defined formatter or Next.js's built-in custom formatter
|
||||
const output = format ? await format(resultsWithMessages) : resultsWithMessages.map(({ messages, filePath })=>formatMessage(baseDir, messages, filePath)).join('\n');
|
||||
return {
|
||||
output: output,
|
||||
outputWithMessages: resultsWithMessages.length > 0 ? output + `\n\n${(0, _picocolors.cyan)('info')} - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/app/api-reference/config/eslint#disabling-rules` : '',
|
||||
totalNextPluginErrorCount,
|
||||
totalNextPluginWarningCount
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=customFormatter.js.map
|
||||
1
node_modules/next/dist/lib/eslint/customFormatter.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/eslint/customFormatter.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
22
node_modules/next/dist/lib/eslint/getESLintPromptValues.d.ts
generated
vendored
Normal file
22
node_modules/next/dist/lib/eslint/getESLintPromptValues.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
export declare const getESLintStrictValue: (cwd: string) => Promise<{
|
||||
title: string;
|
||||
recommended: boolean;
|
||||
config: {
|
||||
extends: string | string[];
|
||||
};
|
||||
}>;
|
||||
export declare const getESLintPromptValues: (cwd: string) => Promise<({
|
||||
title: string;
|
||||
recommended: boolean;
|
||||
config: {
|
||||
extends: string | string[];
|
||||
};
|
||||
} | {
|
||||
title: string;
|
||||
config: {
|
||||
extends: string;
|
||||
};
|
||||
} | {
|
||||
title: string;
|
||||
config: null;
|
||||
})[]>;
|
||||
61
node_modules/next/dist/lib/eslint/getESLintPromptValues.js
generated
vendored
Normal file
61
node_modules/next/dist/lib/eslint/getESLintPromptValues.js
generated
vendored
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
getESLintPromptValues: null,
|
||||
getESLintStrictValue: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
getESLintPromptValues: function() {
|
||||
return getESLintPromptValues;
|
||||
},
|
||||
getESLintStrictValue: function() {
|
||||
return getESLintStrictValue;
|
||||
}
|
||||
});
|
||||
const _findup = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/find-up"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
const getESLintStrictValue = async (cwd)=>{
|
||||
const tsConfigLocation = await (0, _findup.default)('tsconfig.json', {
|
||||
cwd
|
||||
});
|
||||
const hasTSConfig = tsConfigLocation !== undefined;
|
||||
return {
|
||||
title: 'Strict',
|
||||
recommended: true,
|
||||
config: {
|
||||
extends: hasTSConfig ? [
|
||||
'next/core-web-vitals',
|
||||
'next/typescript'
|
||||
] : 'next/core-web-vitals'
|
||||
}
|
||||
};
|
||||
};
|
||||
const getESLintPromptValues = async (cwd)=>{
|
||||
return [
|
||||
await getESLintStrictValue(cwd),
|
||||
{
|
||||
title: 'Base',
|
||||
config: {
|
||||
extends: 'next'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Cancel',
|
||||
config: null
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
//# sourceMappingURL=getESLintPromptValues.js.map
|
||||
1
node_modules/next/dist/lib/eslint/getESLintPromptValues.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/eslint/getESLintPromptValues.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../../src/lib/eslint/getESLintPromptValues.ts"],"sourcesContent":["import findUp from 'next/dist/compiled/find-up'\n\nexport const getESLintStrictValue = async (cwd: string) => {\n const tsConfigLocation = await findUp('tsconfig.json', { cwd })\n const hasTSConfig = tsConfigLocation !== undefined\n\n return {\n title: 'Strict',\n recommended: true,\n config: {\n extends: hasTSConfig\n ? ['next/core-web-vitals', 'next/typescript']\n : 'next/core-web-vitals',\n },\n }\n}\n\nexport const getESLintPromptValues = async (cwd: string) => {\n return [\n await getESLintStrictValue(cwd),\n {\n title: 'Base',\n config: {\n extends: 'next',\n },\n },\n {\n title: 'Cancel',\n config: null,\n },\n ]\n}\n"],"names":["getESLintPromptValues","getESLintStrictValue","cwd","tsConfigLocation","findUp","hasTSConfig","undefined","title","recommended","config","extends"],"mappings":";;;;;;;;;;;;;;;IAiBaA,qBAAqB;eAArBA;;IAfAC,oBAAoB;eAApBA;;;+DAFM;;;;;;AAEZ,MAAMA,uBAAuB,OAAOC;IACzC,MAAMC,mBAAmB,MAAMC,IAAAA,eAAM,EAAC,iBAAiB;QAAEF;IAAI;IAC7D,MAAMG,cAAcF,qBAAqBG;IAEzC,OAAO;QACLC,OAAO;QACPC,aAAa;QACbC,QAAQ;YACNC,SAASL,cACL;gBAAC;gBAAwB;aAAkB,GAC3C;QACN;IACF;AACF;AAEO,MAAML,wBAAwB,OAAOE;IAC1C,OAAO;QACL,MAAMD,qBAAqBC;QAC3B;YACEK,OAAO;YACPE,QAAQ;gBACNC,SAAS;YACX;QACF;QACA;YACEH,OAAO;YACPE,QAAQ;QACV;KACD;AACH"}
|
||||
9
node_modules/next/dist/lib/eslint/hasEslintConfiguration.d.ts
generated
vendored
Normal file
9
node_modules/next/dist/lib/eslint/hasEslintConfiguration.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export type ConfigAvailable = {
|
||||
exists: boolean;
|
||||
emptyEslintrc?: boolean;
|
||||
emptyPkgJsonConfig?: boolean;
|
||||
firstTimeSetup?: true;
|
||||
};
|
||||
export declare function hasEslintConfiguration(eslintrcFile: string | null, packageJsonConfig: {
|
||||
eslintConfig: any;
|
||||
} | null): Promise<ConfigAvailable>;
|
||||
37
node_modules/next/dist/lib/eslint/hasEslintConfiguration.js
generated
vendored
Normal file
37
node_modules/next/dist/lib/eslint/hasEslintConfiguration.js
generated
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "hasEslintConfiguration", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return hasEslintConfiguration;
|
||||
}
|
||||
});
|
||||
const _fs = require("fs");
|
||||
async function hasEslintConfiguration(eslintrcFile, packageJsonConfig) {
|
||||
const configObject = {
|
||||
exists: false,
|
||||
emptyEslintrc: false,
|
||||
emptyPkgJsonConfig: false
|
||||
};
|
||||
if (eslintrcFile) {
|
||||
const content = await _fs.promises.readFile(eslintrcFile, {
|
||||
encoding: 'utf8'
|
||||
}).then((txt)=>txt.trim().replace(/\n/g, ''), ()=>null);
|
||||
if (content === '' || content === '{}' || content === '---' || content === 'module.exports = {}') {
|
||||
configObject.emptyEslintrc = true;
|
||||
} else {
|
||||
configObject.exists = true;
|
||||
}
|
||||
} else if (packageJsonConfig == null ? void 0 : packageJsonConfig.eslintConfig) {
|
||||
if (Object.keys(packageJsonConfig.eslintConfig).length) {
|
||||
configObject.exists = true;
|
||||
} else {
|
||||
configObject.emptyPkgJsonConfig = true;
|
||||
}
|
||||
}
|
||||
return configObject;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=hasEslintConfiguration.js.map
|
||||
1
node_modules/next/dist/lib/eslint/hasEslintConfiguration.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/eslint/hasEslintConfiguration.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../../src/lib/eslint/hasEslintConfiguration.ts"],"sourcesContent":["import { promises as fs } from 'fs'\n\nexport type ConfigAvailable = {\n exists: boolean\n emptyEslintrc?: boolean\n emptyPkgJsonConfig?: boolean\n firstTimeSetup?: true\n}\n\nexport async function hasEslintConfiguration(\n eslintrcFile: string | null,\n packageJsonConfig: { eslintConfig: any } | null\n): Promise<ConfigAvailable> {\n const configObject = {\n exists: false,\n emptyEslintrc: false,\n emptyPkgJsonConfig: false,\n }\n\n if (eslintrcFile) {\n const content = await fs.readFile(eslintrcFile, { encoding: 'utf8' }).then(\n (txt) => txt.trim().replace(/\\n/g, ''),\n () => null\n )\n\n if (\n content === '' ||\n content === '{}' ||\n content === '---' ||\n content === 'module.exports = {}'\n ) {\n configObject.emptyEslintrc = true\n } else {\n configObject.exists = true\n }\n } else if (packageJsonConfig?.eslintConfig) {\n if (Object.keys(packageJsonConfig.eslintConfig).length) {\n configObject.exists = true\n } else {\n configObject.emptyPkgJsonConfig = true\n }\n }\n return configObject\n}\n"],"names":["hasEslintConfiguration","eslintrcFile","packageJsonConfig","configObject","exists","emptyEslintrc","emptyPkgJsonConfig","content","fs","readFile","encoding","then","txt","trim","replace","eslintConfig","Object","keys","length"],"mappings":";;;;+BASsBA;;;eAAAA;;;oBATS;AASxB,eAAeA,uBACpBC,YAA2B,EAC3BC,iBAA+C;IAE/C,MAAMC,eAAe;QACnBC,QAAQ;QACRC,eAAe;QACfC,oBAAoB;IACtB;IAEA,IAAIL,cAAc;QAChB,MAAMM,UAAU,MAAMC,YAAE,CAACC,QAAQ,CAACR,cAAc;YAAES,UAAU;QAAO,GAAGC,IAAI,CACxE,CAACC,MAAQA,IAAIC,IAAI,GAAGC,OAAO,CAAC,OAAO,KACnC,IAAM;QAGR,IACEP,YAAY,MACZA,YAAY,QACZA,YAAY,SACZA,YAAY,uBACZ;YACAJ,aAAaE,aAAa,GAAG;QAC/B,OAAO;YACLF,aAAaC,MAAM,GAAG;QACxB;IACF,OAAO,IAAIF,qCAAAA,kBAAmBa,YAAY,EAAE;QAC1C,IAAIC,OAAOC,IAAI,CAACf,kBAAkBa,YAAY,EAAEG,MAAM,EAAE;YACtDf,aAAaC,MAAM,GAAG;QACxB,OAAO;YACLD,aAAaG,kBAAkB,GAAG;QACpC;IACF;IACA,OAAOH;AACT"}
|
||||
23
node_modules/next/dist/lib/eslint/runLintCheck.d.ts
generated
vendored
Normal file
23
node_modules/next/dist/lib/eslint/runLintCheck.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import type { EventLintCheckCompleted } from '../../telemetry/events/build';
|
||||
declare function lint(baseDir: string, lintDirs: string[], eslintrcFile: string | null, pkgJsonPath: string | null, { lintDuringBuild, eslintOptions, reportErrorsOnly, maxWarnings, formatter, outputFile, }: {
|
||||
lintDuringBuild: boolean;
|
||||
eslintOptions: any;
|
||||
reportErrorsOnly: boolean;
|
||||
maxWarnings: number;
|
||||
formatter: string | null;
|
||||
outputFile: string | null;
|
||||
}): Promise<string | null | {
|
||||
output: string | null;
|
||||
isError: boolean;
|
||||
eventInfo: EventLintCheckCompleted;
|
||||
}>;
|
||||
export declare function runLintCheck(baseDir: string, lintDirs: string[], opts: {
|
||||
lintDuringBuild?: boolean;
|
||||
eslintOptions?: any;
|
||||
reportErrorsOnly?: boolean;
|
||||
maxWarnings?: number;
|
||||
formatter?: string | null;
|
||||
outputFile?: string | null;
|
||||
strict?: boolean;
|
||||
}): ReturnType<typeof lint>;
|
||||
export {};
|
||||
360
node_modules/next/dist/lib/eslint/runLintCheck.js
generated
vendored
Normal file
360
node_modules/next/dist/lib/eslint/runLintCheck.js
generated
vendored
Normal file
|
|
@ -0,0 +1,360 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "runLintCheck", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return runLintCheck;
|
||||
}
|
||||
});
|
||||
const _fs = require("fs");
|
||||
const _picocolors = require("../picocolors");
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _findup = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/find-up"));
|
||||
const _semver = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/semver"));
|
||||
const _commentjson = /*#__PURE__*/ _interop_require_wildcard(require("next/dist/compiled/comment-json"));
|
||||
const _customFormatter = require("./customFormatter");
|
||||
const _writeDefaultConfig = require("./writeDefaultConfig");
|
||||
const _hasEslintConfiguration = require("./hasEslintConfiguration");
|
||||
const _writeOutputFile = require("./writeOutputFile");
|
||||
const _findpagesdir = require("../find-pages-dir");
|
||||
const _installdependencies = require("../install-dependencies");
|
||||
const _hasnecessarydependencies = require("../has-necessary-dependencies");
|
||||
const _log = /*#__PURE__*/ _interop_require_wildcard(require("../../build/output/log"));
|
||||
const _iserror = /*#__PURE__*/ _interop_require_wildcard(require("../is-error"));
|
||||
const _getpkgmanager = require("../helpers/get-pkg-manager");
|
||||
const _getESLintPromptValues = require("./getESLintPromptValues");
|
||||
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;
|
||||
}
|
||||
// 0 is off, 1 is warn, 2 is error. See https://eslint.org/docs/user-guide/configuring/rules#configuring-rules
|
||||
const VALID_SEVERITY = [
|
||||
'off',
|
||||
'warn',
|
||||
'error'
|
||||
];
|
||||
function isValidSeverity(severity) {
|
||||
return VALID_SEVERITY.includes(severity);
|
||||
}
|
||||
const requiredPackages = [
|
||||
{
|
||||
file: 'eslint',
|
||||
pkg: 'eslint',
|
||||
exportsRestrict: false
|
||||
},
|
||||
{
|
||||
file: 'eslint-config-next',
|
||||
pkg: 'eslint-config-next',
|
||||
exportsRestrict: false
|
||||
}
|
||||
];
|
||||
async function cliPrompt(cwd) {
|
||||
console.log((0, _picocolors.bold)(`${(0, _picocolors.cyan)('?')} How would you like to configure ESLint? https://nextjs.org/docs/app/api-reference/config/eslint`));
|
||||
try {
|
||||
const cliSelect = (await Promise.resolve(require('next/dist/compiled/cli-select'))).default;
|
||||
const { value } = await cliSelect({
|
||||
values: await (0, _getESLintPromptValues.getESLintPromptValues)(cwd),
|
||||
valueRenderer: ({ title, recommended }, selected)=>{
|
||||
const name = selected ? (0, _picocolors.bold)((0, _picocolors.underline)((0, _picocolors.cyan)(title))) : title;
|
||||
return name + (recommended ? (0, _picocolors.bold)((0, _picocolors.yellow)(' (recommended)')) : '');
|
||||
},
|
||||
selected: (0, _picocolors.cyan)('❯ '),
|
||||
unselected: ' '
|
||||
});
|
||||
return {
|
||||
config: (value == null ? void 0 : value.config) ?? null
|
||||
};
|
||||
} catch {
|
||||
return {
|
||||
config: null
|
||||
};
|
||||
}
|
||||
}
|
||||
async function lint(baseDir, lintDirs, eslintrcFile, pkgJsonPath, { lintDuringBuild = false, eslintOptions = null, reportErrorsOnly = false, maxWarnings = -1, formatter = null, outputFile = null }) {
|
||||
try {
|
||||
var _mod_CLIEngine, _ESLint_getErrorResults;
|
||||
// Load ESLint after we're sure it exists:
|
||||
const deps = await (0, _hasnecessarydependencies.hasNecessaryDependencies)(baseDir, requiredPackages);
|
||||
const packageManager = (0, _getpkgmanager.getPkgManager)(baseDir);
|
||||
if (deps.missing.some((dep)=>dep.pkg === 'eslint')) {
|
||||
_log.error(`ESLint must be installed${lintDuringBuild ? ' in order to run during builds:' : ':'} ${(0, _picocolors.bold)((0, _picocolors.cyan)((packageManager === 'yarn' ? 'yarn add --dev' : packageManager === 'pnpm' ? 'pnpm install --save-dev' : 'npm install --save-dev') + ' eslint'))}`);
|
||||
return null;
|
||||
}
|
||||
const mod = await Promise.resolve(require(deps.resolved.get('eslint')));
|
||||
// If V9 config was found, use flat config, or else use legacy.
|
||||
const useFlatConfig = eslintrcFile ? _path.default.basename(eslintrcFile).startsWith('eslint.config.') : false;
|
||||
let ESLint;
|
||||
// loadESLint is >= 8.57.0
|
||||
// PR https://github.com/eslint/eslint/pull/18098
|
||||
// Release https://github.com/eslint/eslint/releases/tag/v8.57.0
|
||||
if ('loadESLint' in mod) {
|
||||
// By default, configType is `flat`. If `useFlatConfig` is false, the return value is `LegacyESLint`.
|
||||
// https://github.com/eslint/eslint/blob/1def4cdfab1f067c5089df8b36242cdf912b0eb6/lib/types/index.d.ts#L1609-L1613
|
||||
ESLint = await mod.loadESLint({
|
||||
useFlatConfig
|
||||
});
|
||||
} else {
|
||||
// eslint < 8.57.0, use legacy ESLint
|
||||
ESLint = mod.ESLint;
|
||||
}
|
||||
let eslintVersion = (ESLint == null ? void 0 : ESLint.version) ?? ((_mod_CLIEngine = mod.CLIEngine) == null ? void 0 : _mod_CLIEngine.version);
|
||||
if (!eslintVersion || _semver.default.lt(eslintVersion, '7.0.0')) {
|
||||
return `${(0, _picocolors.red)('error')} - Your project has an older version of ESLint installed${eslintVersion ? ' (' + eslintVersion + ')' : ''}. Please upgrade to ESLint version 7 or above`;
|
||||
}
|
||||
let options = {
|
||||
useEslintrc: true,
|
||||
baseConfig: {},
|
||||
errorOnUnmatchedPattern: false,
|
||||
extensions: [
|
||||
'.js',
|
||||
'.jsx',
|
||||
'.ts',
|
||||
'.tsx'
|
||||
],
|
||||
cache: true,
|
||||
...eslintOptions
|
||||
};
|
||||
if (_semver.default.gte(eslintVersion, '9.0.0') && useFlatConfig) {
|
||||
for (const option of [
|
||||
'useEslintrc',
|
||||
'extensions',
|
||||
'ignorePath',
|
||||
'reportUnusedDisableDirectives',
|
||||
'resolvePluginsRelativeTo',
|
||||
'rulePaths',
|
||||
'inlineConfig',
|
||||
'maxWarnings'
|
||||
]){
|
||||
if (option in options) {
|
||||
delete options[option];
|
||||
}
|
||||
}
|
||||
}
|
||||
let eslint = new ESLint(options);
|
||||
let nextEslintPluginIsEnabled = false;
|
||||
const nextRulesEnabled = new Map();
|
||||
for (const configFile of [
|
||||
eslintrcFile,
|
||||
pkgJsonPath
|
||||
]){
|
||||
if (!configFile) continue;
|
||||
const completeConfig = await eslint.calculateConfigForFile(configFile);
|
||||
if (!completeConfig) continue;
|
||||
const plugins = completeConfig.plugins;
|
||||
const hasNextPlugin = // in ESLint < 9, `plugins` value is string[]
|
||||
Array.isArray(plugins) ? plugins.includes('@next/next') : '@next/next' in plugins;
|
||||
if (hasNextPlugin) {
|
||||
nextEslintPluginIsEnabled = true;
|
||||
for (const [name, [severity]] of Object.entries(completeConfig.rules)){
|
||||
if (!name.startsWith('@next/next/')) {
|
||||
continue;
|
||||
}
|
||||
if (typeof severity === 'number' && severity >= 0 && severity < VALID_SEVERITY.length) {
|
||||
nextRulesEnabled.set(name, VALID_SEVERITY[severity]);
|
||||
} else if (typeof severity === 'string' && isValidSeverity(severity)) {
|
||||
nextRulesEnabled.set(name, severity);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
const pagesDir = (0, _findpagesdir.findPagesDir)(baseDir).pagesDir;
|
||||
const pagesDirRules = pagesDir ? [
|
||||
'@next/next/no-html-link-for-pages'
|
||||
] : [];
|
||||
if (nextEslintPluginIsEnabled) {
|
||||
let updatedPagesDir = false;
|
||||
for (const rule of pagesDirRules){
|
||||
var _options_baseConfig_rules, _options_baseConfig_rules1;
|
||||
if (!((_options_baseConfig_rules = options.baseConfig.rules) == null ? void 0 : _options_baseConfig_rules[rule]) && !((_options_baseConfig_rules1 = options.baseConfig.rules) == null ? void 0 : _options_baseConfig_rules1[rule.replace('@next/next', '@next/babel-plugin-next')])) {
|
||||
if (!options.baseConfig.rules) {
|
||||
options.baseConfig.rules = {};
|
||||
}
|
||||
options.baseConfig.rules[rule] = [
|
||||
1,
|
||||
pagesDir
|
||||
];
|
||||
updatedPagesDir = true;
|
||||
}
|
||||
}
|
||||
if (updatedPagesDir) {
|
||||
eslint = new ESLint(options);
|
||||
}
|
||||
} else {
|
||||
_log.warn('');
|
||||
_log.warn('The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/app/api-reference/config/eslint#migrating-existing-config');
|
||||
}
|
||||
const lintStart = process.hrtime();
|
||||
let results = await eslint.lintFiles(lintDirs);
|
||||
let selectedFormatter = null;
|
||||
if (options.fix) await ESLint.outputFixes(results);
|
||||
if (reportErrorsOnly) results = await ESLint.getErrorResults(results) // Only return errors if --quiet flag is used
|
||||
;
|
||||
if (formatter) selectedFormatter = await eslint.loadFormatter(formatter);
|
||||
const formattedResult = await (0, _customFormatter.formatResults)(baseDir, results, selectedFormatter == null ? void 0 : selectedFormatter.format);
|
||||
const lintEnd = process.hrtime(lintStart);
|
||||
const totalWarnings = results.reduce((sum, file)=>sum + file.warningCount, 0);
|
||||
if (outputFile) await (0, _writeOutputFile.writeOutputFile)(outputFile, formattedResult.output);
|
||||
return {
|
||||
output: formattedResult.outputWithMessages,
|
||||
isError: ((_ESLint_getErrorResults = ESLint.getErrorResults(results)) == null ? void 0 : _ESLint_getErrorResults.length) > 0 || maxWarnings >= 0 && totalWarnings > maxWarnings,
|
||||
eventInfo: {
|
||||
durationInSeconds: lintEnd[0],
|
||||
eslintVersion: eslintVersion,
|
||||
lintedFilesCount: results.length,
|
||||
lintFix: !!options.fix,
|
||||
nextEslintPluginVersion: nextEslintPluginIsEnabled && deps.resolved.has('eslint-config-next') ? require(_path.default.join(_path.default.dirname(deps.resolved.get('eslint-config-next')), 'package.json')).version : null,
|
||||
nextEslintPluginErrorsCount: formattedResult.totalNextPluginErrorCount,
|
||||
nextEslintPluginWarningsCount: formattedResult.totalNextPluginWarningCount,
|
||||
nextRulesEnabled: Object.fromEntries(nextRulesEnabled)
|
||||
}
|
||||
};
|
||||
} catch (err) {
|
||||
if (lintDuringBuild) {
|
||||
_log.error(`ESLint: ${(0, _iserror.default)(err) && err.message ? err.message.replace(/\n/g, ' ') : err}`);
|
||||
return null;
|
||||
} else {
|
||||
throw (0, _iserror.getProperError)(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
async function runLintCheck(baseDir, lintDirs, opts) {
|
||||
const { lintDuringBuild = false, eslintOptions = null, reportErrorsOnly = false, maxWarnings = -1, formatter = null, outputFile = null, strict = false } = opts;
|
||||
try {
|
||||
// Find user's .eslintrc file
|
||||
// See: https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats
|
||||
const eslintrcFile = await (0, _findup.default)([
|
||||
// eslint v9
|
||||
'eslint.config.js',
|
||||
'eslint.config.mjs',
|
||||
'eslint.config.cjs',
|
||||
// TS extensions require to install a separate package `jiti`.
|
||||
// https://eslint.org/docs/latest/use/configure/configuration-files#typescript-configuration-files
|
||||
'eslint.config.ts',
|
||||
'eslint.config.mts',
|
||||
'eslint.config.cts',
|
||||
// eslint <= v8
|
||||
'.eslintrc.js',
|
||||
'.eslintrc.cjs',
|
||||
'.eslintrc.yaml',
|
||||
'.eslintrc.yml',
|
||||
'.eslintrc.json',
|
||||
'.eslintrc'
|
||||
], {
|
||||
cwd: baseDir
|
||||
}) ?? null;
|
||||
const pkgJsonPath = await (0, _findup.default)('package.json', {
|
||||
cwd: baseDir
|
||||
}) ?? null;
|
||||
let packageJsonConfig = null;
|
||||
if (pkgJsonPath) {
|
||||
const pkgJsonContent = await _fs.promises.readFile(pkgJsonPath, {
|
||||
encoding: 'utf8'
|
||||
});
|
||||
packageJsonConfig = _commentjson.parse(pkgJsonContent);
|
||||
}
|
||||
const config = await (0, _hasEslintConfiguration.hasEslintConfiguration)(eslintrcFile, packageJsonConfig);
|
||||
let deps;
|
||||
if (config.exists) {
|
||||
// Run if ESLint config exists
|
||||
return await lint(baseDir, lintDirs, eslintrcFile, pkgJsonPath, {
|
||||
lintDuringBuild,
|
||||
eslintOptions,
|
||||
reportErrorsOnly,
|
||||
maxWarnings,
|
||||
formatter,
|
||||
outputFile
|
||||
});
|
||||
} else {
|
||||
// Display warning if no ESLint configuration is present inside
|
||||
// config file during "next build", no warning is shown when
|
||||
// no eslintrc file is present
|
||||
if (lintDuringBuild) {
|
||||
if (config.emptyPkgJsonConfig || config.emptyEslintrc) {
|
||||
_log.warn(`No ESLint configuration detected. Run ${(0, _picocolors.bold)((0, _picocolors.cyan)('next lint'))} to begin setup`);
|
||||
}
|
||||
return null;
|
||||
} else {
|
||||
// Ask user what config they would like to start with for first time "next lint" setup
|
||||
const { config: selectedConfig } = strict ? await (0, _getESLintPromptValues.getESLintStrictValue)(baseDir) : await cliPrompt(baseDir);
|
||||
if (selectedConfig == null) {
|
||||
// Show a warning if no option is selected in prompt
|
||||
_log.warn('If you set up ESLint yourself, we recommend adding the Next.js ESLint plugin. See https://nextjs.org/docs/app/api-reference/config/eslint#migrating-existing-config');
|
||||
return null;
|
||||
} else {
|
||||
// Check if necessary deps installed, and install any that are missing
|
||||
deps = await (0, _hasnecessarydependencies.hasNecessaryDependencies)(baseDir, requiredPackages);
|
||||
if (deps.missing.length > 0) {
|
||||
deps.missing.forEach((dep)=>{
|
||||
if (dep.pkg === 'eslint') {
|
||||
// pin to v9 to avoid breaking changes
|
||||
dep.pkg = 'eslint@^9';
|
||||
}
|
||||
});
|
||||
await (0, _installdependencies.installDependencies)(baseDir, deps.missing, true);
|
||||
}
|
||||
// Write default ESLint config.
|
||||
// Check for /pages and src/pages is to make sure this happens in Next.js folder
|
||||
if ([
|
||||
'app',
|
||||
'src/app',
|
||||
'pages',
|
||||
'src/pages'
|
||||
].some((dir)=>(0, _fs.existsSync)(_path.default.join(baseDir, dir)))) {
|
||||
await (0, _writeDefaultConfig.writeDefaultConfig)(baseDir, config, selectedConfig, eslintrcFile, pkgJsonPath, packageJsonConfig);
|
||||
}
|
||||
}
|
||||
_log.ready(`ESLint has successfully been configured. Run ${(0, _picocolors.bold)((0, _picocolors.cyan)('next lint'))} again to view warnings and errors.`);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=runLintCheck.js.map
|
||||
1
node_modules/next/dist/lib/eslint/runLintCheck.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/eslint/runLintCheck.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
4
node_modules/next/dist/lib/eslint/writeDefaultConfig.d.ts
generated
vendored
Normal file
4
node_modules/next/dist/lib/eslint/writeDefaultConfig.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
import type { ConfigAvailable } from './hasEslintConfiguration';
|
||||
export declare function writeDefaultConfig(baseDir: string, { exists, emptyEslintrc, emptyPkgJsonConfig }: ConfigAvailable, selectedConfig: any, eslintrcFile: string | null, pkgJsonPath: string | null, packageJsonConfig: {
|
||||
eslintConfig: any;
|
||||
} | null): Promise<void>;
|
||||
87
node_modules/next/dist/lib/eslint/writeDefaultConfig.js
generated
vendored
Normal file
87
node_modules/next/dist/lib/eslint/writeDefaultConfig.js
generated
vendored
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "writeDefaultConfig", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return writeDefaultConfig;
|
||||
}
|
||||
});
|
||||
const _fs = require("fs");
|
||||
const _picocolors = require("../picocolors");
|
||||
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _commentjson = /*#__PURE__*/ _interop_require_wildcard(require("next/dist/compiled/comment-json"));
|
||||
const _log = /*#__PURE__*/ _interop_require_wildcard(require("../../build/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;
|
||||
}
|
||||
async function writeDefaultConfig(baseDir, { exists, emptyEslintrc, emptyPkgJsonConfig }, selectedConfig, eslintrcFile, pkgJsonPath, packageJsonConfig) {
|
||||
if (!exists && emptyEslintrc && eslintrcFile) {
|
||||
const ext = _path.default.extname(eslintrcFile);
|
||||
let newFileContent;
|
||||
if (ext === '.yaml' || ext === '.yml') {
|
||||
newFileContent = "extends: 'next'";
|
||||
} else {
|
||||
newFileContent = _commentjson.stringify(selectedConfig, null, 2);
|
||||
if (ext === '.js') {
|
||||
newFileContent = 'module.exports = ' + newFileContent;
|
||||
}
|
||||
}
|
||||
await _fs.promises.writeFile(eslintrcFile, newFileContent + _os.default.EOL);
|
||||
_log.info(`We detected an empty ESLint configuration file (${(0, _picocolors.bold)(_path.default.basename(eslintrcFile))}) and updated it for you!`);
|
||||
} else if (!exists && emptyPkgJsonConfig && packageJsonConfig) {
|
||||
packageJsonConfig.eslintConfig = selectedConfig;
|
||||
if (pkgJsonPath) await _fs.promises.writeFile(pkgJsonPath, _commentjson.stringify(packageJsonConfig, null, 2) + _os.default.EOL);
|
||||
_log.info(`We detected an empty ${(0, _picocolors.bold)('eslintConfig')} field in package.json and updated it for you!`);
|
||||
} else if (!exists) {
|
||||
await _fs.promises.writeFile(_path.default.join(baseDir, '.eslintrc.json'), _commentjson.stringify(selectedConfig, null, 2) + _os.default.EOL);
|
||||
console.log((0, _picocolors.green)(`We created the ${(0, _picocolors.bold)('.eslintrc.json')} file for you and included your selected configuration.`));
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=writeDefaultConfig.js.map
|
||||
1
node_modules/next/dist/lib/eslint/writeDefaultConfig.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/eslint/writeDefaultConfig.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../../src/lib/eslint/writeDefaultConfig.ts"],"sourcesContent":["import { promises as fs } from 'fs'\nimport { bold, green } from '../picocolors'\nimport os from 'os'\nimport path from 'path'\nimport * as CommentJson from 'next/dist/compiled/comment-json'\nimport type { ConfigAvailable } from './hasEslintConfiguration'\n\nimport * as Log from '../../build/output/log'\n\nexport async function writeDefaultConfig(\n baseDir: string,\n { exists, emptyEslintrc, emptyPkgJsonConfig }: ConfigAvailable,\n selectedConfig: any,\n eslintrcFile: string | null,\n pkgJsonPath: string | null,\n packageJsonConfig: { eslintConfig: any } | null\n) {\n if (!exists && emptyEslintrc && eslintrcFile) {\n const ext = path.extname(eslintrcFile)\n\n let newFileContent\n if (ext === '.yaml' || ext === '.yml') {\n newFileContent = \"extends: 'next'\"\n } else {\n newFileContent = CommentJson.stringify(selectedConfig, null, 2)\n\n if (ext === '.js') {\n newFileContent = 'module.exports = ' + newFileContent\n }\n }\n\n await fs.writeFile(eslintrcFile, newFileContent + os.EOL)\n\n Log.info(\n `We detected an empty ESLint configuration file (${bold(\n path.basename(eslintrcFile)\n )}) and updated it for you!`\n )\n } else if (!exists && emptyPkgJsonConfig && packageJsonConfig) {\n packageJsonConfig.eslintConfig = selectedConfig\n\n if (pkgJsonPath)\n await fs.writeFile(\n pkgJsonPath,\n CommentJson.stringify(packageJsonConfig, null, 2) + os.EOL\n )\n\n Log.info(\n `We detected an empty ${bold(\n 'eslintConfig'\n )} field in package.json and updated it for you!`\n )\n } else if (!exists) {\n await fs.writeFile(\n path.join(baseDir, '.eslintrc.json'),\n CommentJson.stringify(selectedConfig, null, 2) + os.EOL\n )\n\n console.log(\n green(\n `We created the ${bold(\n '.eslintrc.json'\n )} file for you and included your selected configuration.`\n )\n )\n }\n}\n"],"names":["writeDefaultConfig","baseDir","exists","emptyEslintrc","emptyPkgJsonConfig","selectedConfig","eslintrcFile","pkgJsonPath","packageJsonConfig","ext","path","extname","newFileContent","CommentJson","stringify","fs","writeFile","os","EOL","Log","info","bold","basename","eslintConfig","join","console","log","green"],"mappings":";;;;+BASsBA;;;eAAAA;;;oBATS;4BACH;2DACb;6DACE;qEACY;6DAGR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,eAAeA,mBACpBC,OAAe,EACf,EAAEC,MAAM,EAAEC,aAAa,EAAEC,kBAAkB,EAAmB,EAC9DC,cAAmB,EACnBC,YAA2B,EAC3BC,WAA0B,EAC1BC,iBAA+C;IAE/C,IAAI,CAACN,UAAUC,iBAAiBG,cAAc;QAC5C,MAAMG,MAAMC,aAAI,CAACC,OAAO,CAACL;QAEzB,IAAIM;QACJ,IAAIH,QAAQ,WAAWA,QAAQ,QAAQ;YACrCG,iBAAiB;QACnB,OAAO;YACLA,iBAAiBC,aAAYC,SAAS,CAACT,gBAAgB,MAAM;YAE7D,IAAII,QAAQ,OAAO;gBACjBG,iBAAiB,sBAAsBA;YACzC;QACF;QAEA,MAAMG,YAAE,CAACC,SAAS,CAACV,cAAcM,iBAAiBK,WAAE,CAACC,GAAG;QAExDC,KAAIC,IAAI,CACN,CAAC,gDAAgD,EAAEC,IAAAA,gBAAI,EACrDX,aAAI,CAACY,QAAQ,CAAChB,eACd,yBAAyB,CAAC;IAEhC,OAAO,IAAI,CAACJ,UAAUE,sBAAsBI,mBAAmB;QAC7DA,kBAAkBe,YAAY,GAAGlB;QAEjC,IAAIE,aACF,MAAMQ,YAAE,CAACC,SAAS,CAChBT,aACAM,aAAYC,SAAS,CAACN,mBAAmB,MAAM,KAAKS,WAAE,CAACC,GAAG;QAG9DC,KAAIC,IAAI,CACN,CAAC,qBAAqB,EAAEC,IAAAA,gBAAI,EAC1B,gBACA,8CAA8C,CAAC;IAErD,OAAO,IAAI,CAACnB,QAAQ;QAClB,MAAMa,YAAE,CAACC,SAAS,CAChBN,aAAI,CAACc,IAAI,CAACvB,SAAS,mBACnBY,aAAYC,SAAS,CAACT,gBAAgB,MAAM,KAAKY,WAAE,CAACC,GAAG;QAGzDO,QAAQC,GAAG,CACTC,IAAAA,iBAAK,EACH,CAAC,eAAe,EAAEN,IAAAA,gBAAI,EACpB,kBACA,uDAAuD,CAAC;IAGhE;AACF"}
|
||||
8
node_modules/next/dist/lib/eslint/writeOutputFile.d.ts
generated
vendored
Normal file
8
node_modules/next/dist/lib/eslint/writeOutputFile.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* Create a file with eslint output data
|
||||
*/
|
||||
export declare function writeOutputFile(
|
||||
/** The name file that needs to be created */
|
||||
outputFile: string,
|
||||
/** The data that needs to be inserted into the file */
|
||||
outputData: string): Promise<void>;
|
||||
90
node_modules/next/dist/lib/eslint/writeOutputFile.js
generated
vendored
Normal file
90
node_modules/next/dist/lib/eslint/writeOutputFile.js
generated
vendored
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "writeOutputFile", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return writeOutputFile;
|
||||
}
|
||||
});
|
||||
const _fs = require("fs");
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _log = /*#__PURE__*/ _interop_require_wildcard(require("../../build/output/log"));
|
||||
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;
|
||||
}
|
||||
/**
|
||||
* Check if a given file path is a directory or not.
|
||||
* Returns `true` if the path is a directory.
|
||||
*/ function isDirectory(/** The path to a file to check. */ filePath) {
|
||||
return _fs.promises.stat(filePath).then((stat)=>stat.isDirectory()).catch((error)=>{
|
||||
if ((0, _iserror.default)(error) && (error.code === 'ENOENT' || error.code === 'ENOTDIR')) {
|
||||
return false;
|
||||
}
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
async function writeOutputFile(/** The name file that needs to be created */ outputFile, /** The data that needs to be inserted into the file */ outputData) {
|
||||
const filePath = _path.default.resolve(process.cwd(), outputFile);
|
||||
if (await isDirectory(filePath)) {
|
||||
_log.error(`Cannot write to output file path, it is a directory: ${filePath}`);
|
||||
} else {
|
||||
try {
|
||||
await _fs.promises.mkdir(_path.default.dirname(filePath), {
|
||||
recursive: true
|
||||
});
|
||||
await _fs.promises.writeFile(filePath, outputData);
|
||||
_log.info(`The output file has been created: ${filePath}`);
|
||||
} catch (err) {
|
||||
_log.error(`There was a problem writing the output file: ${filePath}`);
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=writeOutputFile.js.map
|
||||
1
node_modules/next/dist/lib/eslint/writeOutputFile.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/eslint/writeOutputFile.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../../src/lib/eslint/writeOutputFile.ts"],"sourcesContent":["import { promises as fs } from 'fs'\nimport path from 'path'\nimport * as Log from '../../build/output/log'\nimport isError from '../../lib/is-error'\n\n/**\n * Check if a given file path is a directory or not.\n * Returns `true` if the path is a directory.\n */\nfunction isDirectory(\n /** The path to a file to check. */\n filePath: string\n): Promise<boolean> {\n return fs\n .stat(filePath)\n .then((stat) => stat.isDirectory())\n .catch((error) => {\n if (\n isError(error) &&\n (error.code === 'ENOENT' || error.code === 'ENOTDIR')\n ) {\n return false\n }\n throw error\n })\n}\n/**\n * Create a file with eslint output data\n */\nexport async function writeOutputFile(\n /** The name file that needs to be created */\n outputFile: string,\n /** The data that needs to be inserted into the file */\n outputData: string\n): Promise<void> {\n const filePath = path.resolve(process.cwd(), outputFile)\n\n if (await isDirectory(filePath)) {\n Log.error(\n `Cannot write to output file path, it is a directory: ${filePath}`\n )\n } else {\n try {\n await fs.mkdir(path.dirname(filePath), { recursive: true })\n await fs.writeFile(filePath, outputData)\n Log.info(`The output file has been created: ${filePath}`)\n } catch (err) {\n Log.error(`There was a problem writing the output file: ${filePath}`)\n console.error(err)\n }\n }\n}\n"],"names":["writeOutputFile","isDirectory","filePath","fs","stat","then","catch","error","isError","code","outputFile","outputData","path","resolve","process","cwd","Log","mkdir","dirname","recursive","writeFile","info","err","console"],"mappings":";;;;+BA6BsBA;;;eAAAA;;;oBA7BS;6DACd;6DACI;gEACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEpB;;;CAGC,GACD,SAASC,YACP,kCAAkC,GAClCC,QAAgB;IAEhB,OAAOC,YAAE,CACNC,IAAI,CAACF,UACLG,IAAI,CAAC,CAACD,OAASA,KAAKH,WAAW,IAC/BK,KAAK,CAAC,CAACC;QACN,IACEC,IAAAA,gBAAO,EAACD,UACPA,CAAAA,MAAME,IAAI,KAAK,YAAYF,MAAME,IAAI,KAAK,SAAQ,GACnD;YACA,OAAO;QACT;QACA,MAAMF;IACR;AACJ;AAIO,eAAeP,gBACpB,2CAA2C,GAC3CU,UAAkB,EAClB,qDAAqD,GACrDC,UAAkB;IAElB,MAAMT,WAAWU,aAAI,CAACC,OAAO,CAACC,QAAQC,GAAG,IAAIL;IAE7C,IAAI,MAAMT,YAAYC,WAAW;QAC/Bc,KAAIT,KAAK,CACP,CAAC,qDAAqD,EAAEL,UAAU;IAEtE,OAAO;QACL,IAAI;YACF,MAAMC,YAAE,CAACc,KAAK,CAACL,aAAI,CAACM,OAAO,CAAChB,WAAW;gBAAEiB,WAAW;YAAK;YACzD,MAAMhB,YAAE,CAACiB,SAAS,CAAClB,UAAUS;YAC7BK,KAAIK,IAAI,CAAC,CAAC,kCAAkC,EAAEnB,UAAU;QAC1D,EAAE,OAAOoB,KAAK;YACZN,KAAIT,KAAK,CAAC,CAAC,6CAA6C,EAAEL,UAAU;YACpEqB,QAAQhB,KAAK,CAACe;QAChB;IACF;AACF"}
|
||||
41
node_modules/next/dist/lib/fallback.d.ts
generated
vendored
Normal file
41
node_modules/next/dist/lib/fallback.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/**
|
||||
* Describes the different fallback modes that a given page can have.
|
||||
*/
|
||||
export declare const enum FallbackMode {
|
||||
/**
|
||||
* A BLOCKING_STATIC_RENDER fallback will block the request until the page is
|
||||
* generated. No fallback page will be rendered, and users will have to wait
|
||||
* to render the page.
|
||||
*/
|
||||
BLOCKING_STATIC_RENDER = "BLOCKING_STATIC_RENDER",
|
||||
/**
|
||||
* When set to PRERENDER, a fallback page will be sent to users in place of
|
||||
* forcing them to wait for the page to be generated. This allows the user to
|
||||
* see a rendered page earlier.
|
||||
*/
|
||||
PRERENDER = "PRERENDER",
|
||||
/**
|
||||
* When set to NOT_FOUND, pages that are not already prerendered will result
|
||||
* in a not found response.
|
||||
*/
|
||||
NOT_FOUND = "NOT_FOUND"
|
||||
}
|
||||
/**
|
||||
* The fallback value returned from the `getStaticPaths` function.
|
||||
*/
|
||||
export type GetStaticPathsFallback = boolean | 'blocking';
|
||||
/**
|
||||
* Parses the fallback field from the prerender manifest.
|
||||
*
|
||||
* @param fallbackField The fallback field from the prerender manifest.
|
||||
* @returns The fallback mode.
|
||||
*/
|
||||
export declare function parseFallbackField(fallbackField: string | boolean | null | undefined): FallbackMode | undefined;
|
||||
export declare function fallbackModeToFallbackField(fallback: FallbackMode, page: string | undefined): string | false | null;
|
||||
/**
|
||||
* Parses the fallback from the static paths result.
|
||||
*
|
||||
* @param result The result from the static paths function.
|
||||
* @returns The fallback mode.
|
||||
*/
|
||||
export declare function parseStaticPathsResult(result: GetStaticPathsFallback): FallbackMode;
|
||||
100
node_modules/next/dist/lib/fallback.js
generated
vendored
Normal file
100
node_modules/next/dist/lib/fallback.js
generated
vendored
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
/**
|
||||
* Describes the different fallback modes that a given page can have.
|
||||
*/ "use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
FallbackMode: null,
|
||||
fallbackModeToFallbackField: null,
|
||||
parseFallbackField: null,
|
||||
parseStaticPathsResult: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
FallbackMode: function() {
|
||||
return FallbackMode;
|
||||
},
|
||||
fallbackModeToFallbackField: function() {
|
||||
return fallbackModeToFallbackField;
|
||||
},
|
||||
parseFallbackField: function() {
|
||||
return parseFallbackField;
|
||||
},
|
||||
parseStaticPathsResult: function() {
|
||||
return parseStaticPathsResult;
|
||||
}
|
||||
});
|
||||
var FallbackMode = /*#__PURE__*/ function(FallbackMode) {
|
||||
/**
|
||||
* A BLOCKING_STATIC_RENDER fallback will block the request until the page is
|
||||
* generated. No fallback page will be rendered, and users will have to wait
|
||||
* to render the page.
|
||||
*/ FallbackMode["BLOCKING_STATIC_RENDER"] = "BLOCKING_STATIC_RENDER";
|
||||
/**
|
||||
* When set to PRERENDER, a fallback page will be sent to users in place of
|
||||
* forcing them to wait for the page to be generated. This allows the user to
|
||||
* see a rendered page earlier.
|
||||
*/ FallbackMode["PRERENDER"] = "PRERENDER";
|
||||
/**
|
||||
* When set to NOT_FOUND, pages that are not already prerendered will result
|
||||
* in a not found response.
|
||||
*/ FallbackMode["NOT_FOUND"] = "NOT_FOUND";
|
||||
return FallbackMode;
|
||||
}({});
|
||||
function parseFallbackField(fallbackField) {
|
||||
if (typeof fallbackField === 'string') {
|
||||
return "PRERENDER";
|
||||
} else if (fallbackField === null) {
|
||||
return "BLOCKING_STATIC_RENDER";
|
||||
} else if (fallbackField === false) {
|
||||
return "NOT_FOUND";
|
||||
} else if (fallbackField === undefined) {
|
||||
return undefined;
|
||||
} else {
|
||||
throw Object.defineProperty(new Error(`Invalid fallback option: ${fallbackField}. Fallback option must be a string, null, undefined, or false.`), "__NEXT_ERROR_CODE", {
|
||||
value: "E285",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
}
|
||||
function fallbackModeToFallbackField(fallback, page) {
|
||||
switch(fallback){
|
||||
case "BLOCKING_STATIC_RENDER":
|
||||
return null;
|
||||
case "NOT_FOUND":
|
||||
return false;
|
||||
case "PRERENDER":
|
||||
if (!page) {
|
||||
throw Object.defineProperty(new Error(`Invariant: expected a page to be provided when fallback mode is "${fallback}"`), "__NEXT_ERROR_CODE", {
|
||||
value: "E422",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
return page;
|
||||
default:
|
||||
throw Object.defineProperty(new Error(`Invalid fallback mode: ${fallback}`), "__NEXT_ERROR_CODE", {
|
||||
value: "E254",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
}
|
||||
function parseStaticPathsResult(result) {
|
||||
if (result === true) {
|
||||
return "PRERENDER";
|
||||
} else if (result === 'blocking') {
|
||||
return "BLOCKING_STATIC_RENDER";
|
||||
} else {
|
||||
return "NOT_FOUND";
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=fallback.js.map
|
||||
1
node_modules/next/dist/lib/fallback.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/fallback.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/fallback.ts"],"sourcesContent":["/**\n * Describes the different fallback modes that a given page can have.\n */\nexport const enum FallbackMode {\n /**\n * A BLOCKING_STATIC_RENDER fallback will block the request until the page is\n * generated. No fallback page will be rendered, and users will have to wait\n * to render the page.\n */\n BLOCKING_STATIC_RENDER = 'BLOCKING_STATIC_RENDER',\n\n /**\n * When set to PRERENDER, a fallback page will be sent to users in place of\n * forcing them to wait for the page to be generated. This allows the user to\n * see a rendered page earlier.\n */\n PRERENDER = 'PRERENDER',\n\n /**\n * When set to NOT_FOUND, pages that are not already prerendered will result\n * in a not found response.\n */\n NOT_FOUND = 'NOT_FOUND',\n}\n\n/**\n * The fallback value returned from the `getStaticPaths` function.\n */\nexport type GetStaticPathsFallback = boolean | 'blocking'\n\n/**\n * Parses the fallback field from the prerender manifest.\n *\n * @param fallbackField The fallback field from the prerender manifest.\n * @returns The fallback mode.\n */\nexport function parseFallbackField(\n fallbackField: string | boolean | null | undefined\n): FallbackMode | undefined {\n if (typeof fallbackField === 'string') {\n return FallbackMode.PRERENDER\n } else if (fallbackField === null) {\n return FallbackMode.BLOCKING_STATIC_RENDER\n } else if (fallbackField === false) {\n return FallbackMode.NOT_FOUND\n } else if (fallbackField === undefined) {\n return undefined\n } else {\n throw new Error(\n `Invalid fallback option: ${fallbackField}. Fallback option must be a string, null, undefined, or false.`\n )\n }\n}\n\nexport function fallbackModeToFallbackField(\n fallback: FallbackMode,\n page: string | undefined\n): string | false | null {\n switch (fallback) {\n case FallbackMode.BLOCKING_STATIC_RENDER:\n return null\n case FallbackMode.NOT_FOUND:\n return false\n case FallbackMode.PRERENDER:\n if (!page) {\n throw new Error(\n `Invariant: expected a page to be provided when fallback mode is \"${fallback}\"`\n )\n }\n\n return page\n default:\n throw new Error(`Invalid fallback mode: ${fallback}`)\n }\n}\n\n/**\n * Parses the fallback from the static paths result.\n *\n * @param result The result from the static paths function.\n * @returns The fallback mode.\n */\nexport function parseStaticPathsResult(\n result: GetStaticPathsFallback\n): FallbackMode {\n if (result === true) {\n return FallbackMode.PRERENDER\n } else if (result === 'blocking') {\n return FallbackMode.BLOCKING_STATIC_RENDER\n } else {\n return FallbackMode.NOT_FOUND\n }\n}\n"],"names":["FallbackMode","fallbackModeToFallbackField","parseFallbackField","parseStaticPathsResult","fallbackField","undefined","Error","fallback","page","result"],"mappings":"AAAA;;CAEC;;;;;;;;;;;;;;;;;IACiBA,YAAY;eAAZA;;IAmDFC,2BAA2B;eAA3BA;;IAlBAC,kBAAkB;eAAlBA;;IA8CAC,sBAAsB;eAAtBA;;;AA/ET,IAAA,AAAWH,sCAAAA;IAChB;;;;GAIC;IAGD;;;;GAIC;IAGD;;;GAGC;WAlBeA;;AAiCX,SAASE,mBACdE,aAAkD;IAElD,IAAI,OAAOA,kBAAkB,UAAU;QACrC;IACF,OAAO,IAAIA,kBAAkB,MAAM;QACjC;IACF,OAAO,IAAIA,kBAAkB,OAAO;QAClC;IACF,OAAO,IAAIA,kBAAkBC,WAAW;QACtC,OAAOA;IACT,OAAO;QACL,MAAM,qBAEL,CAFK,IAAIC,MACR,CAAC,yBAAyB,EAAEF,cAAc,8DAA8D,CAAC,GADrG,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;AACF;AAEO,SAASH,4BACdM,QAAsB,EACtBC,IAAwB;IAExB,OAAQD;QACN;YACE,OAAO;QACT;YACE,OAAO;QACT;YACE,IAAI,CAACC,MAAM;gBACT,MAAM,qBAEL,CAFK,IAAIF,MACR,CAAC,iEAAiE,EAAEC,SAAS,CAAC,CAAC,GAD3E,qBAAA;2BAAA;gCAAA;kCAAA;gBAEN;YACF;YAEA,OAAOC;QACT;YACE,MAAM,qBAA+C,CAA/C,IAAIF,MAAM,CAAC,uBAAuB,EAAEC,UAAU,GAA9C,qBAAA;uBAAA;4BAAA;8BAAA;YAA8C;IACxD;AACF;AAQO,SAASJ,uBACdM,MAA8B;IAE9B,IAAIA,WAAW,MAAM;QACnB;IACF,OAAO,IAAIA,WAAW,YAAY;QAChC;IACF,OAAO;QACL;IACF;AACF"}
|
||||
2
node_modules/next/dist/lib/fatal-error.d.ts
generated
vendored
Normal file
2
node_modules/next/dist/lib/fatal-error.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
export declare class FatalError extends Error {
|
||||
}
|
||||
14
node_modules/next/dist/lib/fatal-error.js
generated
vendored
Normal file
14
node_modules/next/dist/lib/fatal-error.js
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "FatalError", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return FatalError;
|
||||
}
|
||||
});
|
||||
class FatalError extends Error {
|
||||
}
|
||||
|
||||
//# sourceMappingURL=fatal-error.js.map
|
||||
1
node_modules/next/dist/lib/fatal-error.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/fatal-error.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/fatal-error.ts"],"sourcesContent":["export class FatalError extends Error {}\n"],"names":["FatalError","Error"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,mBAAmBC;AAAO"}
|
||||
5
node_modules/next/dist/lib/file-exists.d.ts
generated
vendored
Normal file
5
node_modules/next/dist/lib/file-exists.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export declare enum FileType {
|
||||
File = "file",
|
||||
Directory = "directory"
|
||||
}
|
||||
export declare function fileExists(fileName: string, type?: FileType): Promise<boolean>;
|
||||
53
node_modules/next/dist/lib/file-exists.js
generated
vendored
Normal file
53
node_modules/next/dist/lib/file-exists.js
generated
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
FileType: null,
|
||||
fileExists: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
FileType: function() {
|
||||
return FileType;
|
||||
},
|
||||
fileExists: function() {
|
||||
return fileExists;
|
||||
}
|
||||
});
|
||||
const _fs = require("fs");
|
||||
const _iserror = /*#__PURE__*/ _interop_require_default(require("./is-error"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var FileType = /*#__PURE__*/ function(FileType) {
|
||||
FileType["File"] = "file";
|
||||
FileType["Directory"] = "directory";
|
||||
return FileType;
|
||||
}({});
|
||||
async function fileExists(fileName, type) {
|
||||
try {
|
||||
if (type === "file") {
|
||||
const stats = await _fs.promises.stat(fileName);
|
||||
return stats.isFile();
|
||||
} else if (type === "directory") {
|
||||
const stats = await _fs.promises.stat(fileName);
|
||||
return stats.isDirectory();
|
||||
}
|
||||
return (0, _fs.existsSync)(fileName);
|
||||
} catch (err) {
|
||||
if ((0, _iserror.default)(err) && (err.code === 'ENOENT' || err.code === 'ENAMETOOLONG')) {
|
||||
return false;
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=file-exists.js.map
|
||||
1
node_modules/next/dist/lib/file-exists.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/file-exists.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/file-exists.ts"],"sourcesContent":["import { existsSync, promises } from 'fs'\nimport isError from './is-error'\n\nexport enum FileType {\n File = 'file',\n Directory = 'directory',\n}\n\nexport async function fileExists(\n fileName: string,\n type?: FileType\n): Promise<boolean> {\n try {\n if (type === FileType.File) {\n const stats = await promises.stat(fileName)\n return stats.isFile()\n } else if (type === FileType.Directory) {\n const stats = await promises.stat(fileName)\n return stats.isDirectory()\n }\n\n return existsSync(fileName)\n } catch (err) {\n if (\n isError(err) &&\n (err.code === 'ENOENT' || err.code === 'ENAMETOOLONG')\n ) {\n return false\n }\n throw err\n }\n}\n"],"names":["FileType","fileExists","fileName","type","stats","promises","stat","isFile","isDirectory","existsSync","err","isError","code"],"mappings":";;;;;;;;;;;;;;;IAGYA,QAAQ;eAARA;;IAKUC,UAAU;eAAVA;;;oBARe;gEACjB;;;;;;AAEb,IAAA,AAAKD,kCAAAA;;;WAAAA;;AAKL,eAAeC,WACpBC,QAAgB,EAChBC,IAAe;IAEf,IAAI;QACF,IAAIA,iBAAwB;YAC1B,MAAMC,QAAQ,MAAMC,YAAQ,CAACC,IAAI,CAACJ;YAClC,OAAOE,MAAMG,MAAM;QACrB,OAAO,IAAIJ,sBAA6B;YACtC,MAAMC,QAAQ,MAAMC,YAAQ,CAACC,IAAI,CAACJ;YAClC,OAAOE,MAAMI,WAAW;QAC1B;QAEA,OAAOC,IAAAA,cAAU,EAACP;IACpB,EAAE,OAAOQ,KAAK;QACZ,IACEC,IAAAA,gBAAO,EAACD,QACPA,CAAAA,IAAIE,IAAI,KAAK,YAAYF,IAAIE,IAAI,KAAK,cAAa,GACpD;YACA,OAAO;QACT;QACA,MAAMF;IACR;AACF"}
|
||||
6
node_modules/next/dist/lib/find-config.d.ts
generated
vendored
Normal file
6
node_modules/next/dist/lib/find-config.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
type RecursivePartial<T> = {
|
||||
[P in keyof T]?: RecursivePartial<T[P]>;
|
||||
};
|
||||
export declare function findConfigPath(dir: string, key: string): Promise<string | undefined>;
|
||||
export declare function findConfig<T>(directory: string, key: string, _returnFile?: boolean): Promise<RecursivePartial<T> | null>;
|
||||
export {};
|
||||
102
node_modules/next/dist/lib/find-config.js
generated
vendored
Normal file
102
node_modules/next/dist/lib/find-config.js
generated
vendored
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
findConfig: null,
|
||||
findConfigPath: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
findConfig: function() {
|
||||
return findConfig;
|
||||
},
|
||||
findConfigPath: function() {
|
||||
return findConfigPath;
|
||||
}
|
||||
});
|
||||
const _findup = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/find-up"));
|
||||
const _promises = require("fs/promises");
|
||||
const _json5 = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/json5"));
|
||||
const _url = require("url");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function findConfigPath(dir, key) {
|
||||
// If we didn't find the configuration in `package.json`, we should look for
|
||||
// known filenames.
|
||||
return (0, _findup.default)([
|
||||
`.${key}rc.json`,
|
||||
`${key}.config.json`,
|
||||
`.${key}rc.js`,
|
||||
`${key}.config.js`,
|
||||
`${key}.config.mjs`,
|
||||
`${key}.config.cjs`
|
||||
], {
|
||||
cwd: dir
|
||||
});
|
||||
}
|
||||
async function findConfig(directory, key, _returnFile) {
|
||||
// `package.json` configuration always wins. Let's check that first.
|
||||
const packageJsonPath = await (0, _findup.default)('package.json', {
|
||||
cwd: directory
|
||||
});
|
||||
let isESM = false;
|
||||
if (packageJsonPath) {
|
||||
try {
|
||||
const packageJsonStr = await (0, _promises.readFile)(packageJsonPath, 'utf8');
|
||||
const packageJson = JSON.parse(packageJsonStr);
|
||||
if (typeof packageJson !== 'object') {
|
||||
throw new Error() // Stop processing and continue
|
||||
;
|
||||
}
|
||||
if (packageJson.type === 'module') {
|
||||
isESM = true;
|
||||
}
|
||||
if (packageJson[key] != null && typeof packageJson[key] === 'object') {
|
||||
return packageJson[key];
|
||||
}
|
||||
} catch {
|
||||
// Ignore error and continue
|
||||
}
|
||||
}
|
||||
const filePath = await findConfigPath(directory, key);
|
||||
const esmImport = (path)=>{
|
||||
// Skip mapping to absolute url with pathToFileURL on windows if it's jest
|
||||
// https://github.com/nodejs/node/issues/31710#issuecomment-587345749
|
||||
if (process.platform === 'win32' && !process.env.JEST_WORKER_ID) {
|
||||
// on windows import("C:\\path\\to\\file") is not valid, so we need to
|
||||
// use file:// URLs
|
||||
return import((0, _url.pathToFileURL)(path).toString());
|
||||
} else {
|
||||
return import(path);
|
||||
}
|
||||
};
|
||||
if (filePath) {
|
||||
if (filePath.endsWith('.js')) {
|
||||
if (isESM) {
|
||||
return (await esmImport(filePath)).default;
|
||||
} else {
|
||||
return require(filePath);
|
||||
}
|
||||
} else if (filePath.endsWith('.mjs')) {
|
||||
return (await esmImport(filePath)).default;
|
||||
} else if (filePath.endsWith('.cjs')) {
|
||||
return require(filePath);
|
||||
}
|
||||
// We load JSON contents with JSON5 to allow users to comment in their
|
||||
// configuration file. This pattern was popularized by TypeScript.
|
||||
const fileContents = await (0, _promises.readFile)(filePath, 'utf8');
|
||||
return _json5.default.parse(fileContents);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=find-config.js.map
|
||||
1
node_modules/next/dist/lib/find-config.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/find-config.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
node_modules/next/dist/lib/find-pages-dir.d.ts
generated
vendored
Normal file
5
node_modules/next/dist/lib/find-pages-dir.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export declare function findDir(dir: string, name: 'pages' | 'app'): string | null;
|
||||
export declare function findPagesDir(dir: string): {
|
||||
pagesDir: string | undefined;
|
||||
appDir: string | undefined;
|
||||
};
|
||||
54
node_modules/next/dist/lib/find-pages-dir.js
generated
vendored
Normal file
54
node_modules/next/dist/lib/find-pages-dir.js
generated
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
findDir: null,
|
||||
findPagesDir: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
findDir: function() {
|
||||
return findDir;
|
||||
},
|
||||
findPagesDir: function() {
|
||||
return findPagesDir;
|
||||
}
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function findDir(dir, name) {
|
||||
// prioritize ./${name} over ./src/${name}
|
||||
let curDir = _path.default.join(dir, name);
|
||||
if (_fs.default.existsSync(curDir)) return curDir;
|
||||
curDir = _path.default.join(dir, 'src', name);
|
||||
if (_fs.default.existsSync(curDir)) return curDir;
|
||||
return null;
|
||||
}
|
||||
function findPagesDir(dir) {
|
||||
const pagesDir = findDir(dir, 'pages') || undefined;
|
||||
const appDir = findDir(dir, 'app') || undefined;
|
||||
if (appDir == null && pagesDir == null) {
|
||||
throw Object.defineProperty(new Error("> Couldn't find any `pages` or `app` directory. Please create one under the project root"), "__NEXT_ERROR_CODE", {
|
||||
value: "E144",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
return {
|
||||
pagesDir,
|
||||
appDir
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=find-pages-dir.js.map
|
||||
1
node_modules/next/dist/lib/find-pages-dir.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/find-pages-dir.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/find-pages-dir.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\n\nexport function findDir(dir: string, name: 'pages' | 'app'): string | null {\n // prioritize ./${name} over ./src/${name}\n let curDir = path.join(dir, name)\n if (fs.existsSync(curDir)) return curDir\n\n curDir = path.join(dir, 'src', name)\n if (fs.existsSync(curDir)) return curDir\n\n return null\n}\n\nexport function findPagesDir(dir: string): {\n pagesDir: string | undefined\n appDir: string | undefined\n} {\n const pagesDir = findDir(dir, 'pages') || undefined\n const appDir = findDir(dir, 'app') || undefined\n\n if (appDir == null && pagesDir == null) {\n throw new Error(\n \"> Couldn't find any `pages` or `app` directory. Please create one under the project root\"\n )\n }\n\n return {\n pagesDir,\n appDir,\n }\n}\n"],"names":["findDir","findPagesDir","dir","name","curDir","path","join","fs","existsSync","pagesDir","undefined","appDir","Error"],"mappings":";;;;;;;;;;;;;;;IAGgBA,OAAO;eAAPA;;IAWAC,YAAY;eAAZA;;;2DAdD;6DACE;;;;;;AAEV,SAASD,QAAQE,GAAW,EAAEC,IAAqB;IACxD,0CAA0C;IAC1C,IAAIC,SAASC,aAAI,CAACC,IAAI,CAACJ,KAAKC;IAC5B,IAAII,WAAE,CAACC,UAAU,CAACJ,SAAS,OAAOA;IAElCA,SAASC,aAAI,CAACC,IAAI,CAACJ,KAAK,OAAOC;IAC/B,IAAII,WAAE,CAACC,UAAU,CAACJ,SAAS,OAAOA;IAElC,OAAO;AACT;AAEO,SAASH,aAAaC,GAAW;IAItC,MAAMO,WAAWT,QAAQE,KAAK,YAAYQ;IAC1C,MAAMC,SAASX,QAAQE,KAAK,UAAUQ;IAEtC,IAAIC,UAAU,QAAQF,YAAY,MAAM;QACtC,MAAM,qBAEL,CAFK,IAAIG,MACR,6FADI,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;IAEA,OAAO;QACLH;QACAE;IACF;AACF"}
|
||||
2
node_modules/next/dist/lib/find-root.d.ts
generated
vendored
Normal file
2
node_modules/next/dist/lib/find-root.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
export declare function findRootLockFile(cwd: string): string | undefined;
|
||||
export declare function findRootDir(cwd: string): string | undefined;
|
||||
46
node_modules/next/dist/lib/find-root.js
generated
vendored
Normal file
46
node_modules/next/dist/lib/find-root.js
generated
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
findRootDir: null,
|
||||
findRootLockFile: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
findRootDir: function() {
|
||||
return findRootDir;
|
||||
},
|
||||
findRootLockFile: function() {
|
||||
return findRootLockFile;
|
||||
}
|
||||
});
|
||||
const _path = require("path");
|
||||
const _findup = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/find-up"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function findRootLockFile(cwd) {
|
||||
return _findup.default.sync([
|
||||
'pnpm-lock.yaml',
|
||||
'package-lock.json',
|
||||
'yarn.lock',
|
||||
'bun.lock',
|
||||
'bun.lockb'
|
||||
], {
|
||||
cwd
|
||||
});
|
||||
}
|
||||
function findRootDir(cwd) {
|
||||
const lockFile = findRootLockFile(cwd);
|
||||
return lockFile ? (0, _path.dirname)(lockFile) : undefined;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=find-root.js.map
|
||||
1
node_modules/next/dist/lib/find-root.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/find-root.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/find-root.ts"],"sourcesContent":["import { dirname } from 'path'\nimport findUp from 'next/dist/compiled/find-up'\n\nexport function findRootLockFile(cwd: string) {\n return findUp.sync(\n [\n 'pnpm-lock.yaml',\n 'package-lock.json',\n 'yarn.lock',\n 'bun.lock',\n 'bun.lockb',\n ],\n {\n cwd,\n }\n )\n}\n\nexport function findRootDir(cwd: string) {\n const lockFile = findRootLockFile(cwd)\n return lockFile ? dirname(lockFile) : undefined\n}\n"],"names":["findRootDir","findRootLockFile","cwd","findUp","sync","lockFile","dirname","undefined"],"mappings":";;;;;;;;;;;;;;;IAkBgBA,WAAW;eAAXA;;IAfAC,gBAAgB;eAAhBA;;;sBAHQ;+DACL;;;;;;AAEZ,SAASA,iBAAiBC,GAAW;IAC1C,OAAOC,eAAM,CAACC,IAAI,CAChB;QACE;QACA;QACA;QACA;QACA;KACD,EACD;QACEF;IACF;AAEJ;AAEO,SAASF,YAAYE,GAAW;IACrC,MAAMG,WAAWJ,iBAAiBC;IAClC,OAAOG,WAAWC,IAAAA,aAAO,EAACD,YAAYE;AACxC"}
|
||||
3
node_modules/next/dist/lib/format-cli-help-output.d.ts
generated
vendored
Normal file
3
node_modules/next/dist/lib/format-cli-help-output.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import type { Command, Help } from 'next/dist/compiled/commander';
|
||||
declare const formatCliHelpOutput: (cmd: Command, helper: Help) => string;
|
||||
export { formatCliHelpOutput };
|
||||
84
node_modules/next/dist/lib/format-cli-help-output.js
generated
vendored
Normal file
84
node_modules/next/dist/lib/format-cli-help-output.js
generated
vendored
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "formatCliHelpOutput", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return formatCliHelpOutput;
|
||||
}
|
||||
});
|
||||
const _picocolors = require("../lib/picocolors");
|
||||
// Copy-pasted from Commander's Help class -> formatHelp().
|
||||
// TL;DR, we're overriding the built-in help to add a few niceties.
|
||||
// Link: https://github.com/tj/commander.js/blob/master/lib/help.js
|
||||
const formatCliHelpOutput = (cmd, helper)=>{
|
||||
const termWidth = helper.padWidth(cmd, helper);
|
||||
const helpWidth = helper.helpWidth || 80;
|
||||
const itemIndentWidth = 2;
|
||||
const itemSeparatorWidth = 2 // between term and description
|
||||
;
|
||||
function formatItem(term, description) {
|
||||
let value = term;
|
||||
if (description) {
|
||||
if (term === 'directory') {
|
||||
value = `[${term}]`;
|
||||
}
|
||||
const fullText = `${value.padEnd(termWidth + itemSeparatorWidth)}${description}`;
|
||||
return helper.wrap(fullText, helpWidth - itemIndentWidth, termWidth + itemSeparatorWidth);
|
||||
}
|
||||
return term;
|
||||
}
|
||||
function formatList(textArray) {
|
||||
return textArray.join('\n').replace(/^/gm, ' '.repeat(itemIndentWidth));
|
||||
}
|
||||
// Usage
|
||||
let output = [
|
||||
`${(0, _picocolors.bold)('Usage:')} ${helper.commandUsage(cmd)}`,
|
||||
''
|
||||
];
|
||||
// Description
|
||||
const commandDescription = helper.commandDescription(cmd);
|
||||
if (commandDescription.length > 0) {
|
||||
output = output.concat([
|
||||
helper.wrap(commandDescription, helpWidth, 0),
|
||||
''
|
||||
]);
|
||||
}
|
||||
// Arguments
|
||||
const argumentList = helper.visibleArguments(cmd).map((argument)=>{
|
||||
return formatItem(helper.argumentTerm(argument), helper.argumentDescription(argument));
|
||||
});
|
||||
if (argumentList.length > 0) {
|
||||
output = output.concat([
|
||||
`${(0, _picocolors.bold)('Arguments:')}`,
|
||||
formatList(argumentList),
|
||||
''
|
||||
]);
|
||||
}
|
||||
// Options
|
||||
const optionList = helper.visibleOptions(cmd).map((option)=>{
|
||||
return formatItem(helper.optionTerm(option), helper.optionDescription(option));
|
||||
});
|
||||
if (optionList.length > 0) {
|
||||
output = output.concat([
|
||||
`${(0, _picocolors.bold)('Options:')}`,
|
||||
formatList(optionList),
|
||||
''
|
||||
]);
|
||||
}
|
||||
// Commands
|
||||
const commandList = helper.visibleCommands(cmd).map((subCmd)=>{
|
||||
return formatItem(helper.subcommandTerm(subCmd), helper.subcommandDescription(subCmd));
|
||||
});
|
||||
if (commandList.length > 0) {
|
||||
output = output.concat([
|
||||
`${(0, _picocolors.bold)('Commands:')}`,
|
||||
formatList(commandList),
|
||||
''
|
||||
]);
|
||||
}
|
||||
return output.join('\n');
|
||||
};
|
||||
|
||||
//# sourceMappingURL=format-cli-help-output.js.map
|
||||
1
node_modules/next/dist/lib/format-cli-help-output.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/format-cli-help-output.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/format-cli-help-output.ts"],"sourcesContent":["import type { Command, Help } from 'next/dist/compiled/commander'\nimport { bold } from '../lib/picocolors'\n\n// Copy-pasted from Commander's Help class -> formatHelp().\n// TL;DR, we're overriding the built-in help to add a few niceties.\n// Link: https://github.com/tj/commander.js/blob/master/lib/help.js\nconst formatCliHelpOutput = (cmd: Command, helper: Help) => {\n const termWidth = helper.padWidth(cmd, helper)\n const helpWidth = helper.helpWidth || 80\n const itemIndentWidth = 2\n const itemSeparatorWidth = 2 // between term and description\n\n function formatItem(term: string, description: string) {\n let value = term\n\n if (description) {\n if (term === 'directory') {\n value = `[${term}]`\n }\n\n const fullText = `${value.padEnd(\n termWidth + itemSeparatorWidth\n )}${description}`\n\n return helper.wrap(\n fullText,\n helpWidth - itemIndentWidth,\n termWidth + itemSeparatorWidth\n )\n }\n\n return term\n }\n\n function formatList(textArray: string[]) {\n return textArray.join('\\n').replace(/^/gm, ' '.repeat(itemIndentWidth))\n }\n\n // Usage\n let output = [`${bold('Usage:')} ${helper.commandUsage(cmd)}`, '']\n\n // Description\n const commandDescription = helper.commandDescription(cmd)\n\n if (commandDescription.length > 0) {\n output = output.concat([helper.wrap(commandDescription, helpWidth, 0), ''])\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return formatItem(\n helper.argumentTerm(argument),\n helper.argumentDescription(argument)\n )\n })\n\n if (argumentList.length > 0) {\n output = output.concat([\n `${bold('Arguments:')}`,\n formatList(argumentList),\n '',\n ])\n }\n\n // Options\n const optionList = helper.visibleOptions(cmd).map((option) => {\n return formatItem(\n helper.optionTerm(option),\n helper.optionDescription(option)\n )\n })\n\n if (optionList.length > 0) {\n output = output.concat([`${bold('Options:')}`, formatList(optionList), ''])\n }\n\n // Commands\n const commandList = helper.visibleCommands(cmd).map((subCmd) => {\n return formatItem(\n helper.subcommandTerm(subCmd),\n helper.subcommandDescription(subCmd)\n )\n })\n\n if (commandList.length > 0) {\n output = output.concat([\n `${bold('Commands:')}`,\n formatList(commandList),\n '',\n ])\n }\n\n return output.join('\\n')\n}\n\nexport { formatCliHelpOutput }\n"],"names":["formatCliHelpOutput","cmd","helper","termWidth","padWidth","helpWidth","itemIndentWidth","itemSeparatorWidth","formatItem","term","description","value","fullText","padEnd","wrap","formatList","textArray","join","replace","repeat","output","bold","commandUsage","commandDescription","length","concat","argumentList","visibleArguments","map","argument","argumentTerm","argumentDescription","optionList","visibleOptions","option","optionTerm","optionDescription","commandList","visibleCommands","subCmd","subcommandTerm","subcommandDescription"],"mappings":";;;;+BA+FSA;;;eAAAA;;;4BA9FY;AAErB,2DAA2D;AAC3D,mEAAmE;AACnE,mEAAmE;AACnE,MAAMA,sBAAsB,CAACC,KAAcC;IACzC,MAAMC,YAAYD,OAAOE,QAAQ,CAACH,KAAKC;IACvC,MAAMG,YAAYH,OAAOG,SAAS,IAAI;IACtC,MAAMC,kBAAkB;IACxB,MAAMC,qBAAqB,EAAE,+BAA+B;;IAE5D,SAASC,WAAWC,IAAY,EAAEC,WAAmB;QACnD,IAAIC,QAAQF;QAEZ,IAAIC,aAAa;YACf,IAAID,SAAS,aAAa;gBACxBE,QAAQ,CAAC,CAAC,EAAEF,KAAK,CAAC,CAAC;YACrB;YAEA,MAAMG,WAAW,GAAGD,MAAME,MAAM,CAC9BV,YAAYI,sBACVG,aAAa;YAEjB,OAAOR,OAAOY,IAAI,CAChBF,UACAP,YAAYC,iBACZH,YAAYI;QAEhB;QAEA,OAAOE;IACT;IAEA,SAASM,WAAWC,SAAmB;QACrC,OAAOA,UAAUC,IAAI,CAAC,MAAMC,OAAO,CAAC,OAAO,IAAIC,MAAM,CAACb;IACxD;IAEA,QAAQ;IACR,IAAIc,SAAS;QAAC,GAAGC,IAAAA,gBAAI,EAAC,UAAU,CAAC,EAAEnB,OAAOoB,YAAY,CAACrB,MAAM;QAAE;KAAG;IAElE,cAAc;IACd,MAAMsB,qBAAqBrB,OAAOqB,kBAAkB,CAACtB;IAErD,IAAIsB,mBAAmBC,MAAM,GAAG,GAAG;QACjCJ,SAASA,OAAOK,MAAM,CAAC;YAACvB,OAAOY,IAAI,CAACS,oBAAoBlB,WAAW;YAAI;SAAG;IAC5E;IAEA,YAAY;IACZ,MAAMqB,eAAexB,OAAOyB,gBAAgB,CAAC1B,KAAK2B,GAAG,CAAC,CAACC;QACrD,OAAOrB,WACLN,OAAO4B,YAAY,CAACD,WACpB3B,OAAO6B,mBAAmB,CAACF;IAE/B;IAEA,IAAIH,aAAaF,MAAM,GAAG,GAAG;QAC3BJ,SAASA,OAAOK,MAAM,CAAC;YACrB,GAAGJ,IAAAA,gBAAI,EAAC,eAAe;YACvBN,WAAWW;YACX;SACD;IACH;IAEA,UAAU;IACV,MAAMM,aAAa9B,OAAO+B,cAAc,CAAChC,KAAK2B,GAAG,CAAC,CAACM;QACjD,OAAO1B,WACLN,OAAOiC,UAAU,CAACD,SAClBhC,OAAOkC,iBAAiB,CAACF;IAE7B;IAEA,IAAIF,WAAWR,MAAM,GAAG,GAAG;QACzBJ,SAASA,OAAOK,MAAM,CAAC;YAAC,GAAGJ,IAAAA,gBAAI,EAAC,aAAa;YAAEN,WAAWiB;YAAa;SAAG;IAC5E;IAEA,WAAW;IACX,MAAMK,cAAcnC,OAAOoC,eAAe,CAACrC,KAAK2B,GAAG,CAAC,CAACW;QACnD,OAAO/B,WACLN,OAAOsC,cAAc,CAACD,SACtBrC,OAAOuC,qBAAqB,CAACF;IAEjC;IAEA,IAAIF,YAAYb,MAAM,GAAG,GAAG;QAC1BJ,SAASA,OAAOK,MAAM,CAAC;YACrB,GAAGJ,IAAAA,gBAAI,EAAC,cAAc;YACtBN,WAAWsB;YACX;SACD;IACH;IAEA,OAAOjB,OAAOH,IAAI,CAAC;AACrB"}
|
||||
9
node_modules/next/dist/lib/format-dynamic-import-path.d.ts
generated
vendored
Normal file
9
node_modules/next/dist/lib/format-dynamic-import-path.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* The path for a dynamic route must be URLs with a valid scheme.
|
||||
*
|
||||
* When an absolute Windows path is passed to it, it interprets the beginning of the path as a protocol (`C:`).
|
||||
* Therefore, it is important to always construct a complete path.
|
||||
* @param dir File directory
|
||||
* @param filePath Absolute or relative path
|
||||
*/
|
||||
export declare const formatDynamicImportPath: (dir: string, filePath: string) => string;
|
||||
24
node_modules/next/dist/lib/format-dynamic-import-path.js
generated
vendored
Normal file
24
node_modules/next/dist/lib/format-dynamic-import-path.js
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "formatDynamicImportPath", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return formatDynamicImportPath;
|
||||
}
|
||||
});
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _url = require("url");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
const formatDynamicImportPath = (dir, filePath)=>{
|
||||
const absoluteFilePath = _path.default.isAbsolute(filePath) ? filePath : _path.default.join(dir, filePath);
|
||||
const formattedFilePath = (0, _url.pathToFileURL)(absoluteFilePath).toString();
|
||||
return formattedFilePath;
|
||||
};
|
||||
|
||||
//# sourceMappingURL=format-dynamic-import-path.js.map
|
||||
1
node_modules/next/dist/lib/format-dynamic-import-path.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/format-dynamic-import-path.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/format-dynamic-import-path.ts"],"sourcesContent":["import path from 'path'\nimport { pathToFileURL } from 'url'\n\n/**\n * The path for a dynamic route must be URLs with a valid scheme.\n *\n * When an absolute Windows path is passed to it, it interprets the beginning of the path as a protocol (`C:`).\n * Therefore, it is important to always construct a complete path.\n * @param dir File directory\n * @param filePath Absolute or relative path\n */\nexport const formatDynamicImportPath = (dir: string, filePath: string) => {\n const absoluteFilePath = path.isAbsolute(filePath)\n ? filePath\n : path.join(dir, filePath)\n const formattedFilePath = pathToFileURL(absoluteFilePath).toString()\n\n return formattedFilePath\n}\n"],"names":["formatDynamicImportPath","dir","filePath","absoluteFilePath","path","isAbsolute","join","formattedFilePath","pathToFileURL","toString"],"mappings":";;;;+BAWaA;;;eAAAA;;;6DAXI;qBACa;;;;;;AAUvB,MAAMA,0BAA0B,CAACC,KAAaC;IACnD,MAAMC,mBAAmBC,aAAI,CAACC,UAAU,CAACH,YACrCA,WACAE,aAAI,CAACE,IAAI,CAACL,KAAKC;IACnB,MAAMK,oBAAoBC,IAAAA,kBAAa,EAACL,kBAAkBM,QAAQ;IAElE,OAAOF;AACT"}
|
||||
12
node_modules/next/dist/lib/format-server-error.d.ts
generated
vendored
Normal file
12
node_modules/next/dist/lib/format-server-error.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* Input:
|
||||
* Error: Something went wrong
|
||||
at funcName (/path/to/file.js:10:5)
|
||||
at anotherFunc (/path/to/file.js:15:10)
|
||||
|
||||
* Output:
|
||||
at funcName (/path/to/file.js:10:5)
|
||||
at anotherFunc (/path/to/file.js:15:10)
|
||||
*/
|
||||
export declare function getStackWithoutErrorMessage(error: Error): string;
|
||||
export declare function formatServerError(error: Error): void;
|
||||
74
node_modules/next/dist/lib/format-server-error.js
generated
vendored
Normal file
74
node_modules/next/dist/lib/format-server-error.js
generated
vendored
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
formatServerError: null,
|
||||
getStackWithoutErrorMessage: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
formatServerError: function() {
|
||||
return formatServerError;
|
||||
},
|
||||
getStackWithoutErrorMessage: function() {
|
||||
return getStackWithoutErrorMessage;
|
||||
}
|
||||
});
|
||||
const invalidServerComponentReactHooks = [
|
||||
'useDeferredValue',
|
||||
'useEffect',
|
||||
'useImperativeHandle',
|
||||
'useInsertionEffect',
|
||||
'useLayoutEffect',
|
||||
'useReducer',
|
||||
'useRef',
|
||||
'useState',
|
||||
'useSyncExternalStore',
|
||||
'useTransition',
|
||||
'experimental_useOptimistic',
|
||||
'useOptimistic'
|
||||
];
|
||||
function setMessage(error, message) {
|
||||
error.message = message;
|
||||
if (error.stack) {
|
||||
const lines = error.stack.split('\n');
|
||||
lines[0] = message;
|
||||
error.stack = lines.join('\n');
|
||||
}
|
||||
}
|
||||
function getStackWithoutErrorMessage(error) {
|
||||
const stack = error.stack;
|
||||
if (!stack) return '';
|
||||
return stack.replace(/^[^\n]*\n/, '');
|
||||
}
|
||||
function formatServerError(error) {
|
||||
if (typeof (error == null ? void 0 : error.message) !== 'string') return;
|
||||
if (error.message.includes('Class extends value undefined is not a constructor or null')) {
|
||||
const addedMessage = 'This might be caused by a React Class Component being rendered in a Server Component, React Class Components only works in Client Components. Read more: https://nextjs.org/docs/messages/class-component-in-server-component';
|
||||
// If this error instance already has the message, don't add it again
|
||||
if (error.message.includes(addedMessage)) return;
|
||||
setMessage(error, `${error.message}
|
||||
|
||||
${addedMessage}`);
|
||||
return;
|
||||
}
|
||||
if (error.message.includes('createContext is not a function')) {
|
||||
setMessage(error, 'createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/context-in-server-component');
|
||||
return;
|
||||
}
|
||||
for (const clientHook of invalidServerComponentReactHooks){
|
||||
const regex = new RegExp(`\\b${clientHook}\\b.*is not a function`);
|
||||
if (regex.test(error.message)) {
|
||||
setMessage(error, `${clientHook} only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/react-client-hook-in-server-component`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=format-server-error.js.map
|
||||
1
node_modules/next/dist/lib/format-server-error.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/format-server-error.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/format-server-error.ts"],"sourcesContent":["const invalidServerComponentReactHooks = [\n 'useDeferredValue',\n 'useEffect',\n 'useImperativeHandle',\n 'useInsertionEffect',\n 'useLayoutEffect',\n 'useReducer',\n 'useRef',\n 'useState',\n 'useSyncExternalStore',\n 'useTransition',\n 'experimental_useOptimistic',\n 'useOptimistic',\n]\n\nfunction setMessage(error: Error, message: string): void {\n error.message = message\n if (error.stack) {\n const lines = error.stack.split('\\n')\n lines[0] = message\n error.stack = lines.join('\\n')\n }\n}\n\n/**\n * Input:\n * Error: Something went wrong\n at funcName (/path/to/file.js:10:5)\n at anotherFunc (/path/to/file.js:15:10)\n \n * Output:\n at funcName (/path/to/file.js:10:5)\n at anotherFunc (/path/to/file.js:15:10) \n */\nexport function getStackWithoutErrorMessage(error: Error): string {\n const stack = error.stack\n if (!stack) return ''\n return stack.replace(/^[^\\n]*\\n/, '')\n}\n\nexport function formatServerError(error: Error): void {\n if (typeof error?.message !== 'string') return\n\n if (\n error.message.includes(\n 'Class extends value undefined is not a constructor or null'\n )\n ) {\n const addedMessage =\n 'This might be caused by a React Class Component being rendered in a Server Component, React Class Components only works in Client Components. Read more: https://nextjs.org/docs/messages/class-component-in-server-component'\n\n // If this error instance already has the message, don't add it again\n if (error.message.includes(addedMessage)) return\n\n setMessage(\n error,\n `${error.message}\n\n${addedMessage}`\n )\n return\n }\n\n if (error.message.includes('createContext is not a function')) {\n setMessage(\n error,\n 'createContext only works in Client Components. Add the \"use client\" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/context-in-server-component'\n )\n return\n }\n\n for (const clientHook of invalidServerComponentReactHooks) {\n const regex = new RegExp(`\\\\b${clientHook}\\\\b.*is not a function`)\n if (regex.test(error.message)) {\n setMessage(\n error,\n `${clientHook} only works in Client Components. Add the \"use client\" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/react-client-hook-in-server-component`\n )\n return\n }\n }\n}\n"],"names":["formatServerError","getStackWithoutErrorMessage","invalidServerComponentReactHooks","setMessage","error","message","stack","lines","split","join","replace","includes","addedMessage","clientHook","regex","RegExp","test"],"mappings":";;;;;;;;;;;;;;;IAwCgBA,iBAAiB;eAAjBA;;IANAC,2BAA2B;eAA3BA;;;AAlChB,MAAMC,mCAAmC;IACvC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,SAASC,WAAWC,KAAY,EAAEC,OAAe;IAC/CD,MAAMC,OAAO,GAAGA;IAChB,IAAID,MAAME,KAAK,EAAE;QACf,MAAMC,QAAQH,MAAME,KAAK,CAACE,KAAK,CAAC;QAChCD,KAAK,CAAC,EAAE,GAAGF;QACXD,MAAME,KAAK,GAAGC,MAAME,IAAI,CAAC;IAC3B;AACF;AAYO,SAASR,4BAA4BG,KAAY;IACtD,MAAME,QAAQF,MAAME,KAAK;IACzB,IAAI,CAACA,OAAO,OAAO;IACnB,OAAOA,MAAMI,OAAO,CAAC,aAAa;AACpC;AAEO,SAASV,kBAAkBI,KAAY;IAC5C,IAAI,QAAOA,yBAAAA,MAAOC,OAAO,MAAK,UAAU;IAExC,IACED,MAAMC,OAAO,CAACM,QAAQ,CACpB,+DAEF;QACA,MAAMC,eACJ;QAEF,qEAAqE;QACrE,IAAIR,MAAMC,OAAO,CAACM,QAAQ,CAACC,eAAe;QAE1CT,WACEC,OACA,GAAGA,MAAMC,OAAO,CAAC;;AAEvB,EAAEO,cAAc;QAEZ;IACF;IAEA,IAAIR,MAAMC,OAAO,CAACM,QAAQ,CAAC,oCAAoC;QAC7DR,WACEC,OACA;QAEF;IACF;IAEA,KAAK,MAAMS,cAAcX,iCAAkC;QACzD,MAAMY,QAAQ,IAAIC,OAAO,CAAC,GAAG,EAAEF,WAAW,sBAAsB,CAAC;QACjE,IAAIC,MAAME,IAAI,CAACZ,MAAMC,OAAO,GAAG;YAC7BF,WACEC,OACA,GAAGS,WAAW,oLAAoL,CAAC;YAErM;QACF;IACF;AACF"}
|
||||
6
node_modules/next/dist/lib/fs/rename.d.ts
generated
vendored
Normal file
6
node_modules/next/dist/lib/fs/rename.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
/**
|
||||
* A drop-in replacement for `fs.rename` that:
|
||||
* - allows to move across multiple disks
|
||||
* - attempts to retry the operation for certain error codes on Windows
|
||||
*/
|
||||
export declare function rename(source: string, target: string, windowsRetryTimeout?: number | false): Promise<void>;
|
||||
86
node_modules/next/dist/lib/fs/rename.js
generated
vendored
Normal file
86
node_modules/next/dist/lib/fs/rename.js
generated
vendored
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2015 - present Microsoft Corporation
|
||||
|
||||
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
|
||||
SOFTWARE.
|
||||
*/ // This file is based on https://github.com/microsoft/vscode/blob/f860fcf11022f10a992440fd54c6e45674e39617/src/vs/base/node/pfs.ts
|
||||
// See the LICENSE at the top of the file
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "rename", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return rename;
|
||||
}
|
||||
});
|
||||
const _promises = require("node:fs/promises");
|
||||
async function rename(source, target, windowsRetryTimeout = 60000 /* matches graceful-fs */ ) {
|
||||
if (source === target) {
|
||||
return; // simulate node.js behaviour here and do a no-op if paths match
|
||||
}
|
||||
if (process.platform === 'win32' && typeof windowsRetryTimeout === 'number') {
|
||||
// On Windows, a rename can fail when either source or target
|
||||
// is locked by AV software. We do leverage graceful-fs to iron
|
||||
// out these issues, however in case the target file exists,
|
||||
// graceful-fs will immediately return without retry for fs.rename().
|
||||
await renameWithRetry(source, target, Date.now(), windowsRetryTimeout);
|
||||
} else {
|
||||
await (0, _promises.rename)(source, target);
|
||||
}
|
||||
}
|
||||
async function renameWithRetry(source, target, startTime, retryTimeout, attempt = 0) {
|
||||
try {
|
||||
return await (0, _promises.rename)(source, target);
|
||||
} catch (error) {
|
||||
if (error.code !== 'EACCES' && error.code !== 'EPERM' && error.code !== 'EBUSY') {
|
||||
throw error // only for errors we think are temporary
|
||||
;
|
||||
}
|
||||
if (Date.now() - startTime >= retryTimeout) {
|
||||
console.error(`[node.js fs] rename failed after ${attempt} retries with error: ${error}`);
|
||||
throw error // give up after configurable timeout
|
||||
;
|
||||
}
|
||||
if (attempt === 0) {
|
||||
let abortRetry = false;
|
||||
try {
|
||||
const statTarget = await (0, _promises.stat)(target);
|
||||
if (!statTarget.isFile()) {
|
||||
abortRetry = true // if target is not a file, EPERM error may be raised and we should not attempt to retry
|
||||
;
|
||||
}
|
||||
} catch (e) {
|
||||
// Ignore
|
||||
}
|
||||
if (abortRetry) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
// Delay with incremental backoff up to 100ms
|
||||
await timeout(Math.min(100, attempt * 10));
|
||||
// Attempt again
|
||||
return renameWithRetry(source, target, startTime, retryTimeout, attempt + 1);
|
||||
}
|
||||
}
|
||||
const timeout = (millis)=>new Promise((resolve)=>setTimeout(resolve, millis));
|
||||
|
||||
//# sourceMappingURL=rename.js.map
|
||||
1
node_modules/next/dist/lib/fs/rename.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/fs/rename.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/next/dist/lib/fs/write-atomic.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/lib/fs/write-atomic.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export declare function writeFileAtomic(filePath: string, content: string): Promise<void>;
|
||||
28
node_modules/next/dist/lib/fs/write-atomic.js
generated
vendored
Normal file
28
node_modules/next/dist/lib/fs/write-atomic.js
generated
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "writeFileAtomic", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return writeFileAtomic;
|
||||
}
|
||||
});
|
||||
const _promises = require("fs/promises");
|
||||
const _rename = require("./rename");
|
||||
async function writeFileAtomic(filePath, content) {
|
||||
const tempPath = filePath + '.tmp.' + Math.random().toString(36).slice(2);
|
||||
try {
|
||||
await (0, _promises.writeFile)(tempPath, content, 'utf-8');
|
||||
await (0, _rename.rename)(tempPath, filePath);
|
||||
} catch (e) {
|
||||
try {
|
||||
await (0, _promises.unlink)(tempPath);
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=write-atomic.js.map
|
||||
1
node_modules/next/dist/lib/fs/write-atomic.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/fs/write-atomic.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../../src/lib/fs/write-atomic.ts"],"sourcesContent":["import { unlink, writeFile } from 'fs/promises'\nimport { rename } from './rename'\n\nexport async function writeFileAtomic(\n filePath: string,\n content: string\n): Promise<void> {\n const tempPath = filePath + '.tmp.' + Math.random().toString(36).slice(2)\n try {\n await writeFile(tempPath, content, 'utf-8')\n await rename(tempPath, filePath)\n } catch (e) {\n try {\n await unlink(tempPath)\n } catch {\n // ignore\n }\n throw e\n }\n}\n"],"names":["writeFileAtomic","filePath","content","tempPath","Math","random","toString","slice","writeFile","rename","e","unlink"],"mappings":";;;;+BAGsBA;;;eAAAA;;;0BAHY;wBACX;AAEhB,eAAeA,gBACpBC,QAAgB,EAChBC,OAAe;IAEf,MAAMC,WAAWF,WAAW,UAAUG,KAAKC,MAAM,GAAGC,QAAQ,CAAC,IAAIC,KAAK,CAAC;IACvE,IAAI;QACF,MAAMC,IAAAA,mBAAS,EAACL,UAAUD,SAAS;QACnC,MAAMO,IAAAA,cAAM,EAACN,UAAUF;IACzB,EAAE,OAAOS,GAAG;QACV,IAAI;YACF,MAAMC,IAAAA,gBAAM,EAACR;QACf,EAAE,OAAM;QACN,SAAS;QACX;QACA,MAAMO;IACR;AACF"}
|
||||
3
node_modules/next/dist/lib/generate-interception-routes-rewrites.d.ts
generated
vendored
Normal file
3
node_modules/next/dist/lib/generate-interception-routes-rewrites.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import type { Rewrite } from './load-custom-routes';
|
||||
export declare function generateInterceptionRoutesRewrites(appPaths: string[], basePath?: string): Rewrite[];
|
||||
export declare function isInterceptionRouteRewrite(route: Rewrite): boolean;
|
||||
71
node_modules/next/dist/lib/generate-interception-routes-rewrites.js
generated
vendored
Normal file
71
node_modules/next/dist/lib/generate-interception-routes-rewrites.js
generated
vendored
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
generateInterceptionRoutesRewrites: null,
|
||||
isInterceptionRouteRewrite: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
generateInterceptionRoutesRewrites: function() {
|
||||
return generateInterceptionRoutesRewrites;
|
||||
},
|
||||
isInterceptionRouteRewrite: function() {
|
||||
return isInterceptionRouteRewrite;
|
||||
}
|
||||
});
|
||||
const _pathtoregexp = require("next/dist/compiled/path-to-regexp");
|
||||
const _approuterheaders = require("../client/components/app-router-headers");
|
||||
const _interceptionroutes = require("../shared/lib/router/utils/interception-routes");
|
||||
// a function that converts normalised paths (e.g. /foo/[bar]/[baz]) to the format expected by pathToRegexp (e.g. /foo/:bar/:baz)
|
||||
function toPathToRegexpPath(path) {
|
||||
return path.replace(/\[\[?([^\]]+)\]\]?/g, (_, capture)=>{
|
||||
// path-to-regexp only supports word characters, so we replace any non-word characters with underscores
|
||||
const paramName = capture.replace(/\W+/g, '_');
|
||||
// handle catch-all segments (e.g. /foo/bar/[...baz] or /foo/bar/[[...baz]])
|
||||
if (capture.startsWith('...')) {
|
||||
return `:${capture.slice(3)}*`;
|
||||
}
|
||||
return ':' + paramName;
|
||||
});
|
||||
}
|
||||
function generateInterceptionRoutesRewrites(appPaths, basePath = '') {
|
||||
const rewrites = [];
|
||||
for (const appPath of appPaths){
|
||||
if ((0, _interceptionroutes.isInterceptionRouteAppPath)(appPath)) {
|
||||
const { interceptingRoute, interceptedRoute } = (0, _interceptionroutes.extractInterceptionRouteInformation)(appPath);
|
||||
const normalizedInterceptingRoute = `${interceptingRoute !== '/' ? toPathToRegexpPath(interceptingRoute) : ''}/(.*)?`;
|
||||
const normalizedInterceptedRoute = toPathToRegexpPath(interceptedRoute);
|
||||
const normalizedAppPath = toPathToRegexpPath(appPath);
|
||||
// pathToRegexp returns a regex that matches the path, but we need to
|
||||
// convert it to a string that can be used in a header value
|
||||
// to the format that Next/the proxy expects
|
||||
let interceptingRouteRegex = (0, _pathtoregexp.pathToRegexp)(normalizedInterceptingRoute).toString().slice(2, -3);
|
||||
rewrites.push({
|
||||
source: `${basePath}${normalizedInterceptedRoute}`,
|
||||
destination: `${basePath}${normalizedAppPath}`,
|
||||
has: [
|
||||
{
|
||||
type: 'header',
|
||||
key: _approuterheaders.NEXT_URL,
|
||||
value: interceptingRouteRegex
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
return rewrites;
|
||||
}
|
||||
function isInterceptionRouteRewrite(route) {
|
||||
var _route_has_, _route_has;
|
||||
// When we generate interception rewrites in the above implementation, we always do so with only a single `has` condition.
|
||||
return ((_route_has = route.has) == null ? void 0 : (_route_has_ = _route_has[0]) == null ? void 0 : _route_has_.key) === _approuterheaders.NEXT_URL;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=generate-interception-routes-rewrites.js.map
|
||||
1
node_modules/next/dist/lib/generate-interception-routes-rewrites.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/generate-interception-routes-rewrites.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/generate-interception-routes-rewrites.ts"],"sourcesContent":["import { pathToRegexp } from 'next/dist/compiled/path-to-regexp'\nimport { NEXT_URL } from '../client/components/app-router-headers'\nimport {\n extractInterceptionRouteInformation,\n isInterceptionRouteAppPath,\n} from '../shared/lib/router/utils/interception-routes'\nimport type { Rewrite } from './load-custom-routes'\n\n// a function that converts normalised paths (e.g. /foo/[bar]/[baz]) to the format expected by pathToRegexp (e.g. /foo/:bar/:baz)\nfunction toPathToRegexpPath(path: string): string {\n return path.replace(/\\[\\[?([^\\]]+)\\]\\]?/g, (_, capture) => {\n // path-to-regexp only supports word characters, so we replace any non-word characters with underscores\n const paramName = capture.replace(/\\W+/g, '_')\n\n // handle catch-all segments (e.g. /foo/bar/[...baz] or /foo/bar/[[...baz]])\n if (capture.startsWith('...')) {\n return `:${capture.slice(3)}*`\n }\n return ':' + paramName\n })\n}\n\nexport function generateInterceptionRoutesRewrites(\n appPaths: string[],\n basePath = ''\n): Rewrite[] {\n const rewrites: Rewrite[] = []\n\n for (const appPath of appPaths) {\n if (isInterceptionRouteAppPath(appPath)) {\n const { interceptingRoute, interceptedRoute } =\n extractInterceptionRouteInformation(appPath)\n\n const normalizedInterceptingRoute = `${\n interceptingRoute !== '/' ? toPathToRegexpPath(interceptingRoute) : ''\n }/(.*)?`\n\n const normalizedInterceptedRoute = toPathToRegexpPath(interceptedRoute)\n const normalizedAppPath = toPathToRegexpPath(appPath)\n\n // pathToRegexp returns a regex that matches the path, but we need to\n // convert it to a string that can be used in a header value\n // to the format that Next/the proxy expects\n let interceptingRouteRegex = pathToRegexp(normalizedInterceptingRoute)\n .toString()\n .slice(2, -3)\n\n rewrites.push({\n source: `${basePath}${normalizedInterceptedRoute}`,\n destination: `${basePath}${normalizedAppPath}`,\n has: [\n {\n type: 'header',\n key: NEXT_URL,\n value: interceptingRouteRegex,\n },\n ],\n })\n }\n }\n\n return rewrites\n}\n\nexport function isInterceptionRouteRewrite(route: Rewrite) {\n // When we generate interception rewrites in the above implementation, we always do so with only a single `has` condition.\n return route.has?.[0]?.key === NEXT_URL\n}\n"],"names":["generateInterceptionRoutesRewrites","isInterceptionRouteRewrite","toPathToRegexpPath","path","replace","_","capture","paramName","startsWith","slice","appPaths","basePath","rewrites","appPath","isInterceptionRouteAppPath","interceptingRoute","interceptedRoute","extractInterceptionRouteInformation","normalizedInterceptingRoute","normalizedInterceptedRoute","normalizedAppPath","interceptingRouteRegex","pathToRegexp","toString","push","source","destination","has","type","key","NEXT_URL","value","route"],"mappings":";;;;;;;;;;;;;;;IAsBgBA,kCAAkC;eAAlCA;;IA0CAC,0BAA0B;eAA1BA;;;8BAhEa;kCACJ;oCAIlB;AAGP,iIAAiI;AACjI,SAASC,mBAAmBC,IAAY;IACtC,OAAOA,KAAKC,OAAO,CAAC,uBAAuB,CAACC,GAAGC;QAC7C,uGAAuG;QACvG,MAAMC,YAAYD,QAAQF,OAAO,CAAC,QAAQ;QAE1C,4EAA4E;QAC5E,IAAIE,QAAQE,UAAU,CAAC,QAAQ;YAC7B,OAAO,CAAC,CAAC,EAAEF,QAAQG,KAAK,CAAC,GAAG,CAAC,CAAC;QAChC;QACA,OAAO,MAAMF;IACf;AACF;AAEO,SAASP,mCACdU,QAAkB,EAClBC,WAAW,EAAE;IAEb,MAAMC,WAAsB,EAAE;IAE9B,KAAK,MAAMC,WAAWH,SAAU;QAC9B,IAAII,IAAAA,8CAA0B,EAACD,UAAU;YACvC,MAAM,EAAEE,iBAAiB,EAAEC,gBAAgB,EAAE,GAC3CC,IAAAA,uDAAmC,EAACJ;YAEtC,MAAMK,8BAA8B,GAClCH,sBAAsB,MAAMb,mBAAmBa,qBAAqB,GACrE,MAAM,CAAC;YAER,MAAMI,6BAA6BjB,mBAAmBc;YACtD,MAAMI,oBAAoBlB,mBAAmBW;YAE7C,qEAAqE;YACrE,4DAA4D;YAC5D,4CAA4C;YAC5C,IAAIQ,yBAAyBC,IAAAA,0BAAY,EAACJ,6BACvCK,QAAQ,GACRd,KAAK,CAAC,GAAG,CAAC;YAEbG,SAASY,IAAI,CAAC;gBACZC,QAAQ,GAAGd,WAAWQ,4BAA4B;gBAClDO,aAAa,GAAGf,WAAWS,mBAAmB;gBAC9CO,KAAK;oBACH;wBACEC,MAAM;wBACNC,KAAKC,0BAAQ;wBACbC,OAAOV;oBACT;iBACD;YACH;QACF;IACF;IAEA,OAAOT;AACT;AAEO,SAASX,2BAA2B+B,KAAc;QAEhDA,aAAAA;IADP,0HAA0H;IAC1H,OAAOA,EAAAA,aAAAA,MAAML,GAAG,sBAATK,cAAAA,UAAW,CAAC,EAAE,qBAAdA,YAAgBH,GAAG,MAAKC,0BAAQ;AACzC"}
|
||||
1
node_modules/next/dist/lib/get-files-in-dir.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/lib/get-files-in-dir.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export declare function getFilesInDir(path: string): Promise<Set<string>>;
|
||||
33
node_modules/next/dist/lib/get-files-in-dir.js
generated
vendored
Normal file
33
node_modules/next/dist/lib/get-files-in-dir.js
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "getFilesInDir", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return getFilesInDir;
|
||||
}
|
||||
});
|
||||
const _path = require("path");
|
||||
const _promises = /*#__PURE__*/ _interop_require_default(require("fs/promises"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
async function getFilesInDir(path) {
|
||||
const dir = await _promises.default.opendir(path);
|
||||
const results = new Set();
|
||||
for await (const file of dir){
|
||||
let resolvedFile = file;
|
||||
if (file.isSymbolicLink()) {
|
||||
resolvedFile = await _promises.default.stat((0, _path.join)(path, file.name));
|
||||
}
|
||||
if (resolvedFile.isFile()) {
|
||||
results.add(file.name);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=get-files-in-dir.js.map
|
||||
1
node_modules/next/dist/lib/get-files-in-dir.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/get-files-in-dir.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/get-files-in-dir.ts"],"sourcesContent":["import { join } from 'path'\nimport fs from 'fs/promises'\nimport type { Dirent, StatsBase } from 'fs'\n\nexport async function getFilesInDir(path: string): Promise<Set<string>> {\n const dir = await fs.opendir(path)\n const results = new Set<string>()\n\n for await (const file of dir) {\n let resolvedFile: Dirent | StatsBase<number> = file\n\n if (file.isSymbolicLink()) {\n resolvedFile = await fs.stat(join(path, file.name))\n }\n\n if (resolvedFile.isFile()) {\n results.add(file.name)\n }\n }\n\n return results\n}\n"],"names":["getFilesInDir","path","dir","fs","opendir","results","Set","file","resolvedFile","isSymbolicLink","stat","join","name","isFile","add"],"mappings":";;;;+BAIsBA;;;eAAAA;;;sBAJD;iEACN;;;;;;AAGR,eAAeA,cAAcC,IAAY;IAC9C,MAAMC,MAAM,MAAMC,iBAAE,CAACC,OAAO,CAACH;IAC7B,MAAMI,UAAU,IAAIC;IAEpB,WAAW,MAAMC,QAAQL,IAAK;QAC5B,IAAIM,eAA2CD;QAE/C,IAAIA,KAAKE,cAAc,IAAI;YACzBD,eAAe,MAAML,iBAAE,CAACO,IAAI,CAACC,IAAAA,UAAI,EAACV,MAAMM,KAAKK,IAAI;QACnD;QAEA,IAAIJ,aAAaK,MAAM,IAAI;YACzBR,QAAQS,GAAG,CAACP,KAAKK,IAAI;QACvB;IACF;IAEA,OAAOP;AACT"}
|
||||
1
node_modules/next/dist/lib/get-network-host.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/lib/get-network-host.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export declare function getNetworkHost(family: 'IPv4' | 'IPv6'): string | null;
|
||||
44
node_modules/next/dist/lib/get-network-host.js
generated
vendored
Normal file
44
node_modules/next/dist/lib/get-network-host.js
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "getNetworkHost", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return getNetworkHost;
|
||||
}
|
||||
});
|
||||
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function getNetworkHosts(family) {
|
||||
const interfaces = _os.default.networkInterfaces();
|
||||
const hosts = [];
|
||||
Object.keys(interfaces).forEach((key)=>{
|
||||
var _interfaces_key;
|
||||
(_interfaces_key = interfaces[key]) == null ? void 0 : _interfaces_key.filter((networkInterface)=>{
|
||||
switch(networkInterface.family){
|
||||
case 'IPv6':
|
||||
return family === 'IPv6' && networkInterface.scopeid === 0 && networkInterface.address !== '::1';
|
||||
case 'IPv4':
|
||||
return family === 'IPv4' && networkInterface.address !== '127.0.0.1';
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}).forEach((networkInterface)=>{
|
||||
if (networkInterface.address) {
|
||||
hosts.push(networkInterface.address);
|
||||
}
|
||||
});
|
||||
});
|
||||
return hosts;
|
||||
}
|
||||
function getNetworkHost(family) {
|
||||
const hosts = getNetworkHosts(family);
|
||||
return hosts[0] ?? null;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=get-network-host.js.map
|
||||
1
node_modules/next/dist/lib/get-network-host.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/get-network-host.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/get-network-host.ts"],"sourcesContent":["import os from 'os'\n\nfunction getNetworkHosts(family: 'IPv4' | 'IPv6'): string[] {\n const interfaces = os.networkInterfaces()\n const hosts: string[] = []\n\n Object.keys(interfaces).forEach((key) => {\n interfaces[key]\n ?.filter((networkInterface) => {\n switch (networkInterface.family) {\n case 'IPv6':\n return (\n family === 'IPv6' &&\n networkInterface.scopeid === 0 &&\n networkInterface.address !== '::1'\n )\n case 'IPv4':\n return family === 'IPv4' && networkInterface.address !== '127.0.0.1'\n default:\n return false\n }\n })\n .forEach((networkInterface) => {\n if (networkInterface.address) {\n hosts.push(networkInterface.address)\n }\n })\n })\n\n return hosts\n}\n\nexport function getNetworkHost(family: 'IPv4' | 'IPv6'): string | null {\n const hosts = getNetworkHosts(family)\n return hosts[0] ?? null\n}\n"],"names":["getNetworkHost","getNetworkHosts","family","interfaces","os","networkInterfaces","hosts","Object","keys","forEach","key","filter","networkInterface","scopeid","address","push"],"mappings":";;;;+BAgCgBA;;;eAAAA;;;2DAhCD;;;;;;AAEf,SAASC,gBAAgBC,MAAuB;IAC9C,MAAMC,aAAaC,WAAE,CAACC,iBAAiB;IACvC,MAAMC,QAAkB,EAAE;IAE1BC,OAAOC,IAAI,CAACL,YAAYM,OAAO,CAAC,CAACC;YAC/BP;SAAAA,kBAAAA,UAAU,CAACO,IAAI,qBAAfP,gBACIQ,MAAM,CAAC,CAACC;YACR,OAAQA,iBAAiBV,MAAM;gBAC7B,KAAK;oBACH,OACEA,WAAW,UACXU,iBAAiBC,OAAO,KAAK,KAC7BD,iBAAiBE,OAAO,KAAK;gBAEjC,KAAK;oBACH,OAAOZ,WAAW,UAAUU,iBAAiBE,OAAO,KAAK;gBAC3D;oBACE,OAAO;YACX;QACF,GACCL,OAAO,CAAC,CAACG;YACR,IAAIA,iBAAiBE,OAAO,EAAE;gBAC5BR,MAAMS,IAAI,CAACH,iBAAiBE,OAAO;YACrC;QACF;IACJ;IAEA,OAAOR;AACT;AAEO,SAASN,eAAeE,MAAuB;IACpD,MAAMI,QAAQL,gBAAgBC;IAC9B,OAAOI,KAAK,CAAC,EAAE,IAAI;AACrB"}
|
||||
12
node_modules/next/dist/lib/get-package-version.d.ts
generated
vendored
Normal file
12
node_modules/next/dist/lib/get-package-version.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
type PackageJsonDependencies = {
|
||||
dependencies: Record<string, string>;
|
||||
devDependencies: Record<string, string>;
|
||||
};
|
||||
export declare function getDependencies({ cwd, }: {
|
||||
cwd: string;
|
||||
}): Promise<PackageJsonDependencies>;
|
||||
export declare function getPackageVersion({ cwd, name, }: {
|
||||
cwd: string;
|
||||
name: string;
|
||||
}): Promise<string | null>;
|
||||
export {};
|
||||
118
node_modules/next/dist/lib/get-package-version.js
generated
vendored
Normal file
118
node_modules/next/dist/lib/get-package-version.js
generated
vendored
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
getDependencies: null,
|
||||
getPackageVersion: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
getDependencies: function() {
|
||||
return getDependencies;
|
||||
},
|
||||
getPackageVersion: function() {
|
||||
return getPackageVersion;
|
||||
}
|
||||
});
|
||||
const _fs = require("fs");
|
||||
const _findup = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/find-up"));
|
||||
const _json5 = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/json5"));
|
||||
const _path = /*#__PURE__*/ _interop_require_wildcard(require("path"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interop_require_wildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {
|
||||
__proto__: null
|
||||
};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
let cachedDeps;
|
||||
function getDependencies({ cwd }) {
|
||||
if (cachedDeps) {
|
||||
return cachedDeps;
|
||||
}
|
||||
return cachedDeps = (async ()=>{
|
||||
const configurationPath = await (0, _findup.default)('package.json', {
|
||||
cwd
|
||||
});
|
||||
if (!configurationPath) {
|
||||
return {
|
||||
dependencies: {},
|
||||
devDependencies: {}
|
||||
};
|
||||
}
|
||||
const content = await _fs.promises.readFile(configurationPath, 'utf-8');
|
||||
const packageJson = _json5.default.parse(content);
|
||||
const { dependencies = {}, devDependencies = {} } = packageJson || {};
|
||||
return {
|
||||
dependencies,
|
||||
devDependencies
|
||||
};
|
||||
})();
|
||||
}
|
||||
async function getPackageVersion({ cwd, name }) {
|
||||
const { dependencies, devDependencies } = await getDependencies({
|
||||
cwd
|
||||
});
|
||||
if (!(dependencies[name] || devDependencies[name])) {
|
||||
return null;
|
||||
}
|
||||
const cwd2 = cwd.endsWith(_path.posix.sep) || cwd.endsWith(_path.win32.sep) ? cwd : `${cwd}/`;
|
||||
try {
|
||||
const targetPath = require.resolve(`${name}/package.json`, {
|
||||
paths: [
|
||||
cwd2
|
||||
]
|
||||
});
|
||||
const targetContent = await _fs.promises.readFile(targetPath, 'utf-8');
|
||||
return _json5.default.parse(targetContent).version ?? null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=get-package-version.js.map
|
||||
1
node_modules/next/dist/lib/get-package-version.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/get-package-version.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/get-package-version.ts"],"sourcesContent":["import { promises as fs } from 'fs'\nimport findUp from 'next/dist/compiled/find-up'\nimport JSON5 from 'next/dist/compiled/json5'\nimport * as path from 'path'\n\ntype PackageJsonDependencies = {\n dependencies: Record<string, string>\n devDependencies: Record<string, string>\n}\n\nlet cachedDeps: Promise<PackageJsonDependencies>\n\nexport function getDependencies({\n cwd,\n}: {\n cwd: string\n}): Promise<PackageJsonDependencies> {\n if (cachedDeps) {\n return cachedDeps\n }\n\n return (cachedDeps = (async () => {\n const configurationPath: string | undefined = await findUp('package.json', {\n cwd,\n })\n if (!configurationPath) {\n return { dependencies: {}, devDependencies: {} }\n }\n\n const content = await fs.readFile(configurationPath, 'utf-8')\n const packageJson: any = JSON5.parse(content)\n\n const { dependencies = {}, devDependencies = {} } = packageJson || {}\n return { dependencies, devDependencies }\n })())\n}\n\nexport async function getPackageVersion({\n cwd,\n name,\n}: {\n cwd: string\n name: string\n}): Promise<string | null> {\n const { dependencies, devDependencies } = await getDependencies({ cwd })\n if (!(dependencies[name] || devDependencies[name])) {\n return null\n }\n\n const cwd2 =\n cwd.endsWith(path.posix.sep) || cwd.endsWith(path.win32.sep)\n ? cwd\n : `${cwd}/`\n\n try {\n const targetPath = require.resolve(`${name}/package.json`, {\n paths: [cwd2],\n })\n const targetContent = await fs.readFile(targetPath, 'utf-8')\n return JSON5.parse(targetContent).version ?? null\n } catch {\n return null\n }\n}\n"],"names":["getDependencies","getPackageVersion","cachedDeps","cwd","configurationPath","findUp","dependencies","devDependencies","content","fs","readFile","packageJson","JSON5","parse","name","cwd2","endsWith","path","posix","sep","win32","targetPath","require","resolve","paths","targetContent","version"],"mappings":";;;;;;;;;;;;;;;IAYgBA,eAAe;eAAfA;;IAyBMC,iBAAiB;eAAjBA;;;oBArCS;+DACZ;8DACD;8DACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOtB,IAAIC;AAEG,SAASF,gBAAgB,EAC9BG,GAAG,EAGJ;IACC,IAAID,YAAY;QACd,OAAOA;IACT;IAEA,OAAQA,aAAa,AAAC,CAAA;QACpB,MAAME,oBAAwC,MAAMC,IAAAA,eAAM,EAAC,gBAAgB;YACzEF;QACF;QACA,IAAI,CAACC,mBAAmB;YACtB,OAAO;gBAAEE,cAAc,CAAC;gBAAGC,iBAAiB,CAAC;YAAE;QACjD;QAEA,MAAMC,UAAU,MAAMC,YAAE,CAACC,QAAQ,CAACN,mBAAmB;QACrD,MAAMO,cAAmBC,cAAK,CAACC,KAAK,CAACL;QAErC,MAAM,EAAEF,eAAe,CAAC,CAAC,EAAEC,kBAAkB,CAAC,CAAC,EAAE,GAAGI,eAAe,CAAC;QACpE,OAAO;YAAEL;YAAcC;QAAgB;IACzC,CAAA;AACF;AAEO,eAAeN,kBAAkB,EACtCE,GAAG,EACHW,IAAI,EAIL;IACC,MAAM,EAAER,YAAY,EAAEC,eAAe,EAAE,GAAG,MAAMP,gBAAgB;QAAEG;IAAI;IACtE,IAAI,CAAEG,CAAAA,YAAY,CAACQ,KAAK,IAAIP,eAAe,CAACO,KAAK,AAAD,GAAI;QAClD,OAAO;IACT;IAEA,MAAMC,OACJZ,IAAIa,QAAQ,CAACC,MAAKC,KAAK,CAACC,GAAG,KAAKhB,IAAIa,QAAQ,CAACC,MAAKG,KAAK,CAACD,GAAG,IACvDhB,MACA,GAAGA,IAAI,CAAC,CAAC;IAEf,IAAI;QACF,MAAMkB,aAAaC,QAAQC,OAAO,CAAC,GAAGT,KAAK,aAAa,CAAC,EAAE;YACzDU,OAAO;gBAACT;aAAK;QACf;QACA,MAAMU,gBAAgB,MAAMhB,YAAE,CAACC,QAAQ,CAACW,YAAY;QACpD,OAAOT,cAAK,CAACC,KAAK,CAACY,eAAeC,OAAO,IAAI;IAC/C,EAAE,OAAM;QACN,OAAO;IACT;AACF"}
|
||||
1
node_modules/next/dist/lib/get-project-dir.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/lib/get-project-dir.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export declare function getProjectDir(dir?: string, exitOnEnoent?: boolean): string;
|
||||
51
node_modules/next/dist/lib/get-project-dir.js
generated
vendored
Normal file
51
node_modules/next/dist/lib/get-project-dir.js
generated
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "getProjectDir", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return getProjectDir;
|
||||
}
|
||||
});
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _log = require("../build/output/log");
|
||||
const _detecttypo = require("./detect-typo");
|
||||
const _realpath = require("./realpath");
|
||||
const _utils = require("../server/lib/utils");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function getProjectDir(dir, exitOnEnoent = true) {
|
||||
const resolvedDir = _path.default.resolve(dir || '.');
|
||||
try {
|
||||
const realDir = (0, _realpath.realpathSync)(resolvedDir);
|
||||
if (resolvedDir !== realDir && resolvedDir.toLowerCase() === realDir.toLowerCase()) {
|
||||
(0, _log.warn)(`Invalid casing detected for project dir, received ${resolvedDir} actual path ${realDir}, see more info here https://nextjs.org/docs/messages/invalid-project-dir-casing`);
|
||||
}
|
||||
return realDir;
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT' && exitOnEnoent) {
|
||||
if (typeof dir === 'string') {
|
||||
const detectedTypo = (0, _detecttypo.detectTypo)(dir, [
|
||||
'build',
|
||||
'dev',
|
||||
'info',
|
||||
'lint',
|
||||
'start',
|
||||
'telemetry',
|
||||
'experimental-test'
|
||||
]);
|
||||
if (detectedTypo) {
|
||||
return (0, _utils.printAndExit)(`"next ${dir}" does not exist. Did you mean "next ${detectedTypo}"?`);
|
||||
}
|
||||
}
|
||||
return (0, _utils.printAndExit)(`Invalid project directory provided, no such directory: ${resolvedDir}`);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=get-project-dir.js.map
|
||||
1
node_modules/next/dist/lib/get-project-dir.js.map
generated
vendored
Normal file
1
node_modules/next/dist/lib/get-project-dir.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/lib/get-project-dir.ts"],"sourcesContent":["import path from 'path'\nimport { warn } from '../build/output/log'\nimport { detectTypo } from './detect-typo'\nimport { realpathSync } from './realpath'\nimport { printAndExit } from '../server/lib/utils'\n\nexport function getProjectDir(dir?: string, exitOnEnoent = true) {\n const resolvedDir = path.resolve(dir || '.')\n try {\n const realDir = realpathSync(resolvedDir)\n\n if (\n resolvedDir !== realDir &&\n resolvedDir.toLowerCase() === realDir.toLowerCase()\n ) {\n warn(\n `Invalid casing detected for project dir, received ${resolvedDir} actual path ${realDir}, see more info here https://nextjs.org/docs/messages/invalid-project-dir-casing`\n )\n }\n\n return realDir\n } catch (err: any) {\n if (err.code === 'ENOENT' && exitOnEnoent) {\n if (typeof dir === 'string') {\n const detectedTypo = detectTypo(dir, [\n 'build',\n 'dev',\n 'info',\n 'lint',\n 'start',\n 'telemetry',\n 'experimental-test',\n ])\n\n if (detectedTypo) {\n return printAndExit(\n `\"next ${dir}\" does not exist. Did you mean \"next ${detectedTypo}\"?`\n )\n }\n }\n\n return printAndExit(\n `Invalid project directory provided, no such directory: ${resolvedDir}`\n )\n }\n throw err\n }\n}\n"],"names":["getProjectDir","dir","exitOnEnoent","resolvedDir","path","resolve","realDir","realpathSync","toLowerCase","warn","err","code","detectedTypo","detectTypo","printAndExit"],"mappings":";;;;+BAMgBA;;;eAAAA;;;6DANC;qBACI;4BACM;0BACE;uBACA;;;;;;AAEtB,SAASA,cAAcC,GAAY,EAAEC,eAAe,IAAI;IAC7D,MAAMC,cAAcC,aAAI,CAACC,OAAO,CAACJ,OAAO;IACxC,IAAI;QACF,MAAMK,UAAUC,IAAAA,sBAAY,EAACJ;QAE7B,IACEA,gBAAgBG,WAChBH,YAAYK,WAAW,OAAOF,QAAQE,WAAW,IACjD;YACAC,IAAAA,SAAI,EACF,CAAC,kDAAkD,EAAEN,YAAY,aAAa,EAAEG,QAAQ,gFAAgF,CAAC;QAE7K;QAEA,OAAOA;IACT,EAAE,OAAOI,KAAU;QACjB,IAAIA,IAAIC,IAAI,KAAK,YAAYT,cAAc;YACzC,IAAI,OAAOD,QAAQ,UAAU;gBAC3B,MAAMW,eAAeC,IAAAA,sBAAU,EAACZ,KAAK;oBACnC;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;iBACD;gBAED,IAAIW,cAAc;oBAChB,OAAOE,IAAAA,mBAAY,EACjB,CAAC,MAAM,EAAEb,IAAI,qCAAqC,EAAEW,aAAa,EAAE,CAAC;gBAExE;YACF;YAEA,OAAOE,IAAAA,mBAAY,EACjB,CAAC,uDAAuD,EAAEX,aAAa;QAE3E;QACA,MAAMO;IACR;AACF"}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue