claude-autopm 1.15.4 → 1.15.5
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.
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
{
|
|
2
|
+
"dependencies": {
|
|
3
|
+
"js-yaml": "^4.1.0"
|
|
4
|
+
},
|
|
2
5
|
"scripts": {
|
|
3
6
|
"// Safety Scripts": "Safeguards against bad commits",
|
|
4
7
|
"precommit": "npm test && npm run build && npm run lint",
|
|
5
8
|
"verify": "npm test && npm run build && npm run lint && npm run typecheck",
|
|
6
9
|
"safe-commit": "./scripts/safe-commit.sh",
|
|
7
10
|
"prepush": "npm run verify && npm run test:e2e",
|
|
8
|
-
|
|
11
|
+
|
|
9
12
|
"// Quick Checks": "Quick checks",
|
|
10
13
|
"check": "npm run lint && npm run typecheck",
|
|
11
14
|
"check:all": "npm run verify",
|
|
12
|
-
|
|
15
|
+
|
|
13
16
|
"// Git Helpers": "Git helper commands",
|
|
14
17
|
"commit": "npm run precommit && git add -A && git commit",
|
|
15
18
|
"push:safe": "npm run prepush && git push",
|
|
16
|
-
|
|
19
|
+
|
|
17
20
|
"// CI/CD Simulation": "Local CI/CD simulation",
|
|
18
21
|
"ci:local": "npm ci && npm run verify && npm run test:e2e",
|
|
19
22
|
"ci:validate": "npm run ci:local",
|
|
20
|
-
|
|
23
|
+
|
|
21
24
|
"// Emergency": "Emergency",
|
|
22
25
|
"fix": "npm run lint -- --fix && npm run format",
|
|
23
26
|
"format": "prettier --write .",
|
|
24
27
|
"clean:hooks": "rm -f .git/hooks/pre-* && npm run setup:hooks",
|
|
25
28
|
"setup:hooks": "husky install || cp scripts/hooks/* .git/hooks/"
|
|
26
29
|
},
|
|
27
|
-
|
|
30
|
+
|
|
28
31
|
"husky": {
|
|
29
32
|
"hooks": {
|
|
30
33
|
"pre-commit": "npm run precommit",
|
|
@@ -32,7 +35,7 @@
|
|
|
32
35
|
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
33
36
|
}
|
|
34
37
|
},
|
|
35
|
-
|
|
38
|
+
|
|
36
39
|
"// Usage examples": [
|
|
37
40
|
"npm run safe-commit 'feat: add new feature'",
|
|
38
41
|
"npm run verify",
|
package/install/install.js
CHANGED
|
@@ -339,6 +339,63 @@ ${this.colors.BOLD}Examples:${this.colors.NC}
|
|
|
339
339
|
this.printSuccess(`Installed ${script}`);
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
+
|
|
343
|
+
// Install package.json if it doesn't exist
|
|
344
|
+
const packageJsonPath = path.join(this.targetDir, 'package.json');
|
|
345
|
+
const packageJsonTemplatePath = path.join(this.autopmDir, 'scripts', 'package.json.template');
|
|
346
|
+
|
|
347
|
+
if (!fs.existsSync(packageJsonPath) && fs.existsSync(packageJsonTemplatePath)) {
|
|
348
|
+
this.printStep('Creating package.json from template...');
|
|
349
|
+
const templateContent = fs.readFileSync(packageJsonTemplatePath, 'utf-8');
|
|
350
|
+
|
|
351
|
+
// Try to get project name from directory
|
|
352
|
+
const projectName = path.basename(this.targetDir);
|
|
353
|
+
|
|
354
|
+
// Parse template and add name field
|
|
355
|
+
const packageJson = JSON.parse(templateContent);
|
|
356
|
+
packageJson.name = projectName;
|
|
357
|
+
packageJson.version = packageJson.version || '1.0.0';
|
|
358
|
+
packageJson.description = packageJson.description || '';
|
|
359
|
+
packageJson.main = packageJson.main || 'index.js';
|
|
360
|
+
packageJson.license = packageJson.license || 'ISC';
|
|
361
|
+
|
|
362
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf-8');
|
|
363
|
+
this.printSuccess('Created package.json');
|
|
364
|
+
} else if (fs.existsSync(packageJsonPath)) {
|
|
365
|
+
this.printInfo('package.json already exists, skipping');
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
installDependencies() {
|
|
370
|
+
const packageJsonPath = path.join(this.targetDir, 'package.json');
|
|
371
|
+
|
|
372
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
373
|
+
this.printInfo('No package.json found, skipping dependency installation');
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
this.printStep('Installing npm dependencies...');
|
|
378
|
+
|
|
379
|
+
try {
|
|
380
|
+
// Check if package.json has dependencies
|
|
381
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
382
|
+
if (!packageJson.dependencies || Object.keys(packageJson.dependencies).length === 0) {
|
|
383
|
+
this.printInfo('No dependencies to install');
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// Run npm install
|
|
388
|
+
execSync('npm install', {
|
|
389
|
+
cwd: this.targetDir,
|
|
390
|
+
encoding: 'utf-8',
|
|
391
|
+
stdio: 'inherit'
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
this.printSuccess('Dependencies installed successfully');
|
|
395
|
+
} catch (error) {
|
|
396
|
+
this.printWarning(`Failed to install dependencies: ${error.message}`);
|
|
397
|
+
this.printInfo('You can manually run: npm install');
|
|
398
|
+
}
|
|
342
399
|
}
|
|
343
400
|
|
|
344
401
|
checkToolAvailability() {
|
|
@@ -903,6 +960,9 @@ See: https://github.com/rafeekpro/ClaudeAutoPM
|
|
|
903
960
|
await this.setupGitHooks();
|
|
904
961
|
}
|
|
905
962
|
|
|
963
|
+
// Install npm dependencies
|
|
964
|
+
this.installDependencies();
|
|
965
|
+
|
|
906
966
|
// Final success message
|
|
907
967
|
console.log('');
|
|
908
968
|
this.printMsg('GREEN', '╔══════════════════════════════════════════╗');
|