claude-code-starter 0.1.0 → 0.1.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/dist/cli.js +21 -73
- package/package.json +9 -10
- package/templates/settings.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -19,74 +19,35 @@ function parseArgs(args) {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
function detectProject(projectDir) {
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
["go.mod", "Go"],
|
|
33
|
-
["pom.xml", "Java"],
|
|
34
|
-
["build.gradle", "Java/Kotlin"],
|
|
35
|
-
["Gemfile", "Ruby"]
|
|
36
|
-
];
|
|
37
|
-
for (const [file, tech] of checks) {
|
|
38
|
-
if (fs.existsSync(path.join(projectDir, file))) {
|
|
39
|
-
if (!techStack.includes(tech)) techStack.push(tech);
|
|
40
|
-
isExisting = true;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const keyDirs = ["src", "lib", "app", "api", "components", "pages", "tests", "test"];
|
|
44
|
-
for (const dir of keyDirs) {
|
|
45
|
-
if (fs.existsSync(path.join(projectDir, dir))) {
|
|
46
|
-
directories.push(dir);
|
|
47
|
-
isExisting = true;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
const pkgPath = path.join(projectDir, "package.json");
|
|
51
|
-
if (fs.existsSync(pkgPath)) {
|
|
52
|
-
try {
|
|
53
|
-
const pkg = fs.readFileSync(pkgPath, "utf-8");
|
|
54
|
-
const frameworkChecks = [
|
|
55
|
-
['"react"', "React"],
|
|
56
|
-
['"next"', "Next.js"],
|
|
57
|
-
['"vue"', "Vue"],
|
|
58
|
-
['"express"', "Express"],
|
|
59
|
-
['"fastify"', "Fastify"],
|
|
60
|
-
['"@nestjs"', "NestJS"]
|
|
61
|
-
];
|
|
62
|
-
for (const [pattern, name] of frameworkChecks) {
|
|
63
|
-
if (pkg.includes(pattern)) frameworks.push(name);
|
|
22
|
+
let fileCount = 0;
|
|
23
|
+
const extensions = [".js", ".ts", ".tsx", ".py", ".go", ".rs", ".java", ".rb", ".c", ".cpp", ".cs", ".swift", ".kt"];
|
|
24
|
+
const ignorePatterns = [".git"];
|
|
25
|
+
const gitignorePath = path.join(projectDir, ".gitignore");
|
|
26
|
+
if (fs.existsSync(gitignorePath)) {
|
|
27
|
+
const lines = fs.readFileSync(gitignorePath, "utf-8").split("\n");
|
|
28
|
+
for (const line of lines) {
|
|
29
|
+
const trimmed = line.trim();
|
|
30
|
+
if (trimmed && !trimmed.startsWith("#")) {
|
|
31
|
+
ignorePatterns.push(trimmed.replace(/\/$/, ""));
|
|
64
32
|
}
|
|
65
|
-
} catch {
|
|
66
33
|
}
|
|
67
34
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
35
|
+
function shouldIgnore(name) {
|
|
36
|
+
return ignorePatterns.some((pattern) => name === pattern || name.startsWith(pattern + "/"));
|
|
37
|
+
}
|
|
71
38
|
function countFiles(dir, depth = 0) {
|
|
72
39
|
if (depth > 3) return;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
countFiles(fullPath, depth + 1);
|
|
80
|
-
} else if (extensions.some((ext) => entry.name.endsWith(ext))) {
|
|
81
|
-
fileCount++;
|
|
82
|
-
isExisting = true;
|
|
83
|
-
}
|
|
40
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
41
|
+
if (shouldIgnore(entry.name)) continue;
|
|
42
|
+
if (entry.isDirectory()) {
|
|
43
|
+
countFiles(path.join(dir, entry.name), depth + 1);
|
|
44
|
+
} else if (extensions.some((ext) => entry.name.endsWith(ext))) {
|
|
45
|
+
fileCount++;
|
|
84
46
|
}
|
|
85
|
-
} catch {
|
|
86
47
|
}
|
|
87
48
|
}
|
|
88
49
|
countFiles(projectDir);
|
|
89
|
-
return { isExisting
|
|
50
|
+
return { isExisting: fileCount > 0, fileCount };
|
|
90
51
|
}
|
|
91
52
|
function copyDir(src, dest) {
|
|
92
53
|
fs.mkdirSync(dest, { recursive: true });
|
|
@@ -188,20 +149,7 @@ async function main() {
|
|
|
188
149
|
console.log();
|
|
189
150
|
const project = detectProject(projectDir);
|
|
190
151
|
if (project.isExisting) {
|
|
191
|
-
console.log(pc.green(
|
|
192
|
-
if (project.techStack.length > 0) {
|
|
193
|
-
console.log(`Tech stack: ${pc.cyan(project.techStack.join(" "))}`);
|
|
194
|
-
}
|
|
195
|
-
console.log();
|
|
196
|
-
console.log(pc.blue("Analyzing codebase..."));
|
|
197
|
-
console.log();
|
|
198
|
-
console.log(` Files: ${project.fileCount} source files`);
|
|
199
|
-
if (project.directories.length > 0) {
|
|
200
|
-
console.log(` Directories: ${project.directories.map((d) => d + "/").join(" ")}`);
|
|
201
|
-
}
|
|
202
|
-
if (project.frameworks.length > 0) {
|
|
203
|
-
console.log(` Frameworks: ${project.frameworks.join(" ")}`);
|
|
204
|
-
}
|
|
152
|
+
console.log(pc.green(`Existing project \xB7 ${project.fileCount} files`));
|
|
205
153
|
console.log();
|
|
206
154
|
const taskPath = path.join(projectDir, ".claude", "state", "task.md");
|
|
207
155
|
if (!fs.existsSync(taskPath)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-starter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "A lightweight starter kit for AI-assisted development with Claude Code",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
|
@@ -27,23 +27,22 @@
|
|
|
27
27
|
"templates"
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
|
-
"build": "tsup",
|
|
31
|
-
"dev": "tsup --watch",
|
|
32
|
-
"start": "
|
|
33
|
-
"test": "
|
|
34
|
-
"
|
|
35
|
-
"
|
|
30
|
+
"build": "bun run tsup",
|
|
31
|
+
"dev": "bun run tsup --watch",
|
|
32
|
+
"start": "bun dist/cli.js",
|
|
33
|
+
"test": "bun test",
|
|
34
|
+
"typecheck": "bun run tsc --noEmit",
|
|
35
|
+
"prepublishOnly": "bun run build && bun run test"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"picocolors": "^1.1.1",
|
|
39
39
|
"prompts": "^2.4.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@types/
|
|
42
|
+
"@types/bun": "latest",
|
|
43
43
|
"@types/prompts": "^2.4.9",
|
|
44
44
|
"tsup": "^8.3.5",
|
|
45
|
-
"typescript": "^5.7.2"
|
|
46
|
-
"vitest": "^4.0.17"
|
|
45
|
+
"typescript": "^5.7.2"
|
|
47
46
|
},
|
|
48
47
|
"engines": {
|
|
49
48
|
"node": ">=18.0.0"
|
package/templates/settings.json
CHANGED