Rocky_Mountain_Vending/.pnpm-store/v10/files/27/064a0c35e04634968ef77348c111acbfd1d9d36d35e4236c126cc0c8f494a04ee9514cf47c4e546fe20f5f3ad81ca684050cb547c0846b8361525cd5c97cc7
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

37 lines
No EOL
1.5 KiB
Text

import { existsSync, readFileSync } from 'fs';
import path from 'path';
import { recursiveReadDir } from '../recursive-readdir';
export async function getTypeScriptIntent(baseDir, intentDirs, tsconfigPath) {
const resolvedTsConfigPath = path.join(baseDir, tsconfigPath);
// The integration turns on if we find a `tsconfig.json` in the user's
// project.
const hasTypeScriptConfiguration = existsSync(resolvedTsConfigPath);
if (hasTypeScriptConfiguration) {
const content = readFileSync(resolvedTsConfigPath, {
encoding: 'utf8'
}).trim();
return {
firstTimeSetup: content === '' || content === '{}'
};
}
// Next.js also offers a friendly setup mode that bootstraps a TypeScript
// project for the user when we detect TypeScript files. So, we need to check
// the `pages/` directory for a TypeScript file.
// Checking all directories is too slow, so this is a happy medium.
const tsFilesRegex = /.*\.(ts|tsx)$/;
const excludedRegex = /(node_modules|.*\.d\.ts$)/;
for (const dir of intentDirs){
const typescriptFiles = await recursiveReadDir(dir, {
pathnameFilter: (name)=>tsFilesRegex.test(name),
ignoreFilter: (name)=>excludedRegex.test(name)
});
if (typescriptFiles.length) {
return {
firstTimeSetup: true
};
}
}
return false;
}
//# sourceMappingURL=getTypeScriptIntent.js.map