Initial boiler plate project

This commit is contained in:
2024-09-24 03:52:46 +00:00
parent 6120b2d6c3
commit 154b93e267
10034 changed files with 2079352 additions and 2 deletions

47
node_modules/next/dist/lib/batcher.d.ts generated vendored Normal file
View 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
View 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
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/batcher.ts"],"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"}

1
node_modules/next/dist/lib/batcher.test.d.ts generated vendored Normal file
View File

@ -0,0 +1 @@
export {};

5
node_modules/next/dist/lib/build-custom-route.d.ts generated vendored Normal file
View 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
View 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
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/build-custom-route.ts"],"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"}

1
node_modules/next/dist/lib/client-reference.d.ts generated vendored Normal file
View File

@ -0,0 +1 @@
export declare function isClientReference(mod: any): boolean;

16
node_modules/next/dist/lib/client-reference.js generated vendored Normal file
View File

@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "isClientReference", {
enumerable: true,
get: function() {
return isClientReference;
}
});
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-reference.js.map

1
node_modules/next/dist/lib/client-reference.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/client-reference.ts"],"names":["isClientReference","mod","defaultExport","default","$$typeof","Symbol","for"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA,kBAAkBC,GAAQ;IACxC,MAAMC,gBAAgBD,CAAAA,uBAAAA,IAAKE,OAAO,KAAIF;IACtC,OAAOC,CAAAA,iCAAAA,cAAeE,QAAQ,MAAKC,OAAOC,GAAG,CAAC;AAChD"}

7
node_modules/next/dist/lib/coalesced-function.d.ts generated vendored Normal file
View 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
View 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
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/coalesced-function.ts"],"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
View File

@ -0,0 +1,2 @@
export declare class CompileError extends Error {
}

14
node_modules/next/dist/lib/compile-error.js generated vendored Normal file
View 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
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/compile-error.ts"],"names":["CompileError","Error"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,qBAAqBC;AAAO"}

122
node_modules/next/dist/lib/constants.d.ts generated vendored Normal file
View File

@ -0,0 +1,122 @@
import type { ServerRuntime } from '../../types';
export declare const NEXT_QUERY_PARAM_PREFIX = "nxtP";
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_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_SOFT_TAGS_HEADER = "x-next-cache-soft-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_CACHE_TAG_MAX_ITEMS = 64;
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 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_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";
/**
* React Server Components layer (rsc).
*/
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 layer for the API routes.
*/
readonly api: "api";
/**
* 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 server bundle layer for metadata routes.
*/
readonly appMetadataRoute: "app-metadata-route";
/**
* The layer for the server bundle for App Route handlers.
*/
readonly appRouteHandler: "app-route-handler";
};
export type WebpackLayerName = (typeof WEBPACK_LAYERS_NAMES)[keyof typeof WEBPACK_LAYERS_NAMES];
declare const WEBPACK_LAYERS: {
GROUP: {
serverOnly: ("rsc" | "action-browser" | "instrument" | "app-metadata-route" | "app-route-handler")[];
clientOnly: ("ssr" | "app-pages-browser")[];
nonClientServerTarget: ("middleware" | "api")[];
app: ("shared" | "rsc" | "ssr" | "action-browser" | "instrument" | "app-pages-browser" | "app-metadata-route" | "app-route-handler")[];
};
shared: "shared";
reactServerComponents: "rsc";
serverSideRendering: "ssr";
actionBrowser: "action-browser";
api: "api";
middleware: "middleware";
instrument: "instrument";
edgeAsset: "edge-asset";
appPagesBrowser: "app-pages-browser";
appMetadataRoute: "app-metadata-route";
appRouteHandler: "app-route-handler";
};
declare const WEBPACK_RESOURCE_QUERIES: {
edgeSSREntry: string;
metadata: string;
metadataRoute: string;
metadataImageMeta: string;
};
export { WEBPACK_LAYERS, WEBPACK_RESOURCE_QUERIES };

329
node_modules/next/dist/lib/constants.js generated vendored Normal file
View File

