Skip to content

Add npm/Node.js project detection to clean and stats commands#22

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-npm-node-cleaning
Draft

Add npm/Node.js project detection to clean and stats commands#22
Copilot wants to merge 2 commits intomainfrom
copilot/add-npm-node-cleaning

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

Extends project discovery to detect npm projects via package.json and mark their node_modules directories for cleaning/stats reporting, alongside existing .NET/MSBuild project support.

Changes

  • DirectoryModels.cs — Add ProjectType.Npm; resolve it from package.json filename in GetProjectType()
  • SlnScanner.cs — Add EnumerateNpmFiles() to discover package.json files, filtering out those inside node_modules. Runs alongside existing sln/proj scanning.
  • SlnParser.cs — Yield a single ProjCfg (no MSBuild configuration) for npm projects
  • CleaningApplication.cs — Short-circuit MSBuild evaluation for npm projects; synthesize a ProjectInfo with OutDir = "node_modules"
  • MarkDeleteProcessor.cs — Add NpmDir handler in the (ProjType, DirType) switch, matching the existing VcxDir pattern for direct directory marking

Example output

╭───────┬────────────┬────────────┬───────────────────────────────────╮
│ Files │ Size (KiB) │ Size (MiB) │ Directory                         │
├───────┼────────────┼────────────┼───────────────────────────────────┤
│  4821 │    218,304 │     213.19 │ /repos/my-app/node_modules        │
╰───────┴────────────┴────────────┴───────────────────────────────────╯

Tests

11 new tests in NpmProjectDetectionTests.cs covering detection logic, ProjectType resolution, scanner enumeration, and node_modules-nested package.json exclusion.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: dlosch <318550+dlosch@users.noreply.github.com>
Copilot AI changed the title [WIP] Add detection for npm node js projects in clean and stats commands Add npm/Node.js project detection to clean and stats commands Feb 28, 2026
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.

2 participants