Skip to content

Conversation

@tobybessant
Copy link
Member

@tobybessant tobybessant commented Aug 25, 2025

This pull request introduces a new end-to-end (E2E) test suite for handling optional dependencies in npm projects, specifically to verify that the generate-license-file tool works correctly when optional dependencies are omitted from installation. Additionally, it upgrades the @npmcli/arborist dependency and adds a minor performance log to the CLI. The changes are grouped below by theme:

E2E Testing for Optional Dependencies:

  • Added a new E2E test project in e2e/optional-dependencies with configuration files (README.md, jest.config.js, package.json, tsconfig.json) and a test verifying license file generation when optional dependencies are omitted. [1] [2] [3] [4] [5] [6]
  • Added a corresponding Nx project configuration in src/packages/generate-license-file-e2e/optional-dependencies/project.json to automate E2E testing with omitted optional dependencies. [1] [2]

Dependency Management:

  • Upgraded @npmcli/arborist from version 9.0.0 to 9.1.1 in both src/package.json and src/package-lock.json to ensure compatibility and bug fixes. [1] [2] [3]

CLI Improvements:

  • Added a performance log to the CLI in main.ts, displaying the time taken to generate the license file. [1] [2]

Internal Dependency Resolution:

  • Updated resolveNpmDependencies.ts to use arborist.loadActual({ forceActual: true }), ensuring the actual dependency tree is loaded even if optional dependencies are omitted.

@codecov
Copy link

codecov bot commented Aug 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ae58734) to head (07950ea).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #638   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           31        31           
  Lines          581       581           
  Branches       101       101           
=========================================
  Hits           581       581           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tobybessant tobybessant changed the title tb/force actual Use forceActual: true Aug 25, 2025
@tobybessant tobybessant changed the title Use forceActual: true Use forceActual: true when resolving dependency tree Aug 25, 2025
@tobybessant
Copy link
Member Author

Closing - unfortunately using forceActual: true had too many other side effects, so going with another approach.

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