@ -0,0 +1,329 @@
"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,
INSTRUMENTATION_HOOK_FILENAME: 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_TAGS_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_META_SUFFIX: null,
NEXT_QUERY_PARAM_PREFIX: 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_MOD_REF_PROXY_ALIAS: null,
RSC_PREFETCH_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;
},
INSTRUMENTATION_HOOK_FILENAME: function() {
return INSTRUMENTATION_HOOK_FILENAME;
},
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_TAGS_HEADER: function() {
return NEXT_CACHE_SOFT_TAGS_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_META_SUFFIX: function() {
return NEXT_META_SUFFIX;
},
NEXT_QUERY_PARAM_PREFIX: function() {
return NEXT_QUERY_PARAM_PREFIX;
},
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_MOD_REF_PROXY_ALIAS: function() {
return RSC_MOD_REF_PROXY_ALIAS;
},
RSC_PREFETCH_SUFFIX: function() {
return RSC_PREFETCH_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 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_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_SOFT_TAGS_HEADER = "x-next-cache-soft-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_CACHE_TAG_MAX_ITEMS = 64;
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 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_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",
/**
* React Server Components layer (rsc).
*/ reactServerComponents: "rsc",
/**
* Server Side Rendering layer for app (ssr).
*/ serverSideRendering: "ssr",
/**
* The browser client bundle layer for actions.
*/ actionBrowser: "action-browser",
/**
* The layer for the API routes.
*/ api: "api",
/**
* 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 server bundle layer for metadata routes.
*/ appMetadataRoute: "app-metadata-route",
/**
* The layer for the server bundle for App Route handlers.
*/ appRouteHandler: "app-route-handler"
};
const WEBPACK_LAYERS = {
...WEBPACK_LAYERS_NAMES,
GROUP: {
serverOnly: [
WEBPACK_LAYERS_NAMES.reactServerComponents,
WEBPACK_LAYERS_NAMES.actionBrowser,
WEBPACK_LAYERS_NAMES.appMetadataRoute,
WEBPACK_LAYERS_NAMES.appRouteHandler,
WEBPACK_LAYERS_NAMES.instrument
],
clientOnly: [
WEBPACK_LAYERS_NAMES.serverSideRendering,
WEBPACK_LAYERS_NAMES.appPagesBrowser
],
nonClientServerTarget: [
// middleware and pages api
WEBPACK_LAYERS_NAMES.middleware,
WEBPACK_LAYERS_NAMES.api
],
app: [
WEBPACK_LAYERS_NAMES.reactServerComponents,
WEBPACK_LAYERS_NAMES.actionBrowser,
WEBPACK_LAYERS_NAMES.appMetadataRoute,
WEBPACK_LAYERS_NAMES.appRouteHandler,
WEBPACK_LAYERS_NAMES.serverSideRendering,
WEBPACK_LAYERS_NAMES.appPagesBrowser,
WEBPACK_LAYERS_NAMES.shared,
WEBPACK_LAYERS_NAMES.instrument
]
}
};
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
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/constants.ts"],"names":["ACTION_SUFFIX","APP_DIR_ALIAS","CACHE_ONE_YEAR","DOT_NEXT_ALIAS","ESLINT_DEFAULT_DIRS","GSP_NO_RETURNED_VALUE","GSSP_COMPONENT_MEMBER_ERROR","GSSP_NO_RETURNED_VALUE","INSTRUMENTATION_HOOK_FILENAME","MIDDLEWARE_FILENAME","MIDDLEWARE_LOCATION_REGEXP","NEXT_BODY_SUFFIX","NEXT_CACHE_IMPLICIT_TAG_ID","NEXT_CACHE_REVALIDATED_TAGS_HEADER","NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER","NEXT_CACHE_SOFT_TAGS_HEADER","NEXT_CACHE_SOFT_TAG_MAX_LENGTH","NEXT_CACHE_TAGS_HEADER","NEXT_CACHE_TAG_MAX_ITEMS","NEXT_CACHE_TAG_MAX_LENGTH","NEXT_DATA_SUFFIX","NEXT_META_SUFFIX","NEXT_QUERY_PARAM_PREFIX","NON_STANDARD_NODE_ENV","PAGES_DIR_ALIAS","PRERENDER_REVALIDATE_HEADER","PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER","PUBLIC_DIR_MIDDLEWARE_CONFLICT","ROOT_DIR_ALIAS","RSC_ACTION_CLIENT_WRAPPER_ALIAS","RSC_ACTION_ENCRYPTION_ALIAS","RSC_ACTION_PROXY_ALIAS","RSC_ACTION_VALIDATE_ALIAS","RSC_MOD_REF_PROXY_ALIAS","RSC_PREFETCH_SUFFIX","RSC_SUFFIX","SERVER_PROPS_EXPORT_ERROR","SERVER_PROPS_GET_INIT_PROPS_CONFLICT","SERVER_PROPS_SSG_CONFLICT","SERVER_RUNTIME","SSG_FALLBACK_EXPORT_ERROR","SSG_GET_INITIAL_PROPS_CONFLICT","STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR","UNSTABLE_REVALIDATE_RENAME_ERROR","WEBPACK_LAYERS","WEBPACK_RESOURCE_QUERIES","edge","experimentalEdge","nodejs","WEBPACK_LAYERS_NAMES","shared","reactServerComponents","serverSideRendering","actionBrowser","api","middleware","instrument","edgeAsset","appPagesBrowser","appMetadataRoute","appRouteHandler","GROUP","serverOnly","clientOnly","nonClientServerTarget","app","edgeSSREntry","metadata","metadataRoute","metadataImageMeta"],"mappings":"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"}

View 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']>;
};

View 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("../server/future/helpers/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 + 1; 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

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/create-client-router-filter.ts"],"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,GAAG,GAAGD,IAAK;gBAC7C,MAAME,UAAUJ,SAAS,CAACE,EAAE;gBAE5B,IAAIE,QAAQC,UAAU,CAAC,MAAM;oBAC3B;gBACF;gBACAN,UAAU,CAAC,EAAEA,QAAQ,CAAC,EAAEK,QAAQ,CAAC;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"}

12
node_modules/next/dist/lib/detached-promise.d.ts generated vendored Normal file
View 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
View 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
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/detached-promise.ts"],"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
View 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
View 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
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/detect-typo.ts"],"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
View 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>;

171
node_modules/next/dist/lib/download-swc.js generated vendored Normal file
View File

@ -0,0 +1,171 @@
"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}...`);
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 new Error(`request failed with status ${res.status}`);
}
if (!body) {
throw new Error("request failed with empty body");
}
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.rename(tempFile, _path.default.join(cacheDirectory, tarFileName));
}
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
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/download-swc.ts"],"names":["downloadNativeNextSwc","downloadWasmSwc","WritableStream","require","MAX_VERSIONS_TO_CACHE","extractBinary","outputDirectory","pkgName","tarFileName","cacheDirectory","getCacheDirectory","process","env","extractFromTar","tar","x","file","path","join","cwd","strip","fs","existsSync","Log","info","promises","mkdir","recursive","tempFile","Date","now","registry","getRegistry","downloadUrl","fetch","then","res","ok","body","error","Error","status","cacheWriteStream","createWriteStream","pipeTo","write","chunk","Promise","resolve","reject","close","rename","cacheFiles","readdir","length","sort","a","b","localeCompare","i","unlink","catch","version","bindingsDirectory","triplesABI","triple","substring","wasmDirectory","variant"],"mappings":"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"}

26
node_modules/next/dist/lib/eslint/customFormatter.d.ts generated vendored Normal file
View 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): {
output: string;
outputWithMessages: string;
totalNextPluginErrorCount: number;
totalNextPluginWarningCount: number;
};
export {};

