Rocky_Mountain_Vending/.pnpm-store/v10/files/f7/69a970e500d03429016bff1d4d6dc8dba6ffd5ada7707aa1a9af3417e4ea76d9120811181b1650c5c4aae18bacb19e1f491a0d0039ab2c8d94883c790ec265
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

50 lines
No EOL
2.5 KiB
Text

import { dirname } from 'path';
import findUp from 'next/dist/compiled/find-up';
import * as Log from '../build/output/log';
export function findRootLockFile(cwd) {
return findUp.sync([
'pnpm-lock.yaml',
'package-lock.json',
'yarn.lock',
'bun.lock',
'bun.lockb'
], {
cwd
});
}
export function findRootDirAndLockFiles(cwd) {
const lockFile = findRootLockFile(cwd);
if (!lockFile) return {
lockFiles: [],
rootDir: cwd
};
const lockFiles = [
lockFile
];
while(true){
const lastLockFile = lockFiles[lockFiles.length - 1];
const currentDir = dirname(lastLockFile);
const parentDir = dirname(currentDir);
// dirname('/')==='/' so if we happen to reach the FS root (as might happen in a container we need to quit to avoid looping forever
if (parentDir === currentDir) break;
const newLockFile = findRootLockFile(parentDir);
if (!newLockFile) break;
lockFiles.push(newLockFile);
}
return {
lockFiles,
rootDir: dirname(lockFiles[lockFiles.length - 1])
};
}
export function warnDuplicatedLockFiles(lockFiles) {
if (lockFiles.length > 1) {
const additionalLockFiles = lockFiles.slice(0, -1).map((str)=>`\n * ${str}`).join('');
if (process.env.TURBOPACK) {
Log.warnOnce(`Warning: Next.js inferred your workspace root, but it may not be correct.\n` + ` We detected multiple lockfiles and selected the directory of ${lockFiles[lockFiles.length - 1]} as the root directory.\n` + ` To silence this warning, set \`turbopack.root\` in your Next.js config, or consider ` + `removing one of the lockfiles if it's not needed.\n` + ` See https://nextjs.org/docs/app/api-reference/config/next-config-js/turbopack#root-directory for more information.\n` + ` Detected additional lockfiles: ${additionalLockFiles}\n`);
} else {
Log.warnOnce(`Warning: Next.js inferred your workspace root, but it may not be correct.\n` + ` We detected multiple lockfiles and selected the directory of ${lockFiles[lockFiles.length - 1]} as the root directory.\n` + ` To silence this warning, set \`outputFileTracingRoot\` in your Next.js config, or consider ` + `removing one of the lockfiles if it's not needed.\n` + ` See https://nextjs.org/docs/app/api-reference/config/next-config-js/output#caveats for more information.\n` + ` Detected additional lockfiles: ${additionalLockFiles}\n`);
}
}
}
//# sourceMappingURL=find-root.js.map