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

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;

29
node_modules/next/dist/lib/helpers/get-npx-command.js generated vendored Normal file
View File

@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getNpxCommand", {
enumerable: true,
get: function() {
return getNpxCommand;
}
});
const _child_process = require("child_process");
const _getpkgmanager = require("./get-pkg-manager");
function getNpxCommand(baseDir) {
const pkgManager = (0, _getpkgmanager.getPkgManager)(baseDir);
let command = "npx";
if (pkgManager === "pnpm") {
command = "pnpm dlx";
} else if (pkgManager === "yarn") {
try {
(0, _child_process.execSync)("yarn dlx --help", {
stdio: "ignore"
});
command = "yarn dlx";
} catch {}
}
return command;
}
//# sourceMappingURL=get-npx-command.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/helpers/get-npx-command.ts"],"names":["getNpxCommand","baseDir","pkgManager","getPkgManager","command","execSync","stdio"],"mappings":";;;;+BAGgBA;;;eAAAA;;;+BAHS;+BACK;AAEvB,SAASA,cAAcC,OAAe;IAC3C,MAAMC,aAAaC,IAAAA,4BAAa,EAACF;IACjC,IAAIG,UAAU;IACd,IAAIF,eAAe,QAAQ;QACzBE,UAAU;IACZ,OAAO,IAAIF,eAAe,QAAQ;QAChC,IAAI;YACFG,IAAAA,uBAAQ,EAAC,mBAAmB;gBAAEC,OAAO;YAAS;YAC9CF,UAAU;QACZ,EAAE,OAAM,CAAC;IACX;IAEA,OAAOA;AACT"}

1
node_modules/next/dist/lib/helpers/get-online.d.ts generated vendored Normal file
View File

@ -0,0 +1 @@
export declare function getOnline(): Promise<boolean>;

50
node_modules/next/dist/lib/helpers/get-online.js generated vendored Normal file
View File