97
node_modules/next/dist/lib/eslint/customFormatter.js generated vendored Normal file
View 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;
(function(MessageSeverity) {
MessageSeverity[MessageSeverity["Warning"] = 1] = "Warning";
MessageSeverity[MessageSeverity["Error"] = 2] = "Error";
})(MessageSeverity || (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;
}
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 ? 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/basic-features/eslint#disabling-rules` : "",
totalNextPluginErrorCount,
totalNextPluginWarningCount
};
}
//# sourceMappingURL=customFormatter.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/eslint/customFormatter.ts"],"names":["formatResults","MessageSeverity","pluginCount","messages","nextPluginWarningCount","nextPluginErrorCount","i","length","severity","ruleId","includes","formatMessage","dir","filePath","fileName","path","posix","normalize","relative","replace","startsWith","output","cyan","message","line","column","yellow","toString","bold","red","gray","baseDir","results","format","totalNextPluginErrorCount","totalNextPluginWarningCount","resultsWithMessages","filter","forEach","res","map","join","outputWithMessages"],"mappings":";;;;;;;;;;;;;;;;;;IAgGgBA,aAAa;eAAbA;;;4BAhG8B;6DAC7B;;;;;;;UAGLC;;;GAAAA,oBAAAA;AAsBZ,SAASC,YAAYC,QAAuB;IAI1C,IAAIC,yBAAyB;IAC7B,IAAIC,uBAAuB;IAE3B,IAAK,IAAIC,IAAI,GAAGA,IAAIH,SAASI,MAAM,EAAED,IAAK;QACxC,MAAM,EAAEE,QAAQ,EAAEC,MAAM,EAAE,GAAGN,QAAQ,CAACG,EAAE;QAExC,IAAIG,0BAAAA,OAAQC,QAAQ,CAAC,eAAe;YAClC,IAAIF,gBAAsC;gBACxCJ,0BAA0B;YAC5B,OAAO;gBACLC,wBAAwB;YAC1B;QACF;IACF;IAEA,OAAO;QACLA;QACAD;IACF;AACF;AAEA,SAASO,cACPC,GAAW,EACXT,QAAuB,EACvBU,QAAgB;IAEhB,IAAIC,WAAWC,aAAI,CAACC,KAAK,CAACC,SAAS,CACjCF,aAAI,CAACG,QAAQ,CAACN,KAAKC,UAAUM,OAAO,CAAC,OAAO;IAG9C,IAAI,CAACL,SAASM,UAAU,CAAC,MAAM;QAC7BN,WAAW,OAAOA;IACpB;IAEA,IAAIO,SAAS,OAAOC,IAAAA,gBAAI,EAACR;IAEzB,IAAK,IAAIR,IAAI,GAAGA,IAAIH,SAASI,MAAM,EAAED,IAAK;QACxC,MAAM,EAAEiB,OAAO,EAAEf,QAAQ,EAAEgB,IAAI,EAAEC,MAAM,EAAEhB,MAAM,EAAE,GAAGN,QAAQ,CAACG,EAAE;QAE/De,SAASA,SAAS;QAElB,IAAIG,QAAQC,QAAQ;YAClBJ,SACEA,SACAK,IAAAA,kBAAM,EAACF,KAAKG,QAAQ,MACpB,MACAD,IAAAA,kBAAM,EAACD,OAAOE,QAAQ,MACtB;QACJ;QAEA,IAAInB,gBAAsC;YACxCa,UAAUK,IAAAA,kBAAM,EAACE,IAAAA,gBAAI,EAAC,cAAc;QACtC,OAAO;YACLP,UAAUQ,IAAAA,eAAG,EAACD,IAAAA,gBAAI,EAAC,YAAY;QACjC;QAEAP,UAAUE;QAEV,IAAId,QAAQ;YACVY,UAAU,OAAOS,IAAAA,gBAAI,EAACF,IAAAA,gBAAI,EAACnB;QAC7B;IACF;IAEA,OAAOY;AACT;AAEO,SAASrB,cACd+B,OAAe,EACfC,OAAqB,EACrBC,MAAmC;IAOnC,IAAIC,4BAA4B;IAChC,IAAIC,8BAA8B;IAClC,IAAIC,sBAAsBJ,QAAQK,MAAM,CAAC,CAAC,EAAElC,QAAQ,EAAE,GAAKA,4BAAAA,SAAUI,MAAM;IAE3E,qDAAqD;IACrD6B,oBAAoBE,OAAO,CAAC,CAAC,EAAEnC,QAAQ,EAAE;QACvC,MAAMoC,MAAMrC,YAAYC;QACxB+B,6BAA6BK,IAAIlC,oBAAoB;QACrD8B,+BAA+BI,IAAInC,sBAAsB;IAC3D;IAEA,oEAAoE;IACpE,MAAMiB,SAASY,SACXA,OAAOG,uBACPA,oBACGI,GAAG,CAAC,CAAC,EAAErC,QAAQ,EAAEU,QAAQ,EAAE,GAC1BF,cAAcoB,SAAS5B,UAAUU,WAElC4B,IAAI,CAAC;IAEZ,OAAO;QACLpB,QAAQA;QACRqB,oBACEN,oBAAoB7B,MAAM,GAAG,IACzBc,SACA,CAAC,IAAI,EAAEC,IAAAA,gBAAI,EACT,QACA,qHAAqH,CAAC,GACxH;QACNY;QACAC;IACF;AACF"}

View 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;
})[]>;

View 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

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/eslint/getESLintPromptValues.ts"],"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"}

View 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>;

View 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

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/eslint/hasEslintConfiguration.ts"],"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
View 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 {};

316
node_modules/next/dist/lib/eslint/runLintCheck.js generated vendored Normal file
View File

@ -0,0 +1,316 @@
"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/basic-features/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")));
const { ESLint } = mod;
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
};
let eslint = new ESLint(options);
let nextEslintPluginIsEnabled = false;
const nextRulesEnabled = new Map();
for (const configFile of [
eslintrcFile,
pkgJsonPath
]){
var _completeConfig_plugins;
if (!configFile) continue;
const completeConfig = await eslint.calculateConfigForFile(configFile);
if ((_completeConfig_plugins = completeConfig.plugins) == null ? void 0 : _completeConfig_plugins.includes("@next/next")) {
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/basic-features/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 = (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)([
".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/basic-features/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") {
// eslint v9 has breaking changes, so lock to 8 until dependency plugins fully support v9.
dep.pkg = "eslint@^8";
}
});
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

File diff suppressed because one or more lines are too long

View 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>;

View 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

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/eslint/writeDefaultConfig.ts"],"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"}

View 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
View 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

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/eslint/writeOutputFile.ts"],"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,SAAS,CAAC;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,SAAS,CAAC;QAC1D,EAAE,OAAOoB,KAAK;YACZN,KAAIT,KAAK,CAAC,CAAC,6CAA6C,EAAEL,SAAS,CAAC;YACpEqB,QAAQhB,KAAK,CAACe;QAChB;IACF;AACF"}

2
node_modules/next/dist/lib/fatal-error.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
export declare class FatalError extends Error {
}

14
node_modules/next/dist/lib/fatal-error.js generated vendored Normal file
View 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
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/fatal-error.ts"],"names":["FatalError","Error"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,mBAAmBC;AAAO"}

