@chappibunny/repolens 0.4.2 → 0.4.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to RepoLens will be documented in this file.
4
4
 
5
+ ## 0.4.3
6
+
7
+ ### 🐛 Bug Fixes
8
+ - **Migration Tool**: Fixed over-aggressive npm install removal
9
+ - Now only removes `npm install/ci` from legacy `cd tools/repolens` multi-line blocks
10
+ - Preserves legitimate dependency installation steps in release workflows
11
+ - Fixes YAML corruption that broke workflows with standalone npm ci/install steps
12
+ - Added test case to verify legitimate npm install steps are preserved
13
+
5
14
  ## 0.4.2
6
15
 
7
16
  ### 🐛 Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chappibunny/repolens",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "AI-assisted documentation intelligence system for technical and non-technical audiences",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/migrate.js CHANGED
@@ -43,11 +43,16 @@ function detectLegacyPatterns(content) {
43
43
  function migrateWorkflowContent(content) {
44
44
  let migrated = content;
45
45
 
46
- // Remove cd tools/repolens commands
47
- migrated = migrated.replace(/cd\s+tools\/repolens\s*\n?/gi, "");
48
-
49
- // Remove standalone npm ci/install that's part of old setup
50
- migrated = migrated.replace(/npm\s+(?:ci|install)\s*\n/g, "");
46
+ // Remove cd tools/repolens commands and associated npm install in the same run block
47
+ // This handles the legacy pattern: run: | cd tools/repolens; npm install; npx repolens publish
48
+ if (/cd\s+tools\/repolens/i.test(migrated)) {
49
+ // Remove cd command
50
+ migrated = migrated.replace(/cd\s+tools\/repolens\s*\n?/gi, "");
51
+
52
+ // Only remove npm install/ci if it appears in what looks like a multi-line run block
53
+ // after we've removed the cd command (indicates it was part of the legacy pattern)
54
+ migrated = migrated.replace(/(run:\s*\|[^\n]*\n(?:\s+[^\n]*\n)*?\s+)npm\s+(?:ci|install)\s*\n/g, "$1");
55
+ }
51
56
 
52
57
  // Update npx repolens to npx @chappibunny/repolens@latest
53
58
  migrated = migrated.replace(/npx\s+repolens\s+/g, "npx @chappibunny/repolens@latest ");