Skip to content

chore: remove tracked dependency files, output to generated/#67

Merged
carlos-alm merged 5 commits intomainfrom
chore/cleanup-dependencies
Feb 24, 2026
Merged

chore: remove tracked dependency files, output to generated/#67
carlos-alm merged 5 commits intomainfrom
chore/cleanup-dependencies

Conversation

@carlos-alm
Copy link
Contributor

Summary

  • Delete DEPENDENCIES.json and generated/DEPENDENCIES.md from tracking
  • Update gen-deps.cjs to write into generated/DEPENDENCIES.md
  • Update publish.yml to write DEPENDENCIES.json into generated/
  • Gitignore generated/DEPENDENCIES.md so local npm install doesn't dirty the tree

Test plan

  • Run npm run deps:tree and verify output lands in generated/DEPENDENCIES.md
  • Verify git status stays clean after npm install

Delete DEPENDENCIES.json and generated/DEPENDENCIES.md from the repo.
Update gen-deps.cjs to write into generated/ and gitignore its output
so it stays local-only.
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 24, 2026

Greptile Summary

This PR moves dependency tracking files from the repository root to a generated/ directory and updates gitignore to prevent them from being committed locally. The changes ensure both DEPENDENCIES.md and DEPENDENCIES.json are generated dynamically and kept out of version control.

  • Deleted tracked DEPENDENCIES.json and generated/DEPENDENCIES.md files
  • Updated scripts/gen-deps.cjs to write to generated/DEPENDENCIES.md with directory creation
  • Updated .github/workflows/publish.yml to generate generated/DEPENDENCIES.json with directory creation
  • Added both dependency files to .gitignore to keep working tree clean after local npm install

All previously reported issues regarding missing directory creation have been addressed in commits 6d44a03 and cee85a8.

Confidence Score: 5/5

  • This PR is safe to merge with no issues
  • All changes are configuration and build-related with no logic changes. Previous concerns about missing directory creation have been resolved. The PR correctly moves generated files out of version control and ensures they're created in the proper location.
  • No files require special attention

Important Files Changed

Filename Overview
.gitignore Added generated/DEPENDENCIES.md and generated/DEPENDENCIES.json to prevent local generation from dirtying the working tree
scripts/gen-deps.cjs Updated to write output to generated/DEPENDENCIES.md, includes directory creation for safety
.github/workflows/publish.yml Updated to generate and track generated/DEPENDENCIES.json instead of root-level file, includes directory creation

Last reviewed commit: 69cb331

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

const fs = require('fs');
const path = require('path');

const outFile = path.join('generated', 'DEPENDENCIES.md');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated/ directory must exist before writing, or writeFileSync will fail with ENOENT. Add fs.mkdirSync(path.dirname(outFile), { recursive: true }) before line 8.

Suggested change
const outFile = path.join('generated', 'DEPENDENCIES.md');
const outFile = path.join('generated', 'DEPENDENCIES.md');
fs.mkdirSync(path.dirname(outFile), { recursive: true });

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 6d44a03 — added fs.mkdirSync(path.dirname(outFile), { recursive: true }) before the write.

- name: Generate DEPENDENCIES.json
if: github.event_name != 'push'
run: npm ls --json --all --omit=dev > DEPENDENCIES.json 2>/dev/null || true
run: npm ls --json --all --omit=dev > generated/DEPENDENCIES.json 2>/dev/null || true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated/ directory must exist before writing, or this command will fail with ENOENT. Add mkdir -p generated && before the npm command.

Suggested change
run: npm ls --json --all --omit=dev > generated/DEPENDENCIES.json 2>/dev/null || true
run: mkdir -p generated && npm ls --json --all --omit=dev > generated/DEPENDENCIES.json 2>/dev/null || true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 6d44a03 — added mkdir -p generated && before the npm command.

Add mkdir for generated/ in both gen-deps.cjs and publish.yml to
prevent ENOENT failures on fresh clones.
@carlos-alm
Copy link
Contributor Author

@greptileai

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

.claude/codegraph-checked.log
artifacts/
pkg/
generated/DEPENDENCIES.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also add generated/DEPENDENCIES.json since the workflow generates it and it shouldn't be committed locally

Suggested change
generated/DEPENDENCIES.md
generated/DEPENDENCIES.md
generated/DEPENDENCIES.json

The publish workflow generates this file; it shouldn't be committed
locally.
@carlos-alm
Copy link
Contributor Author