5
node_modules/next/dist/lib/file-exists.d.ts generated vendored Normal file
View 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
View 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;
(function(FileType) {
FileType["File"] = "file";
FileType["Directory"] = "directory";
})(FileType || (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
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/file-exists.ts"],"names":["fileExists","FileType","fileName","type","stats","promises","stat","isFile","isDirectory","existsSync","err","isError","code"],"mappings":";;;;;;;;;;;;;;;;;;IAQsBA,UAAU;eAAVA;;;oBARe;gEACjB;;;;;;;UAERC;;;GAAAA,aAAAA;AAKL,eAAeD,WACpBE,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
View 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
View 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
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/find-config.ts"],"names":["findConfig","findConfigPath","dir","key","findUp","cwd","directory","_returnFile","packageJsonPath","isESM","packageJsonStr","readFile","packageJson","JSON","parse","Error","type","filePath","esmImport","path","process","platform","env","JEST_WORKER_ID","pathToFileURL","toString","endsWith","default","require","fileContents","JSON5"],"mappings":";;;;;;;;;;;;;;;IAiCsBA,UAAU;eAAVA;;IAxBNC,cAAc;eAAdA;;;+DATG;0BACM;8DACP;qBACY;;;;;;AAMvB,SAASA,eACdC,GAAW,EACXC,GAAW;IAEX,4EAA4E;IAC5E,mBAAmB;IACnB,OAAOC,IAAAA,eAAM,EACX;QACE,CAAC,CAAC,EAAED,IAAI,OAAO,CAAC;QAChB,CAAC,EAAEA,IAAI,YAAY,CAAC;QACpB,CAAC,CAAC,EAAEA,IAAI,KAAK,CAAC;QACd,CAAC,EAAEA,IAAI,UAAU,CAAC;QAClB,CAAC,EAAEA,IAAI,WAAW,CAAC;QACnB,CAAC,EAAEA,IAAI,WAAW,CAAC;KACpB,EACD;QACEE,KAAKH;IACP;AAEJ;AAKO,eAAeF,WACpBM,SAAiB,EACjBH,GAAW,EACXI,WAAqB;IAErB,oEAAoE;IACpE,MAAMC,kBAAkB,MAAMJ,IAAAA,eAAM,EAAC,gBAAgB;QAAEC,KAAKC;IAAU;IACtE,IAAIG,QAAQ;IAEZ,IAAID,iBAAiB;QACnB,IAAI;YACF,MAAME,iBAAiB,MAAMC,IAAAA,kBAAQ,EAACH,iBAAiB;YACvD,MAAMI,cAAcC,KAAKC,KAAK,CAACJ;YAI/B,IAAI,OAAOE,gBAAgB,UAAU;gBACnC,MAAM,IAAIG,QAAQ,+BAA+B;;YACnD;YAEA,IAAIH,YAAYI,IAAI,KAAK,UAAU;gBACjCP,QAAQ;YACV;YAEA,IAAIG,WAAW,CAACT,IAAI,IAAI,QAAQ,OAAOS,WAAW,CAACT,IAAI,KAAK,UAAU;gBACpE,OAAOS,WAAW,CAACT,IAAI;YACzB;QACF,EAAE,OAAM;QACN,4BAA4B;QAC9B;IACF;IAEA,MAAMc,WAAW,MAAMhB,eAAeK,WAAWH;IAEjD,MAAMe,YAAY,CAACC;QACjB,0EAA0E;QAC1E,qEAAqE;QACrE,IAAIC,QAAQC,QAAQ,KAAK,WAAW,CAACD,QAAQE,GAAG,CAACC,cAAc,EAAE;YAC/D,sEAAsE;YACtE,mBAAmB;YACnB,OAAO,MAAM,CAACC,IAAAA,kBAAa,EAACL,MAAMM,QAAQ;QAC5C,OAAO;YACL,OAAO,MAAM,CAACN;QAChB;IACF;IAEA,IAAIF,UAAU;QACZ,IAAIA,SAASS,QAAQ,CAAC,QAAQ;YAC5B,IAAIjB,OAAO;gBACT,OAAO,AAAC,CAAA,MAAMS,UAAUD,SAAQ,EAAGU,OAAO;YAC5C,OAAO;gBACL,OAAOC,QAAQX;YACjB;QACF,OAAO,IAAIA,SAASS,QAAQ,CAAC,SAAS;YACpC,OAAO,AAAC,CAAA,MAAMR,UAAUD,SAAQ,EAAGU,OAAO;QAC5C,OAAO,IAAIV,SAASS,QAAQ,CAAC,SAAS;YACpC,OAAOE,QAAQX;QACjB;QAEA,sEAAsE;QACtE,kEAAkE;QAClE,MAAMY,eAAe,MAAMlB,IAAAA,kBAAQ,EAACM,UAAU;QAC9C,OAAOa,cAAK,CAAChB,KAAK,CAACe;IACrB;IAEA,OAAO;AACT"}

1
node_modules/next/dist/lib/find-config.test.d.ts generated vendored Normal file
View File

@ -0,0 +1 @@
export {};

5
node_modules/next/dist/lib/find-pages-dir.d.ts generated vendored Normal file
View 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;
};

50
node_modules/next/dist/lib/find-pages-dir.js generated vendored Normal file
View File

@ -0,0 +1,50 @@
"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 new Error("> Couldn't find any `pages` or `app` directory. Please create one under the project root");
}
return {
pagesDir,
appDir
};
}
//# sourceMappingURL=find-pages-dir.js.map

1
node_modules/next/dist/lib/find-pages-dir.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/find-pages-dir.ts"],"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,IAAIG,MACR;IAEJ;IAEA,OAAO;QACLH;QACAE;IACF;AACF"}

