| 47 | |
| 48 | // Similar to _app, but for app router |
| 49 | export const selectLayoutFile = ({ |
| 50 | projectDir, |
| 51 | packages, |
| 52 | }: SelectBoilerplateProps) => { |
| 53 | const layoutFileDir = path.join(PKG_ROOT, "template/extras/src/app/layout"); |
| 54 | |
| 55 | const usingTw = packages.tailwind.inUse; |
| 56 | const usingTRPC = packages.trpc.inUse; |
| 57 | let layoutFile = "base.tsx"; |
| 58 | if (usingTRPC && usingTw) { |
| 59 | layoutFile = "with-trpc-tw.tsx"; |
| 60 | } else if (usingTRPC && !usingTw) { |
| 61 | layoutFile = "with-trpc.tsx"; |
| 62 | } else if (!usingTRPC && usingTw) { |
| 63 | layoutFile = "with-tw.tsx"; |
| 64 | } |
| 65 | |
| 66 | const appSrc = path.join(layoutFileDir, layoutFile); |
| 67 | const appDest = path.join(projectDir, "src/app/layout.tsx"); |
| 68 | fs.copySync(appSrc, appDest); |
| 69 | }; |
| 70 | |
| 71 | // This selects the proper index.tsx to be used that showcases the chosen tech |
| 72 | export const selectIndexFile = ({ |