Enhance template with improved UI and gitignore handling

This commit is contained in:
Aman Varshney
2025-03-22 01:52:38 +05:30
parent 4b59bca82e
commit fc59f630e0
13 changed files with 297 additions and 50 deletions

View File

@@ -24,9 +24,17 @@ export async function createProject(options: ProjectConfig): Promise<string> {
}
await fs.copy(templateDir, projectDir);
const gitignorePath = path.join(projectDir, "_gitignore");
if (await fs.pathExists(gitignorePath)) {
await fs.move(gitignorePath, path.join(projectDir, ".gitignore"));
const gitignorePaths = [
path.join(projectDir, "_gitignore"),
path.join(projectDir, "packages/client/_gitignore"),
path.join(projectDir, "packages/server/_gitignore"),
];
for (const gitignorePath of gitignorePaths) {
if (await fs.pathExists(gitignorePath)) {
const targetPath = path.join(path.dirname(gitignorePath), ".gitignore");
await fs.move(gitignorePath, targetPath);
}
}
if (options.auth) {