2
node_modules/next/dist/lib/find-root.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
export declare function findRootLockFile(cwd: string): string | undefined;
export declare function findRootDir(cwd: string): string | undefined;

45
node_modules/next/dist/lib/find-root.js generated vendored Normal file
View File

@ -0,0 +1,45 @@
"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.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
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/find-root.ts"],"names":["findRootDir","findRootLockFile","cwd","findUp","sync","lockFile","dirname","undefined"],"mappings":";;;;;;;;;;;;;;;IAYgBA,WAAW;eAAXA;;IATAC,gBAAgB;eAAhBA;;;sBAHQ;+DACL;;;;;;AAEZ,SAASA,iBAAiBC,GAAW;IAC1C,OAAOC,eAAM,CAACC,IAAI,CAChB;QAAC;QAAkB;QAAqB;QAAa;KAAY,EACjE;QACEF;IACF;AAEJ;AAEO,SAASF,YAAYE,GAAW;IACrC,MAAMG,WAAWJ,iBAAiBC;IAClC,OAAOG,WAAWC,IAAAA,aAAO,EAACD,YAAYE;AACxC"}

View 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
View 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

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/format-cli-help-output.ts"],"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,CAAC,EAAED,MAAME,MAAM,CAC9BV,YAAYI,oBACZ,EAAEG,YAAY,CAAC;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,CAAC,EAAEC,IAAAA,gBAAI,EAAC,UAAU,CAAC,EAAEnB,OAAOoB,YAAY,CAACrB,KAAK,CAAC;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,CAAC,EAAEJ,IAAAA,gBAAI,EAAC,cAAc,CAAC;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,CAAC,EAAEJ,IAAAA,gBAAI,EAAC,YAAY,CAAC;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,CAAC,EAAEJ,IAAAA,gBAAI,EAAC,aAAa,CAAC;YACtBN,WAAWsB;YACX;SACD;IACH;IAEA,OAAOjB,OAAOH,IAAI,CAAC;AACrB"}

View 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;

View 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

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/format-dynamic-import-path.ts"],"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
View 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
View 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

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/format-server-error.ts"],"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,CAAC,EAAEA,MAAMC,OAAO,CAAC;;AAEvB,EAAEO,aAAa,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,CAAC,EAAES,WAAW,oLAAoL,CAAC;YAErM;QACF;IACF;AACF"}

View File

@ -0,0 +1 @@
export {};

6
node_modules/next/dist/lib/fs/rename.d.ts generated vendored Normal file
View 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>;

128
node_modules/next/dist/lib/fs/rename.js generated vendored Normal file
View File