@ -0,0 +1,50 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getOnline", {
enumerable: true,
get: function() {
return getOnline;
}
});
const _child_process = require("child_process");
const _promises = /*#__PURE__*/ _interop_require_default(require("dns/promises"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function getProxy() {
if (process.env.https_proxy) {
return process.env.https_proxy;
}
try {
const httpsProxy = (0, _child_process.execSync)("npm config get https-proxy", {
encoding: "utf8"
}).trim();
return httpsProxy !== "null" ? httpsProxy : undefined;
} catch (e) {
return;
}
}
async function getOnline() {
try {
await _promises.default.lookup("registry.yarnpkg.com");
return true;
} catch {
const proxy = getProxy();
if (!proxy) {
return false;
}
try {
const { hostname } = new URL(proxy);
await _promises.default.lookup(hostname);
return true;
} catch {
return false;
}
}
}
//# sourceMappingURL=get-online.js.map

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

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/helpers/get-online.ts"],"names":["getOnline","getProxy","process","env","https_proxy","httpsProxy","execSync","encoding","trim","undefined","e","dns","lookup","proxy","hostname","URL"],"mappings":";;;;+BAkBsBA;;;eAAAA;;;+BAlBG;iEACT;;;;;;AAEhB,SAASC;IACP,IAAIC,QAAQC,GAAG,CAACC,WAAW,EAAE;QAC3B,OAAOF,QAAQC,GAAG,CAACC,WAAW;IAChC;IAEA,IAAI;QACF,MAAMC,aAAaC,IAAAA,uBAAQ,EAAC,8BAA8B;YACxDC,UAAU;QACZ,GAAGC,IAAI;QACP,OAAOH,eAAe,SAASA,aAAaI;IAC9C,EAAE,OAAOC,GAAG;QACV;IACF;AACF;AAEO,eAAeV;IACpB,IAAI;QACF,MAAMW,iBAAG,CAACC,MAAM,CAAC;QACjB,OAAO;IACT,EAAE,OAAM;QACN,MAAMC,QAAQZ;QACd,IAAI,CAACY,OAAO;YACV,OAAO;QACT;QAEA,IAAI;YACF,MAAM,EAAEC,QAAQ,EAAE,GAAG,IAAIC,IAAIF;YAC7B,MAAMF,iBAAG,CAACC,MAAM,CAACE;YACjB,OAAO;QACT,EAAE,OAAM;YACN,OAAO;QACT;IACF;AACF"}

View File

@ -0,0 +1,2 @@
export type PackageManager = 'npm' | 'pnpm' | 'yarn';
export declare function getPkgManager(baseDir: string): PackageManager;

63
node_modules/next/dist/lib/helpers/get-pkg-manager.js generated vendored Normal file
View File

@ -0,0 +1,63 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getPkgManager", {
enumerable: true,
get: function() {
return getPkgManager;
}
});
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
const _child_process = require("child_process");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function getPkgManager(baseDir) {
try {
for (const { lockFile, packageManager } of [
{
lockFile: "yarn.lock",
packageManager: "yarn"
},
{
lockFile: "pnpm-lock.yaml",
packageManager: "pnpm"
},
{
lockFile: "package-lock.json",
packageManager: "npm"
}
]){
if (_fs.default.existsSync(_path.default.join(baseDir, lockFile))) {
return packageManager;
}
}
const userAgent = process.env.npm_config_user_agent;
if (userAgent) {
if (userAgent.startsWith("yarn")) {
return "yarn";
} else if (userAgent.startsWith("pnpm")) {
return "pnpm";
}
}
try {
(0, _child_process.execSync)("yarn --version", {
stdio: "ignore"
});
return "yarn";
} catch {
(0, _child_process.execSync)("pnpm --version", {
stdio: "ignore"
});
return "pnpm";
}
} catch {
return "npm";
}
}
//# sourceMappingURL=get-pkg-manager.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/helpers/get-pkg-manager.ts"],"names":["getPkgManager","baseDir","lockFile","packageManager","fs","existsSync","path","join","userAgent","process","env","npm_config_user_agent","startsWith","execSync","stdio"],"mappings":";;;;+BAMgBA;;;eAAAA;;;2DAND;6DACE;+BACQ;;;;;;AAIlB,SAASA,cAAcC,OAAe;IAC3C,IAAI;QACF,KAAK,MAAM,EAAEC,QAAQ,EAAEC,cAAc,EAAE,IAAI;YACzC;gBAAED,UAAU;gBAAaC,gBAAgB;YAAO;YAChD;gBAAED,UAAU;gBAAkBC,gBAAgB;YAAO;YACrD;gBAAED,UAAU;gBAAqBC,gBAAgB;YAAM;SACxD,CAAE;YACD,IAAIC,WAAE,CAACC,UAAU,CAACC,aAAI,CAACC,IAAI,CAACN,SAASC,YAAY;gBAC/C,OAAOC;YACT;QACF;QACA,MAAMK,YAAYC,QAAQC,GAAG,CAACC,qBAAqB;QACnD,IAAIH,WAAW;YACb,IAAIA,UAAUI,UAAU,CAAC,SAAS;gBAChC,OAAO;YACT,OAAO,IAAIJ,UAAUI,UAAU,CAAC,SAAS;gBACvC,OAAO;YACT;QACF;QACA,IAAI;YACFC,IAAAA,uBAAQ,EAAC,kBAAkB;gBAAEC,OAAO;YAAS;YAC7C,OAAO;QACT,EAAE,OAAM;YACND,IAAAA,uBAAQ,EAAC,kBAAkB;gBAAEC,OAAO;YAAS;YAC7C,OAAO;QACT;IACF,EAAE,OAAM;QACN,OAAO;IACT;AACF"}

6
node_modules/next/dist/lib/helpers/get-registry.d.ts generated vendored Normal file
View File

@ -0,0 +1,6 @@
/**
* Returns the package registry using the user's package manager.
* The URL will have a trailing slash.
* @default https://registry.npmjs.org/
*/
export declare function getRegistry(baseDir?: string): string;

