diff --git a/src/generate.js b/src/generate.js index 6ae2b40..435b1bc 100644 --- a/src/generate.js +++ b/src/generate.js @@ -51,13 +51,21 @@ export async function generateProject(config) { try { if (fs.existsSync(localTemplatePath)) { // 🟢 DEVELOPMENT MODE: Local folder found - const spinner = ora('DEV MODE: Copying local template...').start(); + const spinner = ora({ + text: 'DEV MODE: Copying local template...', + spinner: 'squareCorners', + color: 'blue' + }).start(); fs.cpSync(localTemplatePath, projectPath, { recursive: true }); spinner.succeed(`Files copied to ./${projectName}`); } else { // 🔵 PRODUCTION MODE: Fetch from GitHub const repoURI = `Ebyte-Lab/opusify-templates/${config.template}/${config.architecture}`; - const spinner = ora(`Fetching template from GitHub (${repoURI})...`).start(); + const spinner = ora({ + text: `Fetching template from GitHub (${repoURI})...`, + spinner: 'squareCorners', + color: 'blue' + }).start(); try { const emitter = tiged(repoURI, { disableCache: true, force: true }); @@ -70,7 +78,11 @@ export async function generateProject(config) { } // 3. TRANSFORM PHASE: Process Handlebars Tags - const compileSpinner = ora('Compiling template tags...').start(); + const compileSpinner = ora({ + text: 'Compiling template tags...', + spinner: 'squareCorners', + color: 'cyan' + }).start(); const allFiles = getAllFiles(projectPath); for (const file of allFiles) { @@ -89,11 +101,12 @@ export async function generateProject(config) { const configFilePath = path.join(projectPath, 'opusify.config.json'); fs.writeFileSync(configFilePath, JSON.stringify(config, null, 2)); - // 5. Resolve dynamic dependencies based on user choices - resolveDependencies(projectPath, config); - - // 6. AUTOMATION PHASE: Install Dependencies - const installSpinner = ora('Installing dependencies (this might take a minute)...').start(); + // 5. AUTOMATION PHASE: Install Dependencies + const installSpinner = ora({ + text: 'Installing dependencies (this might take a minute)...', + spinner: 'squareCorners', + color: 'yellow' + }).start(); try { execSync('npm install', { cwd: projectPath, stdio: 'pipe' }); installSpinner.succeed('Dependencies installed successfully!'); @@ -103,7 +116,11 @@ export async function generateProject(config) { // 7. Git Initialization if (config.initGit) { - const gitSpinner = ora('Initializing Git repository...').start(); + const gitSpinner = ora({ + text: 'Initializing Git repository...', + spinner: 'squareCorners', + color: 'magenta' + }).start(); try { execSync('git init', { cwd: projectPath, stdio: 'ignore' }); execSync('git add .', { cwd: projectPath, stdio: 'ignore' }); @@ -129,4 +146,4 @@ export async function generateProject(config) { console.log(chalk.gray(error.message)); if (fs.existsSync(projectPath)) fs.rmSync(projectPath, { recursive: true, force: true }); } -} +} \ No newline at end of file diff --git a/templates/ecommerce/nextjs-monolith/.gitignore b/templates/ecommerce/nextjs-monolith/.gitignore new file mode 100644 index 0000000..7ef8c73 --- /dev/null +++ b/templates/ecommerce/nextjs-monolith/.gitignore @@ -0,0 +1,5 @@ +node_modules +.env + +# editos files +.vscode \ No newline at end of file diff --git a/templates/portfolio/nextjs-monolith/.gitignore b/templates/portfolio/nextjs-monolith/.gitignore new file mode 100644 index 0000000..7ef8c73 --- /dev/null +++ b/templates/portfolio/nextjs-monolith/.gitignore @@ -0,0 +1,5 @@ +node_modules +.env + +# editos files +.vscode \ No newline at end of file diff --git a/templates/saas/nextjs-monolith/.gitignore b/templates/saas/nextjs-monolith/.gitignore new file mode 100644 index 0000000..7ef8c73 --- /dev/null +++ b/templates/saas/nextjs-monolith/.gitignore @@ -0,0 +1,5 @@ +node_modules +.env + +# editos files +.vscode \ No newline at end of file diff --git a/templates/saas/vite-react/.gitignore b/templates/saas/vite-react/.gitignore new file mode 100644 index 0000000..7ef8c73 --- /dev/null +++ b/templates/saas/vite-react/.gitignore @@ -0,0 +1,5 @@ +node_modules +.env + +# editos files +.vscode \ No newline at end of file diff --git a/templates/school/nextjs-monolith/.gitignore b/templates/school/nextjs-monolith/.gitignore new file mode 100644 index 0000000..7ef8c73 --- /dev/null +++ b/templates/school/nextjs-monolith/.gitignore @@ -0,0 +1,5 @@ +node_modules +.env + +# editos files +.vscode \ No newline at end of file