claude-init 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -4
- package/src/fileManager.js +17 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-init",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Initialize Claude development environment with configurations and templates",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -43,10 +43,13 @@
|
|
|
43
43
|
},
|
|
44
44
|
"repository": {
|
|
45
45
|
"type": "git",
|
|
46
|
-
"url": ""
|
|
46
|
+
"url": "git+https://github.com/ChrisLinn/claude-init.git"
|
|
47
47
|
},
|
|
48
48
|
"bugs": {
|
|
49
|
-
"url": ""
|
|
49
|
+
"url": "https://github.com/ChrisLinn/claude-init/issues"
|
|
50
50
|
},
|
|
51
|
-
"homepage": ""
|
|
51
|
+
"homepage": "https://github.com/ChrisLinn/claude-init#readme",
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
}
|
|
52
55
|
}
|
package/src/fileManager.js
CHANGED
|
@@ -31,9 +31,23 @@ export async function handleClaudeMarkdown(targetDir) {
|
|
|
31
31
|
return { action: 'skipped', details: 'CLAUDE.md already contains template content' };
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
//
|
|
35
|
-
const
|
|
36
|
-
const
|
|
34
|
+
// Look for existing "# CLAUDE.md" heading
|
|
35
|
+
const claudeHeadingRegex = /^# CLAUDE\.md\s*$/m;
|
|
36
|
+
const headingMatch = existingContent.match(claudeHeadingRegex);
|
|
37
|
+
|
|
38
|
+
let updatedContent;
|
|
39
|
+
if (headingMatch) {
|
|
40
|
+
// Found existing heading, add template content right below it
|
|
41
|
+
const headingIndex = headingMatch.index + headingMatch[0].length;
|
|
42
|
+
const beforeHeading = existingContent.substring(0, headingIndex);
|
|
43
|
+
const afterHeading = existingContent.substring(headingIndex);
|
|
44
|
+
updatedContent = beforeHeading + '\n\n' + templateContent + afterHeading;
|
|
45
|
+
} else {
|
|
46
|
+
// No heading found, add one at the beginning with template content
|
|
47
|
+
const heading = '# CLAUDE.md\n\n';
|
|
48
|
+
updatedContent = heading + templateContent + '\n\n' + existingContent;
|
|
49
|
+
}
|
|
50
|
+
|
|
37
51
|
await fs.writeFile(claudeFile, updatedContent);
|
|
38
52
|
|
|
39
53
|
return { action: 'updated', details: 'Appended template content to existing CLAUDE.md' };
|