@ -0,0 +1,128 @@
/*
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 _gracefulfs = /*#__PURE__*/ _interop_require_wildcard(require("graceful-fs"));
const _util = require("util");
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 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, _util.promisify)(_gracefulfs.rename)(source, target);
}
}
async function renameWithRetry(source, target, startTime, retryTimeout, attempt = 0) {
try {
return await (0, _util.promisify)(_gracefulfs.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 stat = await (0, _util.promisify)(_gracefulfs.stat)(target);
if (!stat.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
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/fs/rename.ts"],"names":["rename","source","target","windowsRetryTimeout","process","platform","renameWithRetry","Date","now","promisify","fs","startTime","retryTimeout","attempt","error","code","console","abortRetry","stat","isFile","e","timeout","Math","min","millis","Promise","resolve","setTimeout"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;CAsBC,GAED,kIAAkI;AAClI,yCAAyC;;;;;+BAUnBA;;;eAAAA;;;oEARF;sBACM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOnB,eAAeA,OACpBC,MAAc,EACdC,MAAc,EACdC,sBAAsC,MAAM,uBAAuB,GAAxB;IAE3C,IAAIF,WAAWC,QAAQ;QACrB,QAAO,gEAAgE;IACzE;IAEA,IAAIE,QAAQC,QAAQ,KAAK,WAAW,OAAOF,wBAAwB,UAAU;QAC3E,6DAA6D;QAC7D,+DAA+D;QAC/D,4DAA4D;QAC5D,qEAAqE;QACrE,MAAMG,gBAAgBL,QAAQC,QAAQK,KAAKC,GAAG,IAAIL;IACpD,OAAO;QACL,MAAMM,IAAAA,eAAS,EAACC,YAAGV,MAAM,EAAEC,QAAQC;IACrC;AACF;AAEA,eAAeI,gBACbL,MAAc,EACdC,MAAc,EACdS,SAAiB,EACjBC,YAAoB,EACpBC,UAAU,CAAC;IAEX,IAAI;QACF,OAAO,MAAMJ,IAAAA,eAAS,EAACC,YAAGV,MAAM,EAAEC,QAAQC;IAC5C,EAAE,OAAOY,OAAY;QACnB,IACEA,MAAMC,IAAI,KAAK,YACfD,MAAMC,IAAI,KAAK,WACfD,MAAMC,IAAI,KAAK,SACf;YACA,MAAMD,MAAM,yCAAyC;;QACvD;QAEA,IAAIP,KAAKC,GAAG,KAAKG,aAAaC,cAAc;YAC1CI,QAAQF,KAAK,CACX,CAAC,iCAAiC,EAAED,QAAQ,qBAAqB,EAAEC,MAAM,CAAC;YAG5E,MAAMA,MAAM,qCAAqC;;QACnD;QAEA,IAAID,YAAY,GAAG;YACjB,IAAII,aAAa;YACjB,IAAI;gBACF,MAAMC,OAAO,MAAMT,IAAAA,eAAS,EAACC,YAAGQ,IAAI,EAAEhB;gBACtC,IAAI,CAACgB,KAAKC,MAAM,IAAI;oBAClBF,aAAa,KAAK,wFAAwF;;gBAC5G;YACF,EAAE,OAAOG,GAAG;YACV,SAAS;YACX;YAEA,IAAIH,YAAY;gBACd,MAAMH;YACR;QACF;QAEA,6CAA6C;QAC7C,MAAMO,QAAQC,KAAKC,GAAG,CAAC,KAAKV,UAAU;QAEtC,gBAAgB;QAChB,OAAOP,gBAAgBL,QAAQC,QAAQS,WAAWC,cAAcC,UAAU;IAC5E;AACF;AAEA,MAAMQ,UAAU,CAACG,SACf,IAAIC,QAAQ,CAACC,UAAYC,WAAWD,SAASF"}

1
node_modules/next/dist/lib/fs/write-atomic.d.ts generated vendored Normal file
View 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
View 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
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/fs/write-atomic.ts"],"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"}

View 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;

View File

@ -0,0 +1,88 @@
"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("../server/future/helpers/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)=>{
// handle catch-all segments (e.g. /foo/bar/[...baz] or /foo/bar/[[...baz]])
if (capture.startsWith("...")) {
return `:${capture.slice(3)}*`;
}
return ":" + capture;
});
}
// for interception routes we don't have access to the dynamic segments from the
// referrer route so we mark them as noop for the app renderer so that it
// can retrieve them from the router state later on. This also allows us to
// compile the route properly with path-to-regexp, otherwise it will throw
function voidParamsBeforeInterceptionMarker(path) {
let newPath = [];
let foundInterceptionMarker = false;
for (const segment of path.split("/")){
if (_interceptionroutes.INTERCEPTION_ROUTE_MARKERS.find((marker)=>segment.startsWith(marker))) {
foundInterceptionMarker = true;
}
if (segment.startsWith(":") && !foundInterceptionMarker) {
newPath.push("__NEXT_EMPTY_PARAM__");
} else {
newPath.push(segment);
}
}
return newPath.join("/");
}
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 = voidParamsBeforeInterceptionMarker(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

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/generate-interception-routes-rewrites.ts"],"names":["generateInterceptionRoutesRewrites","isInterceptionRouteRewrite","toPathToRegexpPath","path","replace","_","capture","startsWith","slice","voidParamsBeforeInterceptionMarker","newPath","foundInterceptionMarker","segment","split","INTERCEPTION_ROUTE_MARKERS","find","marker","push","join","appPaths","basePath","rewrites","appPath","isInterceptionRouteAppPath","interceptingRoute","interceptedRoute","extractInterceptionRouteInformation","normalizedInterceptingRoute","normalizedInterceptedRoute","normalizedAppPath","interceptingRouteRegex","pathToRegexp","toString","source","destination","has","type","key","NEXT_URL","value","route"],"mappings":";;;;;;;;;;;;;;;IA6CgBA,kCAAkC;eAAlCA;;IA4CAC,0BAA0B;eAA1BA;;;8BAzFa;kCACJ;oCAKlB;AAGP,iIAAiI;AACjI,SAASC,mBAAmBC,IAAY;IACtC,OAAOA,KAAKC,OAAO,CAAC,uBAAuB,CAACC,GAAGC;QAC7C,4EAA4E;QAC5E,IAAIA,QAAQC,UAAU,CAAC,QAAQ;YAC7B,OAAO,CAAC,CAAC,EAAED,QAAQE,KAAK,CAAC,GAAG,CAAC,CAAC;QAChC;QACA,OAAO,MAAMF;IACf;AACF;AAEA,gFAAgF;AAChF,yEAAyE;AACzE,2EAA2E;AAC3E,0EAA0E;AAC1E,SAASG,mCAAmCN,IAAY;IACtD,IAAIO,UAAU,EAAE;IAEhB,IAAIC,0BAA0B;IAC9B,KAAK,MAAMC,WAAWT,KAAKU,KAAK,CAAC,KAAM;QACrC,IACEC,8CAA0B,CAACC,IAAI,CAAC,CAACC,SAAWJ,QAAQL,UAAU,CAACS,UAC/D;YACAL,0BAA0B;QAC5B;QAEA,IAAIC,QAAQL,UAAU,CAAC,QAAQ,CAACI,yBAAyB;YACvDD,QAAQO,IAAI,CAAC;QACf,OAAO;YACLP,QAAQO,IAAI,CAACL;QACf;IACF;IAEA,OAAOF,QAAQQ,IAAI,CAAC;AACtB;AAEO,SAASlB,mCACdmB,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,CAAC,EACnCH,sBAAsB,MAAMtB,mBAAmBsB,qBAAqB,GACrE,MAAM,CAAC;YAER,MAAMI,6BAA6B1B,mBAAmBuB;YACtD,MAAMI,oBAAoBpB,mCACxBP,mBAAmBoB;YAGrB,qEAAqE;YACrE,4DAA4D;YAC5D,4CAA4C;YAC5C,IAAIQ,yBAAyBC,IAAAA,0BAAY,EAACJ,6BACvCK,QAAQ,GACRxB,KAAK,CAAC,GAAG,CAAC;YAEba,SAASJ,IAAI,CAAC;gBACZgB,QAAQ,CAAC,EAAEb,SAAS,EAAEQ,2BAA2B,CAAC;gBAClDM,aAAa,CAAC,EAAEd,SAAS,EAAES,kBAAkB,CAAC;gBAC9CM,KAAK;oBACH;wBACEC,MAAM;wBACNC,KAAKC,0BAAQ;wBACbC,OAAOT;oBACT;iBACD;YACH;QACF;IACF;IAEA,OAAOT;AACT;AAEO,SAASpB,2BAA2BuC,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
View File

@ -0,0 +1 @@
export declare function getFilesInDir(path: string): Promise<string[]>;

33
node_modules/next/dist/lib/get-files-in-dir.js generated vendored Normal file
View 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 = [];
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.push(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
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/get-files-in-dir.ts"],"names":["getFilesInDir","path","dir","fs","opendir","results","file","resolvedFile","isSymbolicLink","stat","join","name","isFile","push"],"mappings":";;;;+BAIsBA;;;eAAAA;;;sBAJD;iEACN;;;;;;AAGR,eAAeA,cAAcC,IAAY;IAC9C,MAAMC,MAAM,MAAMC,iBAAE,CAACC,OAAO,CAACH;IAC7B,MAAMI,UAAU,EAAE;IAElB,WAAW,MAAMC,QAAQJ,IAAK;QAC5B,IAAIK,eAA2CD;QAE/C,IAAIA,KAAKE,cAAc,IAAI;YACzBD,eAAe,MAAMJ,iBAAE,CAACM,IAAI,CAACC,IAAAA,UAAI,EAACT,MAAMK,KAAKK,IAAI;QACnD;QAEA,IAAIJ,aAAaK,MAAM,IAAI;YACzBP,QAAQQ,IAAI,CAACP,KAAKK,IAAI;QACxB;IACF;IAEA,OAAON;AACT"}

12
node_modules/next/dist/lib/get-package-version.d.ts generated vendored Normal file
View 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
View 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

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/get-package-version.ts"],"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,CAAC,EAAEA,IAAI,CAAC,CAAC;IAEf,IAAI;QACF,MAAMkB,aAAaC,QAAQC,OAAO,CAAC,CAAC,EAAET,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
View File

@ -0,0 +1 @@
export declare function getProjectDir(dir?: string): string;

51
node_modules/next/dist/lib/get-project-dir.js generated vendored Normal file
View 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");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function getProjectDir(dir) {
try {
const resolvedDir = _path.default.resolve(dir || ".");
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") {
if (typeof dir === "string") {
const detectedTypo = (0, _detecttypo.detectTypo)(dir, [
"build",
"dev",
"info",
"lint",
"start",
"telemetry"
]);
if (detectedTypo) {
(0, _log.error)(`"next ${dir}" does not exist. Did you mean "next ${detectedTypo}"?`);
process.exit(1);
}
}
(0, _log.error)(`Invalid project directory provided, no such directory: ${_path.default.resolve(dir || ".")}`);
process.exit(1);
}
throw err;
}
}
//# sourceMappingURL=get-project-dir.js.map