32
node_modules/next/dist/lib/helpers/get-registry.js generated vendored Normal file
View File

@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getRegistry", {
enumerable: true,
get: function() {
return getRegistry;
}
});
const _child_process = require("child_process");
const _getpkgmanager = require("./get-pkg-manager");
const _utils = require("../../server/lib/utils");
function getRegistry(baseDir = process.cwd()) {
let registry = `https://registry.npmjs.org/`;
try {
const pkgManager = (0, _getpkgmanager.getPkgManager)(baseDir);
const output = (0, _child_process.execSync)(`${pkgManager} config get registry`, {
env: {
...process.env,
NODE_OPTIONS: (0, _utils.getNodeOptionsWithoutInspect)()
}
}).toString().trim();
if (output.startsWith("http")) {
registry = output.endsWith("/") ? output : `${output}/`;
}
} finally{
return registry;
}
}
//# sourceMappingURL=get-registry.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/helpers/get-registry.ts"],"names":["getRegistry","baseDir","process","cwd","registry","pkgManager","getPkgManager","output","execSync","env","NODE_OPTIONS","getNodeOptionsWithoutInspect","toString","trim","startsWith","endsWith"],"mappings":";;;;+BASgBA;;;eAAAA;;;+BATS;+BACK;uBACe;AAOtC,SAASA,YAAYC,UAAkBC,QAAQC,GAAG,EAAE;IACzD,IAAIC,WAAW,CAAC,2BAA2B,CAAC;IAC5C,IAAI;QACF,MAAMC,aAAaC,IAAAA,4BAAa,EAACL;QACjC,MAAMM,SAASC,IAAAA,uBAAQ,EAAC,CAAC,EAAEH,WAAW,oBAAoB,CAAC,EAAE;YAC3DI,KAAK;gBACH,GAAGP,QAAQO,GAAG;gBACdC,cAAcC,IAAAA,mCAA4B;YAC5C;QACF,GACGC,QAAQ,GACRC,IAAI;QAEP,IAAIN,OAAOO,UAAU,CAAC,SAAS;YAC7BV,WAAWG,OAAOQ,QAAQ,CAAC,OAAOR,SAAS,CAAC,EAAEA,OAAO,CAAC,CAAC;QACzD;IACF,SAAU;QACR,OAAOH;IACT;AACF"}

View File

@ -0,0 +1,87 @@
/** https://fetch.spec.whatwg.org/#port-blocking */
export declare const KNOWN_RESERVED_PORTS: {
readonly 1: "tcpmux";
readonly 7: "echo";
readonly 9: "discard";
readonly 11: "systat";
readonly 13: "daytime";
readonly 15: "netstat";
readonly 17: "qotd";
readonly 19: "chargen";
readonly 20: "ftp-data";
readonly 21: "ftp";
readonly 22: "ssh";
readonly 23: "telnet";
readonly 25: "smtp";
readonly 37: "time";
readonly 42: "name";
readonly 43: "nicname";
readonly 53: "domain";
readonly 69: "tftp";
readonly 77: "rje";
readonly 79: "finger";
readonly 87: "link";
readonly 95: "supdup";
readonly 101: "hostname";
readonly 102: "iso-tsap";
readonly 103: "gppitnp";
readonly 104: "acr-nema";
readonly 109: "pop2";
readonly 110: "pop3";
readonly 111: "sunrpc";
readonly 113: "auth";
readonly 115: "sftp";
readonly 117: "uucp-path";
readonly 119: "nntp";
readonly 123: "ntp";
readonly 135: "epmap";
readonly 137: "netbios-ns";
readonly 139: "netbios-ssn";
readonly 143: "imap";
readonly 161: "snmp";
readonly 179: "bgp";
readonly 389: "ldap";
readonly 427: "svrloc";
readonly 465: "submissions";
readonly 512: "exec";
readonly 513: "login";
readonly 514: "shell";
readonly 515: "printer";
readonly 526: "tempo";
readonly 530: "courier";
readonly 531: "chat";
readonly 532: "netnews";
readonly 540: "uucp";
readonly 548: "afp";
readonly 554: "rtsp";
readonly 556: "remotefs";
readonly 563: "nntps";
readonly 587: "submission";
readonly 601: "syslog-conn";
readonly 636: "ldaps";
readonly 989: "ftps-data";
readonly 990: "ftps";
readonly 993: "imaps";
readonly 995: "pop3s";
readonly 1719: "h323gatestat";
readonly 1720: "h323hostcall";
readonly 1723: "pptp";
readonly 2049: "nfs";
readonly 3659: "apple-sasl";
readonly 4045: "npp";
readonly 5060: "sip";
readonly 5061: "sips";
readonly 6000: "x11";
readonly 6566: "sane-port";
readonly 6665: "ircu";
readonly 6666: "ircu";
readonly 6667: "ircu";
readonly 6668: "ircu";
readonly 6669: "ircu";
readonly 6697: "ircs-u";
readonly 10080: "amanda";
};
type ReservedPort = keyof typeof KNOWN_RESERVED_PORTS;
export declare function isPortIsReserved(port: number): port is ReservedPort;
export declare function getReservedPortExplanation(port: ReservedPort): string;
export {};

