{"version":3,"file":"detect.mjs","names":[],"sources":["../../../../../src/init/frameworkSetup/tanstackStart/detect.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { exists } from '../../utils/fileSystem';\n\n/** Location of the TanStack Router file-based routes directory. */\nexport type TanStackRoutesInfo = {\n  /** Routes directory relative to the root, e.g. `src/routes` or `routes`. */\n  routesDir: string;\n  /** `src` when the project uses a `src/` directory, otherwise `''`. */\n  srcDir: string;\n};\n\n/**\n * Detects the TanStack Router routes directory, preferring `src/routes` over\n * `routes`. Returns `null` when neither exists.\n */\nexport const detectTanStackRoutesDir = async (\n  rootDir: string\n): Promise<TanStackRoutesInfo | null> => {\n  if (await exists(rootDir, join('src', 'routes'))) {\n    return { routesDir: join('src', 'routes'), srcDir: 'src' };\n  }\n  if (await exists(rootDir, 'routes')) {\n    return { routesDir: 'routes', srcDir: '' };\n  }\n  return null;\n};\n\n/**\n * Returns true when the project depends on TanStack Start (`@tanstack/react-start`)\n * or, failing that, on `@tanstack/react-router` (file-based routing).\n */\nexport const hasTanStackStartDeps = (\n  allDeps: Record<string, string>\n): boolean =>\n  Boolean(\n    allDeps['@tanstack/react-start'] || allDeps['@tanstack/react-router']\n  );\n"],"mappings":";;;;;;;;AAeA,MAAa,0BAA0B,OACrC,YACuC;CACvC,IAAI,MAAM,OAAO,SAAS,KAAK,OAAO,QAAQ,CAAC,GAC7C,OAAO;EAAE,WAAW,KAAK,OAAO,QAAQ;EAAG,QAAQ;CAAM;CAE3D,IAAI,MAAM,OAAO,SAAS,QAAQ,GAChC,OAAO;EAAE,WAAW;EAAU,QAAQ;CAAG;CAE3C,OAAO;AACT;;;;;AAMA,MAAa,wBACX,YAEA,QACE,QAAQ,4BAA4B,QAAQ,yBAC9C"}