1
node_modules/next/dist/lib/get-project-dir.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/get-project-dir.ts"],"names":["getProjectDir","dir","resolvedDir","path","resolve","realDir","realpathSync","toLowerCase","warn","err","code","detectedTypo","detectTypo","error","process","exit"],"mappings":";;;;+BAKgBA;;;eAAAA;;;6DALC;qBACW;4BACD;0BACE;;;;;;AAEtB,SAASA,cAAcC,GAAY;IACxC,IAAI;QACF,MAAMC,cAAcC,aAAI,CAACC,OAAO,CAACH,OAAO;QACxC,MAAMI,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,UAAU;YACzB,IAAI,OAAOT,QAAQ,UAAU;gBAC3B,MAAMU,eAAeC,IAAAA,sBAAU,EAACX,KAAK;oBACnC;oBACA;oBACA;oBACA;oBACA;oBACA;iBACD;gBAED,IAAIU,cAAc;oBAChBE,IAAAA,UAAK,EACH,CAAC,MAAM,EAAEZ,IAAI,qCAAqC,EAAEU,aAAa,EAAE,CAAC;oBAEtEG,QAAQC,IAAI,CAAC;gBACf;YACF;YAEAF,IAAAA,UAAK,EACH,CAAC,uDAAuD,EAAEV,aAAI,CAACC,OAAO,CACpEH,OAAO,KACP,CAAC;YAELa,QAAQC,IAAI,CAAC;QACf;QACA,MAAMN;IACR;AACF"}

View File

@ -0,0 +1,10 @@
export interface MissingDependency {
file: string;
pkg: string;
exportsRestrict: boolean;
}
export type NecessaryDependencies = {
resolved: Map<string, string>;
missing: MissingDependency[];
};
export declare function hasNecessaryDependencies(baseDir: string, requiredPackages: MissingDependency[]): Promise<NecessaryDependencies>;

View File

@ -0,0 +1,46 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "hasNecessaryDependencies", {
enumerable: true,
get: function() {
return hasNecessaryDependencies;
}
});
const _fs = require("fs");
const _resolvefrom = require("./resolve-from");
const _path = require("path");
async function hasNecessaryDependencies(baseDir, requiredPackages) {
let resolutions = new Map();
const missingPackages = [];
await Promise.all(requiredPackages.map(async (p)=>{
try {
const pkgPath = await _fs.promises.realpath((0, _resolvefrom.resolveFrom)(baseDir, `${p.pkg}/package.json`));
const pkgDir = (0, _path.dirname)(pkgPath);
if (p.exportsRestrict) {
const fileNameToVerify = (0, _path.relative)(p.pkg, p.file);
if (fileNameToVerify) {
const fileToVerify = (0, _path.join)(pkgDir, fileNameToVerify);
if ((0, _fs.existsSync)(fileToVerify)) {
resolutions.set(p.pkg, fileToVerify);
} else {
return missingPackages.push(p);
}
} else {
resolutions.set(p.pkg, pkgPath);
}
} else {
resolutions.set(p.pkg, (0, _resolvefrom.resolveFrom)(baseDir, p.file));
}
} catch (_) {
return missingPackages.push(p);
}
}));
return {
resolved: resolutions,
missing: missingPackages
};
}
//# sourceMappingURL=has-necessary-dependencies.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/has-necessary-dependencies.ts"],"names":["hasNecessaryDependencies","baseDir","requiredPackages","resolutions","Map","missingPackages","Promise","all","map","p","pkgPath","fs","realpath","resolveFrom","pkg","pkgDir","dirname","exportsRestrict","fileNameToVerify","relative","file","fileToVerify","join","existsSync","set","push","_","resolved","missing"],"mappings":";;;;+BAesBA;;;eAAAA;;;oBAfqB;6BACf;sBACY;AAajC,eAAeA,yBACpBC,OAAe,EACfC,gBAAqC;IAErC,IAAIC,cAAc,IAAIC;IACtB,MAAMC,kBAAuC,EAAE;IAE/C,MAAMC,QAAQC,GAAG,CACfL,iBAAiBM,GAAG,CAAC,OAAOC;QAC1B,IAAI;YACF,MAAMC,UAAU,MAAMC,YAAE,CAACC,QAAQ,CAC/BC,IAAAA,wBAAW,EAACZ,SAAS,CAAC,EAAEQ,EAAEK,GAAG,CAAC,aAAa,CAAC;YAE9C,MAAMC,SAASC,IAAAA,aAAO,EAACN;YAEvB,IAAID,EAAEQ,eAAe,EAAE;gBACrB,MAAMC,mBAAmBC,IAAAA,cAAQ,EAACV,EAAEK,GAAG,EAAEL,EAAEW,IAAI;gBAC/C,IAAIF,kBAAkB;oBACpB,MAAMG,eAAeC,IAAAA,UAAI,EAACP,QAAQG;oBAClC,IAAIK,IAAAA,cAAU,EAACF,eAAe;wBAC5BlB,YAAYqB,GAAG,CAACf,EAAEK,GAAG,EAAEO;oBACzB,OAAO;wBACL,OAAOhB,gBAAgBoB,IAAI,CAAChB;oBAC9B;gBACF,OAAO;oBACLN,YAAYqB,GAAG,CAACf,EAAEK,GAAG,EAAEJ;gBACzB;YACF,OAAO;gBACLP,YAAYqB,GAAG,CAACf,EAAEK,GAAG,EAAED,IAAAA,wBAAW,EAACZ,SAASQ,EAAEW,IAAI;YACpD;QACF,EAAE,OAAOM,GAAG;YACV,OAAOrB,gBAAgBoB,IAAI,CAAChB;QAC9B;IACF;IAGF,OAAO;QACLkB,UAAUxB;QACVyB,SAASvB;IACX;AACF"}

View File

@ -0,0 +1 @@
export declare function getCacheDirectory(fileDirectory: string, envPath?: string): string;

View File

@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getCacheDirectory", {
enumerable: true,
get: function() {
return getCacheDirectory;
}
});
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function getCacheDirectory(fileDirectory, envPath) {
let result;
if (envPath) {
result = envPath;
} else {
let systemCacheDirectory;
if (process.platform === "linux") {
systemCacheDirectory = process.env.XDG_CACHE_HOME || _path.default.join(_os.default.homedir(), ".cache");
} else if (process.platform === "darwin") {
systemCacheDirectory = _path.default.join(_os.default.homedir(), "Library", "Caches");
} else if (process.platform === "win32") {
systemCacheDirectory = process.env.LOCALAPPDATA || _path.default.join(_os.default.homedir(), "AppData", "Local");
} else {
/// Attempt to use generic tmp location for un-handled platform
if (!systemCacheDirectory) {
for (const dir of [
_path.default.join(_os.default.homedir(), ".cache"),
_path.default.join(_os.default.tmpdir())
]){
if (_fs.default.existsSync(dir)) {
systemCacheDirectory = dir;
break;
}
}
}
if (!systemCacheDirectory) {
console.error(new Error("Unsupported platform: " + process.platform));
process.exit(0);
}
}
result = _path.default.join(systemCacheDirectory, fileDirectory);
}
if (!_path.default.isAbsolute(result)) {
// It is important to resolve to the absolute path:
// - for unzipping to work correctly;
// - so that registry directory matches between installation and execution.
// INIT_CWD points to the root of `npm/yarn install` and is probably what
// the user meant when typing the relative path.
result = _path.default.resolve(process.env["INIT_CWD"] || process.cwd(), result);
}
return result;
}
//# sourceMappingURL=get-cache-directory.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/helpers/get-cache-directory.ts"],"names":["getCacheDirectory","fileDirectory","envPath","result","systemCacheDirectory","process","platform","env","XDG_CACHE_HOME","path","join","os","homedir","LOCALAPPDATA","dir","tmpdir","fs","existsSync","console","error","Error","exit","isAbsolute","resolve","cwd"],"mappings":";;;;+BAMgBA;;;eAAAA;;;2DAND;6DACE;2DACF;;;;;;AAIR,SAASA,kBAAkBC,aAAqB,EAAEC,OAAgB;IACvE,IAAIC;IAEJ,IAAID,SAAS;QACXC,SAASD;IACX,OAAO;QACL,IAAIE;QACJ,IAAIC,QAAQC,QAAQ,KAAK,SAAS;YAChCF,uBACEC,QAAQE,GAAG,CAACC,cAAc,IAAIC,aAAI,CAACC,IAAI,CAACC,WAAE,CAACC,OAAO,IAAI;QAC1D,OAAO,IAAIP,QAAQC,QAAQ,KAAK,UAAU;YACxCF,uBAAuBK,aAAI,CAACC,IAAI,CAACC,WAAE,CAACC,OAAO,IAAI,WAAW;QAC5D,OAAO,IAAIP,QAAQC,QAAQ,KAAK,SAAS;YACvCF,uBACEC,QAAQE,GAAG,CAACM,YAAY,IAAIJ,aAAI,CAACC,IAAI,CAACC,WAAE,CAACC,OAAO,IAAI,WAAW;QACnE,OAAO;YACL,+DAA+D;YAC/D,IAAI,CAACR,sBAAsB;gBACzB,KAAK,MAAMU,OAAO;oBAChBL,aAAI,CAACC,IAAI,CAACC,WAAE,CAACC,OAAO,IAAI;oBACxBH,aAAI,CAACC,IAAI,CAACC,WAAE,CAACI,MAAM;iBACpB,CAAE;oBACD,IAAIC,WAAE,CAACC,UAAU,CAACH,MAAM;wBACtBV,uBAAuBU;wBACvB;oBACF;gBACF;YACF;YAEA,IAAI,CAACV,sBAAsB;gBACzBc,QAAQC,KAAK,CAAC,IAAIC,MAAM,2BAA2Bf,QAAQC,QAAQ;gBACnED,QAAQgB,IAAI,CAAC;YACf;QACF;QACAlB,SAASM,aAAI,CAACC,IAAI,CAACN,sBAAsBH;IAC3C;IAEA,IAAI,CAACQ,aAAI,CAACa,UAAU,CAACnB,SAAS;QAC5B,mDAAmD;QACnD,uCAAuC;QACvC,6EAA6E;QAC7E,yEAAyE;QACzE,gDAAgD;QAChDA,SAASM,aAAI,CAACc,OAAO,CAAClB,QAAQE,GAAG,CAAC,WAAW,IAAIF,QAAQmB,GAAG,IAAIrB;IAClE;IACA,OAAOA;AACT"}

View File

@ -0,0 +1 @@
export declare function getNpxCommand(baseDir: string): string;

Some files were not shown because too many files have changed in this diff Show More