116
node_modules/next/dist/lib/helpers/get-reserved-port.js generated vendored Normal file
View File

@ -0,0 +1,116 @@
/** https://fetch.spec.whatwg.org/#port-blocking */ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
KNOWN_RESERVED_PORTS: null,
getReservedPortExplanation: null,
isPortIsReserved: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
KNOWN_RESERVED_PORTS: function() {
return KNOWN_RESERVED_PORTS;
},
getReservedPortExplanation: function() {
return getReservedPortExplanation;
},
isPortIsReserved: function() {
return isPortIsReserved;
}
});
const KNOWN_RESERVED_PORTS = {
1: "tcpmux",
7: "echo",
9: "discard",
11: "systat",
13: "daytime",
15: "netstat",
17: "qotd",
19: "chargen",
20: "ftp-data",
21: "ftp",
22: "ssh",
23: "telnet",
25: "smtp",
37: "time",
42: "name",
43: "nicname",
53: "domain",
69: "tftp",
77: "rje",
79: "finger",
87: "link",
95: "supdup",
101: "hostname",
102: "iso-tsap",
103: "gppitnp",
104: "acr-nema",
109: "pop2",
110: "pop3",
111: "sunrpc",
113: "auth",
115: "sftp",
117: "uucp-path",
119: "nntp",
123: "ntp",
135: "epmap",
137: "netbios-ns",
139: "netbios-ssn",
143: "imap",
161: "snmp",
179: "bgp",
389: "ldap",
427: "svrloc",
465: "submissions",
512: "exec",
513: "login",
514: "shell",
515: "printer",
526: "tempo",
530: "courier",
531: "chat",
532: "netnews",
540: "uucp",
548: "afp",
554: "rtsp",
556: "remotefs",
563: "nntps",
587: "submission",
601: "syslog-conn",
636: "ldaps",
989: "ftps-data",
990: "ftps",
993: "imaps",
995: "pop3s",
1719: "h323gatestat",
1720: "h323hostcall",
1723: "pptp",
2049: "nfs",
3659: "apple-sasl",
4045: "npp",
5060: "sip",
5061: "sips",
6000: "x11",
6566: "sane-port",
6665: "ircu",
6666: "ircu",
6667: "ircu",
6668: "ircu",
6669: "ircu",
6697: "ircs-u",
10080: "amanda"
};
function isPortIsReserved(port) {
return port in KNOWN_RESERVED_PORTS;
}
function getReservedPortExplanation(port) {
return `Bad port: "${port}" is reserved for ${KNOWN_RESERVED_PORTS[port]}\n` + "Read more: https://nextjs.org/docs/messages/reserved-port";
}
//# sourceMappingURL=get-reserved-port.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/helpers/get-reserved-port.ts"],"names":["KNOWN_RESERVED_PORTS","getReservedPortExplanation","isPortIsReserved","port"],"mappings":"AAAA,iDAAiD;;;;;;;;;;;;;;;;IACpCA,oBAAoB;eAApBA;;IAyFGC,0BAA0B;eAA1BA;;IAJAC,gBAAgB;eAAhBA;;;AArFT,MAAMF,uBAAuB;IAClC,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;AACT;AAIO,SAASE,iBAAiBC,IAAY;IAC3C,OAAOA,QAAQH;AACjB;AAEO,SAASC,2BAA2BE,IAAkB;IAC3D,OACE,CAAC,WAAW,EAAEA,KAAK,kBAAkB,EAAEH,oBAAoB,CAACG,KAAK,CAAC,EAAE,CAAC,GACrE;AAEJ"}

22
node_modules/next/dist/lib/helpers/install.d.ts generated vendored Normal file
View File

@ -0,0 +1,22 @@
export type PackageManager = 'npm' | 'pnpm' | 'yarn';
interface InstallArgs {
/**
* Indicate whether to install packages using npm, pnpm or Yarn.
*/
packageManager: PackageManager;
/**
* Indicate whether there is an active Internet connection.
*/
isOnline: boolean;
/**
* Indicate whether the given dependencies are devDependencies.
*/
devDependencies?: boolean;
}
/**
* Spawn a package manager installation with either Yarn or NPM.
*
* @returns A Promise that resolves once the installation is finished.
*/
export declare function install(root: string, dependencies: string[] | null, { packageManager, isOnline, devDependencies }: InstallArgs): Promise<void>;
export {};

105
node_modules/next/dist/lib/helpers/install.js generated vendored Normal file
View File

@ -0,0 +1,105 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "install", {
enumerable: true,
get: function() {
return install;
}
});
const _picocolors = require("../picocolors");
const _crossspawn = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/cross-spawn"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function install(root, dependencies, { packageManager, isOnline, devDependencies }) {
/**
* (p)npm-specific command-line flags.
*/ const npmFlags = [];
/**
* Yarn-specific command-line flags.
*/ const yarnFlags = [];
/**
* Return a Promise that resolves once the installation is finished.
*/ return new Promise((resolve, reject)=>{
let args;
let command = packageManager;
const useYarn = packageManager === "yarn";
if (dependencies && dependencies.length) {
/**
* If there are dependencies, run a variation of `{packageManager} add`.
*/ if (useYarn) {
/**
* Call `yarn add --exact (--offline)? (-D)? ...`.
*/ args = [
"add",
"--exact"
];
if (!isOnline) args.push("--offline");
args.push("--cwd", root);
if (devDependencies) args.push("--dev");
args.push(...dependencies);
} else {
/**
* Call `(p)npm install [--save|--save-dev] ...`.
*/ args = [
"install",
"--save-exact"
];
args.push(devDependencies ? "--save-dev" : "--save");
args.push(...dependencies);
}
} else {
/**
* If there are no dependencies, run a variation of `{packageManager}
* install`.
*/ args = [
"install"
];
if (!isOnline) {
console.log((0, _picocolors.yellow)("You appear to be offline."));
if (useYarn) {
console.log((0, _picocolors.yellow)("Falling back to the local Yarn cache."));
console.log();
args.push("--offline");
} else {
console.log();
}
}
}
/**
* Add any package manager-specific flags.
*/ if (useYarn) {
args.push(...yarnFlags);
} else {
args.push(...npmFlags);
}
/**
* Spawn the installation process.
*/ const child = (0, _crossspawn.default)(command, args, {
stdio: "inherit",
env: {
...process.env,
ADBLOCK: "1",
// we set NODE_ENV to development as pnpm skips dev
// dependencies when production
NODE_ENV: "development",
DISABLE_OPENCOLLECTIVE: "1"
}
});
child.on("close", (code)=>{
if (code !== 0) {
reject({
command: `${command} ${args.join(" ")}`
});
return;
}
resolve();
});
});
}
//# sourceMappingURL=install.js.map

