diff --git a/.ai-config.json b/.ai-config.json index 1f4d676..9d40a1e 100644 --- a/.ai-config.json +++ b/.ai-config.json @@ -38,6 +38,15 @@ "Use logical section ordering", "Include practical examples", "Maintain professional yet friendly tone" + ], + "git_workflow": [ + "Always create GitHub issues first for features/bugs", + "Use GitHub CLI (gh) for all Git interactions", + "Create feature branches and pull requests", + "Wait for CI/CD pipeline to succeed before merging", + "Bump version in package.json before publishing", + "Use 'npm publish' only after successful merge to main", + "Never push directly to main - always use PR workflow" ] } } diff --git a/package.json b/package.json index a4dd39a..3f4a6f4 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "git", "url": "git+https://github.com/rkristelijn/lcode.git" }, - "version": "2.2.0", + "version": "2.3.0", "main": "index.mjs", "bin": { "lcode": "index.mjs" diff --git a/src/config.mjs b/src/config.mjs index 29838e0..7910f32 100644 --- a/src/config.mjs +++ b/src/config.mjs @@ -56,6 +56,24 @@ export const CONFIG_TEMPLATES = { }; export async function createInteractiveConfig() { + // Detect CI environment and use basic setup + const isCI = process.env.CI || process.env.GITHUB_ACTIONS || process.env.JENKINS_URL; + + if (isCI) { + console.log('šŸ¤– CI environment detected - using basic configuration'); + const basicConfig = CONFIG_TEMPLATES.basic.config; + const configPath = path.resolve(process.env.HOME, '.lcodeconfig'); + + try { + fs.writeFileSync(configPath, JSON.stringify(basicConfig, null, 2)); + console.log(`āœ“ Configuration file created at ${configPath}`); + return true; + } catch (error) { + console.error(`āœ— Failed to create configuration file: ${error.message}`); + return false; + } + } + console.log('\nšŸš€ Welcome to lcode configuration setup!\n'); const answers = await inquirer.prompt([