Both issues addressed:

  • scripts/gen-deps.cjs: Added fs.mkdirSync(path.dirname(outFile), { recursive: true }) before writing (6d44a03)
  • .github/workflows/publish.yml: Added mkdir -p generated && before npm ls (6d44a03)
  • .gitignore: Added generated/DEPENDENCIES.json alongside the existing generated/DEPENDENCIES.md entry (cee85a8)

Fresh clones will now create generated/ on demand in both the local script and CI workflow.

@carlos-alm
Copy link
Contributor Author

@greptileai

…ncies

Impact: 21 functions changed, 38 affected
@claude
Copy link

claude bot commented Feb 24, 2026

Claude finished @carlos-alm's task —— View job


PR Review Complete ✅

Todo List

  • Read and understand changed files
  • Conduct root cause analysis
  • Check configuration changes and risks
  • Verify previous review feedback was addressed
  • Assess code quality and potential issues
  • Provide final rating and recommendation

Root Cause Analysis

Problem Being Solved: The PR addresses dependency file management pollution in the working tree. Previously, DEPENDENCIES.json and generated/DEPENDENCIES.md were tracked in git, causing these auto-generated files to appear as changes in git status after npm install (via the prepare script that runs deps:tree).

Why This Approach: Moving dependency files to a generated/ directory with gitignore entries is the standard solution for build artifacts. This approach cleanly separates auto-generated content from source code, keeps the working tree clean, and maintains the functionality for both local development and CI workflows.

Risk Assessment: LOW RISK - This is a pure organizational change with proper safeguards. The functionality remains identical; only the file locations change.

Configuration Change Analysis

Changes Reviewed:

  1. .gitignore: Added generated/DEPENDENCIES.md and generated/DEPENDENCIES.json
  2. scripts/gen-deps.cjs: Updated output path with directory creation ✅
  3. .github/workflows/publish.yml: Updated workflow to generate files in generated/

Security Assessment: No security concerns. All changes are organizational improvements.

Previous Review Feedback Verification

Directory Creation Fix (6d44a03): Added fs.mkdirSync(path.dirname(outFile), { recursive: true }) in scripts/gen-deps.cjs:6 and mkdir -p generated && in workflow line 283.

Missing Gitignore Entry (cee85a8): Added generated/DEPENDENCIES.json to .gitignore:12 alongside existing generated/DEPENDENCIES.md.

Both issues identified in previous reviews have been properly addressed.

Code Quality Assessment

scripts/gen-deps.cjs:

  • Lines 5-6: Proper path construction and directory creation with { recursive: true }
  • Lines 8-22: Robust error handling for npm command failures ✅
  • Code Style: Clean, readable implementation following existing patterns ✅

.github/workflows/publish.yml:

  • Line 283: Directory creation before file generation ✅
  • Lines 295,298: Proper git staging of the generated file ✅
  • Integration: Seamlessly integrates with existing release workflow ✅

.gitignore:

  • Lines 11-12: Both generated dependency files properly ignored ✅
  • Placement: Logically grouped with other generated content ✅

Technical Verification

  • File Deletion: Tracked DEPENDENCIES.json and generated/DEPENDENCIES.md properly removed
  • Directory Structure: generated/ directory exists with other auto-generated content
  • Script Integration: deps:tree script in package.json:33 calls updated generation script
  • Workflow Integration: Publish workflow generates and tracks files correctly for releases
  • Working Tree: Current status is clean, confirming no file pollution

Test Plan Validation

The PR's test plan is appropriate:

  • ✅ Running npm run deps:tree should output to generated/DEPENDENCIES.md
  • git status should stay clean after npm install

Both requirements are satisfied by the implementation.


Final Recommendation

  • Rating: ⭐⭐⭐⭐☆ (4/5)
  • Action: APPROVE
  • Reasoning: Well-executed organizational improvement that solves a real developer experience issue. All previous review feedback properly addressed. Clean implementation with proper error handling and no functional changes. Only minor deduction for being a relatively straightforward refactoring rather than exceptional code.

Strengths:

  • Addresses legitimate working tree pollution issue
  • Proper directory creation with error handling
  • Both local and CI workflows handled correctly
  • Complete gitignore coverage
  • Previous review issues fully resolved

No Critical Concerns: This is a safe, well-implemented change that improves the developer experience without introducing any risks.


Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@carlos-alm carlos-alm merged commit 2c584e4 into main Feb 24, 2026
17 checks passed
@carlos-alm carlos-alm deleted the chore/cleanup-dependencies branch February 24, 2026 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant