Skip to content

Commit 2ed41f8

Browse files
authored
chore: bump version to 2.3.0 and add Git workflow guidelines (#17)
* chore: bump version to 2.3.0 and add Git workflow guidelines - Update version from 2.2.0 to 2.3.0 - Add proper Git workflow guidelines to .ai-config.json - Includes features: interactive config setup, multiple templates, fixed await warning Closes #16 * fix: add CI environment detection for non-interactive config setup - Detect CI environments (CI, GITHUB_ACTIONS, JENKINS_URL) - Use basic configuration template automatically in CI - Prevents interactive prompts from hanging CI/CD pipelines - Fixes exit code 130 issue in GitHub Actions
1 parent 616fec1 commit 2ed41f8

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

.ai-config.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@
3838
"Use logical section ordering",
3939
"Include practical examples",
4040
"Maintain professional yet friendly tone"
41+
],
42+
"git_workflow": [
43+
"Always create GitHub issues first for features/bugs",
44+
"Use GitHub CLI (gh) for all Git interactions",
45+
"Create feature branches and pull requests",
46+
"Wait for CI/CD pipeline to succeed before merging",
47+
"Bump version in package.json before publishing",
48+
"Use 'npm publish' only after successful merge to main",
49+
"Never push directly to main - always use PR workflow"
4150
]
4251
}
4352
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "git",
66
"url": "git+https://github.com/rkristelijn/lcode.git"
77
},
8-
"version": "2.2.0",
8+
"version": "2.3.0",
99
"main": "index.mjs",
1010
"bin": {
1111
"lcode": "index.mjs"

src/config.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@ export const CONFIG_TEMPLATES = {
5656
};
5757

5858
export async function createInteractiveConfig() {
59+
// Detect CI environment and use basic setup
60+
const isCI = process.env.CI || process.env.GITHUB_ACTIONS || process.env.JENKINS_URL;
61+
62+
if (isCI) {
63+
console.log('🤖 CI environment detected - using basic configuration');
64+
const basicConfig = CONFIG_TEMPLATES.basic.config;
65+
const configPath = path.resolve(process.env.HOME, '.lcodeconfig');
66+
67+
try {
68+
fs.writeFileSync(configPath, JSON.stringify(basicConfig, null, 2));
69+
console.log(`✓ Configuration file created at ${configPath}`);
70+
return true;
71+
} catch (error) {
72+
console.error(`✗ Failed to create configuration file: ${error.message}`);
73+
return false;
74+
}
75+
}
76+
5977
console.log('\n🚀 Welcome to lcode configuration setup!\n');
6078

6179
const answers = await inquirer.prompt([

0 commit comments

Comments
 (0)