1
node_modules/next/dist/lib/helpers/install.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/helpers/install.ts"],"names":["install","root","dependencies","packageManager","isOnline","devDependencies","npmFlags","yarnFlags","Promise","resolve","reject","args","command","useYarn","length","push","console","log","yellow","child","spawn","stdio","env","process","ADBLOCK","NODE_ENV","DISABLE_OPENCOLLECTIVE","on","code","join"],"mappings":";;;;+BAyBgBA;;;eAAAA;;;4BAzBO;mEACL;;;;;;AAwBX,SAASA,QACdC,IAAY,EACZC,YAA6B,EAC7B,EAAEC,cAAc,EAAEC,QAAQ,EAAEC,eAAe,EAAe;IAE1D;;GAEC,GACD,MAAMC,WAAqB,EAAE;IAC7B;;GAEC,GACD,MAAMC,YAAsB,EAAE;IAC9B;;GAEC,GACD,OAAO,IAAIC,QAAQ,CAACC,SAASC;QAC3B,IAAIC;QACJ,IAAIC,UAAUT;QACd,MAAMU,UAAUV,mBAAmB;QAEnC,IAAID,gBAAgBA,aAAaY,MAAM,EAAE;YACvC;;OAEC,GACD,IAAID,SAAS;gBACX;;SAEC,GACDF,OAAO;oBAAC;oBAAO;iBAAU;gBACzB,IAAI,CAACP,UAAUO,KAAKI,IAAI,CAAC;gBACzBJ,KAAKI,IAAI,CAAC,SAASd;gBACnB,IAAII,iBAAiBM,KAAKI,IAAI,CAAC;gBAC/BJ,KAAKI,IAAI,IAAIb;YACf,OAAO;gBACL;;SAEC,GACDS,OAAO;oBAAC;oBAAW;iBAAe;gBAClCA,KAAKI,IAAI,CAACV,kBAAkB,eAAe;gBAC3CM,KAAKI,IAAI,IAAIb;YACf;QACF,OAAO;YACL;;;OAGC,GACDS,OAAO;gBAAC;aAAU;YAClB,IAAI,CAACP,UAAU;gBACbY,QAAQC,GAAG,CAACC,IAAAA,kBAAM,EAAC;gBACnB,IAAIL,SAAS;oBACXG,QAAQC,GAAG,CAACC,IAAAA,kBAAM,EAAC;oBACnBF,QAAQC,GAAG;oBACXN,KAAKI,IAAI,CAAC;gBACZ,OAAO;oBACLC,QAAQC,GAAG;gBACb;YACF;QACF;QACA;;KAEC,GACD,IAAIJ,SAAS;YACXF,KAAKI,IAAI,IAAIR;QACf,OAAO;YACLI,KAAKI,IAAI,IAAIT;QACf;QACA;;KAEC,GACD,MAAMa,QAAQC,IAAAA,mBAAK,EAACR,SAASD,MAAM;YACjCU,OAAO;YACPC,KAAK;gBACH,GAAGC,QAAQD,GAAG;gBACdE,SAAS;gBACT,mDAAmD;gBACnD,+BAA+B;gBAC/BC,UAAU;gBACVC,wBAAwB;YAC1B;QACF;QACAP,MAAMQ,EAAE,CAAC,SAAS,CAACC;YACjB,IAAIA,SAAS,GAAG;gBACdlB,OAAO;oBAAEE,SAAS,CAAC,EAAEA,QAAQ,CAAC,EAAED,KAAKkB,IAAI,CAAC,KAAK,CAAC;gBAAC;gBACjD;YACF;YACApB;QACF;IACF;AACF"}