feat(blog): add file-based blog with dynamic slugs, MDX content and layout shell
- Introduced blog routing using Next.js App Router - Implemented dynamic [slug] pages for blog posts - Added MDX-based content loading via lib/posts - Integrated shared TopBar layout with navigation - Established clear content, lib and component separation
This commit is contained in:
1
apps/public-web/node_modules/next/dist/lib/helpers/get-cache-directory.d.ts
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/lib/helpers/get-cache-directory.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function getCacheDirectory(fileDirectory: string, envPath?: string): string;
|
||||
66
apps/public-web/node_modules/next/dist/lib/helpers/get-cache-directory.js
generated
vendored
Normal file
66
apps/public-web/node_modules/next/dist/lib/helpers/get-cache-directory.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
"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(Object.defineProperty(new Error('Unsupported platform: ' + process.platform), "__NEXT_ERROR_CODE", {
|
||||
value: "E141",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
}));
|
||||
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
|
||||
1
apps/public-web/node_modules/next/dist/lib/helpers/get-cache-directory.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/lib/helpers/get-cache-directory.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/lib/helpers/get-cache-directory.ts"],"sourcesContent":["import os from 'os'\nimport path from 'path'\nimport fs from 'fs'\n\n// get platform specific cache directory adapted from playwright's handling\n// https://github.com/microsoft/playwright/blob/7d924470d397975a74a19184c136b3573a974e13/packages/playwright-core/src/utils/registry.ts#L141\nexport function getCacheDirectory(fileDirectory: string, envPath?: string) {\n let result\n\n if (envPath) {\n result = envPath\n } else {\n let systemCacheDirectory\n if (process.platform === 'linux') {\n systemCacheDirectory =\n process.env.XDG_CACHE_HOME || path.join(os.homedir(), '.cache')\n } else if (process.platform === 'darwin') {\n systemCacheDirectory = path.join(os.homedir(), 'Library', 'Caches')\n } else if (process.platform === 'win32') {\n systemCacheDirectory =\n process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local')\n } else {\n /// Attempt to use generic tmp location for un-handled platform\n if (!systemCacheDirectory) {\n for (const dir of [\n path.join(os.homedir(), '.cache'),\n path.join(os.tmpdir()),\n ]) {\n if (fs.existsSync(dir)) {\n systemCacheDirectory = dir\n break\n }\n }\n }\n\n if (!systemCacheDirectory) {\n console.error(new Error('Unsupported platform: ' + process.platform))\n process.exit(0)\n }\n }\n result = path.join(systemCacheDirectory, fileDirectory)\n }\n\n if (!path.isAbsolute(result)) {\n // It is important to resolve to the absolute path:\n // - for unzipping to work correctly;\n // - so that registry directory matches between installation and execution.\n // INIT_CWD points to the root of `npm/yarn install` and is probably what\n // the user meant when typing the relative path.\n result = path.resolve(process.env['INIT_CWD'] || process.cwd(), result)\n }\n return result\n}\n"],"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,qBAAsD,CAAtD,IAAIC,MAAM,2BAA2Bf,QAAQC,QAAQ,GAArD,qBAAA;2BAAA;gCAAA;kCAAA;gBAAqD;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","ignoreList":[0]}
|
||||
1
apps/public-web/node_modules/next/dist/lib/helpers/get-npx-command.d.ts
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/lib/helpers/get-npx-command.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function getNpxCommand(baseDir: string): string;
|
||||
29
apps/public-web/node_modules/next/dist/lib/helpers/get-npx-command.js
generated
vendored
Normal file
29
apps/public-web/node_modules/next/dist/lib/helpers/get-npx-command.js
generated
vendored
Normal 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 --yes';
|
||||
if (pkgManager === 'pnpm') {
|
||||
command = 'pnpm --silent dlx';
|
||||
} else if (pkgManager === 'yarn') {
|
||||
try {
|
||||
(0, _child_process.execSync)('yarn dlx --help', {
|
||||
stdio: 'ignore'
|
||||
});
|
||||
command = 'yarn --quiet dlx';
|
||||
} catch {}
|
||||
}
|
||||
return command;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=get-npx-command.js.map
|
||||
1
apps/public-web/node_modules/next/dist/lib/helpers/get-npx-command.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/lib/helpers/get-npx-command.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/lib/helpers/get-npx-command.ts"],"sourcesContent":["import { execSync } from 'child_process'\nimport { getPkgManager } from './get-pkg-manager'\n\nexport function getNpxCommand(baseDir: string) {\n const pkgManager = getPkgManager(baseDir)\n let command = 'npx --yes'\n if (pkgManager === 'pnpm') {\n command = 'pnpm --silent dlx'\n } else if (pkgManager === 'yarn') {\n try {\n execSync('yarn dlx --help', { stdio: 'ignore' })\n command = 'yarn --quiet dlx'\n } catch {}\n }\n\n return command\n}\n"],"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","ignoreList":[0]}
|
||||
1
apps/public-web/node_modules/next/dist/lib/helpers/get-online.d.ts
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/lib/helpers/get-online.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function getOnline(): Promise<boolean>;
|
||||
50
apps/public-web/node_modules/next/dist/lib/helpers/get-online.js
generated
vendored
Normal file
50
apps/public-web/node_modules/next/dist/lib/helpers/get-online.js
generated
vendored
Normal 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
apps/public-web/node_modules/next/dist/lib/helpers/get-online.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/lib/helpers/get-online.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/lib/helpers/get-online.ts"],"sourcesContent":["import { execSync } from 'child_process'\nimport dns from 'dns/promises'\n\nfunction getProxy(): string | undefined {\n if (process.env.https_proxy) {\n return process.env.https_proxy\n }\n\n try {\n const httpsProxy = execSync('npm config get https-proxy', {\n encoding: 'utf8',\n }).trim()\n return httpsProxy !== 'null' ? httpsProxy : undefined\n } catch (e) {\n return\n }\n}\n\nexport async function getOnline(): Promise<boolean> {\n try {\n await dns.lookup('registry.yarnpkg.com')\n return true\n } catch {\n const proxy = getProxy()\n if (!proxy) {\n return false\n }\n\n try {\n const { hostname } = new URL(proxy)\n await dns.lookup(hostname)\n return true\n } catch {\n return false\n }\n }\n}\n"],"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","ignoreList":[0]}
|
||||
2
apps/public-web/node_modules/next/dist/lib/helpers/get-pkg-manager.d.ts
generated
vendored
Normal file
2
apps/public-web/node_modules/next/dist/lib/helpers/get-pkg-manager.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export type PackageManager = 'npm' | 'pnpm' | 'yarn';
|
||||
export declare function getPkgManager(baseDir: string): PackageManager;
|
||||
63
apps/public-web/node_modules/next/dist/lib/helpers/get-pkg-manager.js
generated
vendored
Normal file
63
apps/public-web/node_modules/next/dist/lib/helpers/get-pkg-manager.js
generated
vendored
Normal 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
|
||||
1
apps/public-web/node_modules/next/dist/lib/helpers/get-pkg-manager.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/lib/helpers/get-pkg-manager.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/lib/helpers/get-pkg-manager.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\nimport { execSync } from 'child_process'\n\nexport type PackageManager = 'npm' | 'pnpm' | 'yarn'\n\nexport function getPkgManager(baseDir: string): PackageManager {\n try {\n for (const { lockFile, packageManager } of [\n { lockFile: 'yarn.lock', packageManager: 'yarn' },\n { lockFile: 'pnpm-lock.yaml', packageManager: 'pnpm' },\n { lockFile: 'package-lock.json', packageManager: 'npm' },\n ]) {\n if (fs.existsSync(path.join(baseDir, lockFile))) {\n return packageManager as PackageManager\n }\n }\n const userAgent = process.env.npm_config_user_agent\n if (userAgent) {\n if (userAgent.startsWith('yarn')) {\n return 'yarn'\n } else if (userAgent.startsWith('pnpm')) {\n return 'pnpm'\n }\n }\n try {\n execSync('yarn --version', { stdio: 'ignore' })\n return 'yarn'\n } catch {\n execSync('pnpm --version', { stdio: 'ignore' })\n return 'pnpm'\n }\n } catch {\n return 'npm'\n }\n}\n"],"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","ignoreList":[0]}
|
||||
6
apps/public-web/node_modules/next/dist/lib/helpers/get-registry.d.ts
generated
vendored
Normal file
6
apps/public-web/node_modules/next/dist/lib/helpers/get-registry.d.ts
generated
vendored
Normal 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;
|
||||
45
apps/public-web/node_modules/next/dist/lib/helpers/get-registry.js
generated
vendored
Normal file
45
apps/public-web/node_modules/next/dist/lib/helpers/get-registry.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"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()) {
|
||||
const pkgManager = (0, _getpkgmanager.getPkgManager)(baseDir);
|
||||
// Since `npm config` command fails in npm workspace to prevent workspace config conflicts,
|
||||
// add `--no-workspaces` flag to run under the context of the root project only.
|
||||
// Safe for non-workspace projects as it's equivalent to default `--workspaces=false`.
|
||||
// x-ref: https://github.com/vercel/next.js/issues/47121#issuecomment-1499044345
|
||||
// x-ref: https://github.com/npm/statusboard/issues/371#issue-920669998
|
||||
const resolvedFlags = pkgManager === 'npm' ? '--no-workspaces' : '';
|
||||
let registry = `https://registry.npmjs.org/`;
|
||||
try {
|
||||
const output = (0, _child_process.execSync)(`${pkgManager} config get registry ${resolvedFlags}`, {
|
||||
env: {
|
||||
...process.env,
|
||||
NODE_OPTIONS: (0, _utils.getFormattedNodeOptionsWithoutInspect)()
|
||||
}
|
||||
}).toString().trim();
|
||||
if (output.startsWith('http')) {
|
||||
registry = output.endsWith('/') ? output : `${output}/`;
|
||||
}
|
||||
} catch (err) {
|
||||
throw Object.defineProperty(new Error(`Failed to get registry from "${pkgManager}".`, {
|
||||
cause: err
|
||||
}), "__NEXT_ERROR_CODE", {
|
||||
value: "E508",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
return registry;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=get-registry.js.map
|
||||
1
apps/public-web/node_modules/next/dist/lib/helpers/get-registry.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/lib/helpers/get-registry.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/lib/helpers/get-registry.ts"],"sourcesContent":["import { execSync } from 'child_process'\nimport { getPkgManager } from './get-pkg-manager'\nimport { getFormattedNodeOptionsWithoutInspect } from '../../server/lib/utils'\n\n/**\n * Returns the package registry using the user's package manager.\n * The URL will have a trailing slash.\n * @default https://registry.npmjs.org/\n */\nexport function getRegistry(baseDir: string = process.cwd()) {\n const pkgManager = getPkgManager(baseDir)\n // Since `npm config` command fails in npm workspace to prevent workspace config conflicts,\n // add `--no-workspaces` flag to run under the context of the root project only.\n // Safe for non-workspace projects as it's equivalent to default `--workspaces=false`.\n // x-ref: https://github.com/vercel/next.js/issues/47121#issuecomment-1499044345\n // x-ref: https://github.com/npm/statusboard/issues/371#issue-920669998\n const resolvedFlags = pkgManager === 'npm' ? '--no-workspaces' : ''\n let registry = `https://registry.npmjs.org/`\n\n try {\n const output = execSync(\n `${pkgManager} config get registry ${resolvedFlags}`,\n {\n env: {\n ...process.env,\n NODE_OPTIONS: getFormattedNodeOptionsWithoutInspect(),\n },\n }\n )\n .toString()\n .trim()\n\n if (output.startsWith('http')) {\n registry = output.endsWith('/') ? output : `${output}/`\n }\n } catch (err) {\n throw new Error(`Failed to get registry from \"${pkgManager}\".`, {\n cause: err,\n })\n }\n\n return registry\n}\n"],"names":["getRegistry","baseDir","process","cwd","pkgManager","getPkgManager","resolvedFlags","registry","output","execSync","env","NODE_OPTIONS","getFormattedNodeOptionsWithoutInspect","toString","trim","startsWith","endsWith","err","Error","cause"],"mappings":";;;;+BASgBA;;;eAAAA;;;+BATS;+BACK;uBACwB;AAO/C,SAASA,YAAYC,UAAkBC,QAAQC,GAAG,EAAE;IACzD,MAAMC,aAAaC,IAAAA,4BAAa,EAACJ;IACjC,2FAA2F;IAC3F,gFAAgF;IAChF,sFAAsF;IACtF,gFAAgF;IAChF,uEAAuE;IACvE,MAAMK,gBAAgBF,eAAe,QAAQ,oBAAoB;IACjE,IAAIG,WAAW,CAAC,2BAA2B,CAAC;IAE5C,IAAI;QACF,MAAMC,SAASC,IAAAA,uBAAQ,EACrB,GAAGL,WAAW,qBAAqB,EAAEE,eAAe,EACpD;YACEI,KAAK;gBACH,GAAGR,QAAQQ,GAAG;gBACdC,cAAcC,IAAAA,4CAAqC;YACrD;QACF,GAECC,QAAQ,GACRC,IAAI;QAEP,IAAIN,OAAOO,UAAU,CAAC,SAAS;YAC7BR,WAAWC,OAAOQ,QAAQ,CAAC,OAAOR,SAAS,GAAGA,OAAO,CAAC,CAAC;QACzD;IACF,EAAE,OAAOS,KAAK;QACZ,MAAM,qBAEJ,CAFI,IAAIC,MAAM,CAAC,6BAA6B,EAAEd,WAAW,EAAE,CAAC,EAAE;YAC9De,OAAOF;QACT,IAFM,qBAAA;mBAAA;wBAAA;0BAAA;QAEL;IACH;IAEA,OAAOV;AACT","ignoreList":[0]}
|
||||
87
apps/public-web/node_modules/next/dist/lib/helpers/get-reserved-port.d.ts
generated
vendored
Normal file
87
apps/public-web/node_modules/next/dist/lib/helpers/get-reserved-port.d.ts
generated
vendored
Normal 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
apps/public-web/node_modules/next/dist/lib/helpers/get-reserved-port.js
generated
vendored
Normal file
116
apps/public-web/node_modules/next/dist/lib/helpers/get-reserved-port.js
generated
vendored
Normal 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
|
||||
1
apps/public-web/node_modules/next/dist/lib/helpers/get-reserved-port.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/lib/helpers/get-reserved-port.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/lib/helpers/get-reserved-port.ts"],"sourcesContent":["/** https://fetch.spec.whatwg.org/#port-blocking */\nexport const KNOWN_RESERVED_PORTS = {\n 1: 'tcpmux',\n 7: 'echo',\n 9: 'discard',\n 11: 'systat',\n 13: 'daytime',\n 15: 'netstat',\n 17: 'qotd',\n 19: 'chargen',\n 20: 'ftp-data',\n 21: 'ftp',\n 22: 'ssh',\n 23: 'telnet',\n 25: 'smtp',\n 37: 'time',\n 42: 'name',\n 43: 'nicname',\n 53: 'domain',\n 69: 'tftp',\n 77: 'rje',\n 79: 'finger',\n 87: 'link',\n 95: 'supdup',\n 101: 'hostname',\n 102: 'iso-tsap',\n 103: 'gppitnp',\n 104: 'acr-nema',\n 109: 'pop2',\n 110: 'pop3',\n 111: 'sunrpc',\n 113: 'auth',\n 115: 'sftp',\n 117: 'uucp-path',\n 119: 'nntp',\n 123: 'ntp',\n 135: 'epmap',\n 137: 'netbios-ns',\n 139: 'netbios-ssn',\n 143: 'imap',\n 161: 'snmp',\n 179: 'bgp',\n 389: 'ldap',\n 427: 'svrloc',\n 465: 'submissions',\n 512: 'exec',\n 513: 'login',\n 514: 'shell',\n 515: 'printer',\n 526: 'tempo',\n 530: 'courier',\n 531: 'chat',\n 532: 'netnews',\n 540: 'uucp',\n 548: 'afp',\n 554: 'rtsp',\n 556: 'remotefs',\n 563: 'nntps',\n 587: 'submission',\n 601: 'syslog-conn',\n 636: 'ldaps',\n 989: 'ftps-data',\n 990: 'ftps',\n 993: 'imaps',\n 995: 'pop3s',\n 1719: 'h323gatestat',\n 1720: 'h323hostcall',\n 1723: 'pptp',\n 2049: 'nfs',\n 3659: 'apple-sasl',\n 4045: 'npp',\n 5060: 'sip',\n 5061: 'sips',\n 6000: 'x11',\n 6566: 'sane-port',\n 6665: 'ircu',\n 6666: 'ircu',\n 6667: 'ircu',\n 6668: 'ircu',\n 6669: 'ircu',\n 6697: 'ircs-u',\n 10080: 'amanda',\n} as const\n\ntype ReservedPort = keyof typeof KNOWN_RESERVED_PORTS\n\nexport function isPortIsReserved(port: number): port is ReservedPort {\n return port in KNOWN_RESERVED_PORTS\n}\n\nexport function getReservedPortExplanation(port: ReservedPort): string {\n return (\n `Bad port: \"${port}\" is reserved for ${KNOWN_RESERVED_PORTS[port]}\\n` +\n 'Read more: https://nextjs.org/docs/messages/reserved-port'\n )\n}\n"],"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","ignoreList":[0]}
|
||||
22
apps/public-web/node_modules/next/dist/lib/helpers/install.d.ts
generated
vendored
Normal file
22
apps/public-web/node_modules/next/dist/lib/helpers/install.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { PackageManager } from './get-pkg-manager';
|
||||
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 npm, pnpm, or yarn.
|
||||
*
|
||||
* @returns A Promise that resolves once the installation is finished.
|
||||
*/
|
||||
export declare function install(root: string, dependencies: string[], { packageManager, isOnline, devDependencies }: InstallArgs): Promise<void>;
|
||||
export {};
|
||||
83
apps/public-web/node_modules/next/dist/lib/helpers/install.js
generated
vendored
Normal file
83
apps/public-web/node_modules/next/dist/lib/helpers/install.js
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
"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 }) {
|
||||
let args = [];
|
||||
if (dependencies.length > 0) {
|
||||
if (packageManager === 'yarn') {
|
||||
args = [
|
||||
'add',
|
||||
'--exact'
|
||||
];
|
||||
if (devDependencies) args.push('--dev');
|
||||
} else if (packageManager === 'pnpm') {
|
||||
args = [
|
||||
'add',
|
||||
'--save-exact'
|
||||
];
|
||||
args.push(devDependencies ? '--save-dev' : '--save-prod');
|
||||
} else {
|
||||
// npm
|
||||
args = [
|
||||
'install',
|
||||
'--save-exact'
|
||||
];
|
||||
args.push(devDependencies ? '--save-dev' : '--save');
|
||||
}
|
||||
args.push(...dependencies);
|
||||
} else {
|
||||
args = [
|
||||
'install'
|
||||
] // npm, pnpm, and yarn all support `install`
|
||||
;
|
||||
if (!isOnline) {
|
||||
args.push('--offline');
|
||||
console.log((0, _picocolors.yellow)('You appear to be offline.'));
|
||||
if (packageManager !== 'npm') {
|
||||
console.log((0, _picocolors.yellow)(`Falling back to the local ${packageManager} cache.`));
|
||||
}
|
||||
console.log();
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject)=>{
|
||||
/**
|
||||
* Spawn the installation process.
|
||||
*/ const child = (0, _crossspawn.default)(packageManager, args, {
|
||||
cwd: root,
|
||||
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: `${packageManager} ${args.join(' ')}`
|
||||
});
|
||||
return;
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=install.js.map
|
||||
1
apps/public-web/node_modules/next/dist/lib/helpers/install.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/lib/helpers/install.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/lib/helpers/install.ts"],"sourcesContent":["import { yellow } from '../picocolors'\nimport spawn from 'next/dist/compiled/cross-spawn'\nimport type { PackageManager } from './get-pkg-manager'\n\ninterface InstallArgs {\n /**\n * Indicate whether to install packages using npm, pnpm, or yarn.\n */\n packageManager: PackageManager\n /**\n * Indicate whether there is an active internet connection.\n */\n isOnline: boolean\n /**\n * Indicate whether the given dependencies are devDependencies.\n */\n devDependencies?: boolean\n}\n\n/**\n * Spawn a package manager installation with either npm, pnpm, or yarn.\n *\n * @returns A Promise that resolves once the installation is finished.\n */\nexport function install(\n root: string,\n dependencies: string[],\n { packageManager, isOnline, devDependencies }: InstallArgs\n): Promise<void> {\n let args: string[] = []\n\n if (dependencies.length > 0) {\n if (packageManager === 'yarn') {\n args = ['add', '--exact']\n if (devDependencies) args.push('--dev')\n } else if (packageManager === 'pnpm') {\n args = ['add', '--save-exact']\n args.push(devDependencies ? '--save-dev' : '--save-prod')\n } else {\n // npm\n args = ['install', '--save-exact']\n args.push(devDependencies ? '--save-dev' : '--save')\n }\n\n args.push(...dependencies)\n } else {\n args = ['install'] // npm, pnpm, and yarn all support `install`\n\n if (!isOnline) {\n args.push('--offline')\n console.log(yellow('You appear to be offline.'))\n if (packageManager !== 'npm') {\n console.log(\n yellow(`Falling back to the local ${packageManager} cache.`)\n )\n }\n console.log()\n }\n }\n\n return new Promise((resolve, reject) => {\n /**\n * Spawn the installation process.\n */\n const child = spawn(packageManager, args, {\n cwd: root,\n stdio: 'inherit',\n env: {\n ...process.env,\n ADBLOCK: '1',\n // we set NODE_ENV to development as pnpm skips dev\n // dependencies when production\n NODE_ENV: 'development',\n DISABLE_OPENCOLLECTIVE: '1',\n },\n })\n child.on('close', (code) => {\n if (code !== 0) {\n reject({ command: `${packageManager} ${args.join(' ')}` })\n return\n }\n resolve()\n })\n })\n}\n"],"names":["install","root","dependencies","packageManager","isOnline","devDependencies","args","length","push","console","log","yellow","Promise","resolve","reject","child","spawn","cwd","stdio","env","process","ADBLOCK","NODE_ENV","DISABLE_OPENCOLLECTIVE","on","code","command","join"],"mappings":";;;;+BAwBgBA;;;eAAAA;;;4BAxBO;mEACL;;;;;;AAuBX,SAASA,QACdC,IAAY,EACZC,YAAsB,EACtB,EAAEC,cAAc,EAAEC,QAAQ,EAAEC,eAAe,EAAe;IAE1D,IAAIC,OAAiB,EAAE;IAEvB,IAAIJ,aAAaK,MAAM,GAAG,GAAG;QAC3B,IAAIJ,mBAAmB,QAAQ;YAC7BG,OAAO;gBAAC;gBAAO;aAAU;YACzB,IAAID,iBAAiBC,KAAKE,IAAI,CAAC;QACjC,OAAO,IAAIL,mBAAmB,QAAQ;YACpCG,OAAO;gBAAC;gBAAO;aAAe;YAC9BA,KAAKE,IAAI,CAACH,kBAAkB,eAAe;QAC7C,OAAO;YACL,MAAM;YACNC,OAAO;gBAAC;gBAAW;aAAe;YAClCA,KAAKE,IAAI,CAACH,kBAAkB,eAAe;QAC7C;QAEAC,KAAKE,IAAI,IAAIN;IACf,OAAO;QACLI,OAAO;YAAC;SAAU,CAAC,4CAA4C;;QAE/D,IAAI,CAACF,UAAU;YACbE,KAAKE,IAAI,CAAC;YACVC,QAAQC,GAAG,CAACC,IAAAA,kBAAM,EAAC;YACnB,IAAIR,mBAAmB,OAAO;gBAC5BM,QAAQC,GAAG,CACTC,IAAAA,kBAAM,EAAC,CAAC,0BAA0B,EAAER,eAAe,OAAO,CAAC;YAE/D;YACAM,QAAQC,GAAG;QACb;IACF;IAEA,OAAO,IAAIE,QAAQ,CAACC,SAASC;QAC3B;;KAEC,GACD,MAAMC,QAAQC,IAAAA,mBAAK,EAACb,gBAAgBG,MAAM;YACxCW,KAAKhB;YACLiB,OAAO;YACPC,KAAK;gBACH,GAAGC,QAAQD,GAAG;gBACdE,SAAS;gBACT,mDAAmD;gBACnD,+BAA+B;gBAC/BC,UAAU;gBACVC,wBAAwB;YAC1B;QACF;QACAR,MAAMS,EAAE,CAAC,SAAS,CAACC;YACjB,IAAIA,SAAS,GAAG;gBACdX,OAAO;oBAAEY,SAAS,GAAGvB,eAAe,CAAC,EAAEG,KAAKqB,IAAI,CAAC,MAAM;gBAAC;gBACxD;YACF;YACAd;QACF;IACF;AACF","ignoreList":[0]}
|
||||
Reference in New Issue
Block a user