Closed elrrrrrrr closed 1 month ago
The changes introduce significant enhancements to the package management system, focusing on dependency validation. A new method _checkPackageDepsVersion
is added to PackageManagerService
to validate package dependencies. The publish
method is updated to conditionally call this validation based on a new configuration property strictValidatePackageDeps
. The PackageSyncerService
also receives updates for error handling during dependency validation. New tests are added to ensure that the system behaves correctly when invalid dependencies are encountered, alongside the introduction of a new JSON fixture representing a package with invalid dependencies.
File | Change Summary |
---|---|
app/core/service/PackageManagerService.ts | - Added method _checkPackageDepsVersion for validating package dependencies. |
- Updated publish method to conditionally call _checkPackageDepsVersion . |
|
- Modified imports to include assert and p-map , and added BadRequestError . |
|
app/core/service/PackageSyncerService.ts | - Updated executeTask method for enhanced error handling of BadRequestError . |
- Refined logic for syncing download data and updated syncDeletePkg method with logging. |
|
app/port/config.ts | - Added optional property strictValidatePackageDeps to CnpmcoreConfig . |
config/config.default.ts | - Introduced strictValidatePackageDeps property initialized to false in cnpmcoreConfig . |
test/core/service/PackageManagerService/publish.test.ts | - Added test case for publish() to check strict validation of dependencies. |
test/core/service/PackageSyncerService/executeTask.test.ts | - Introduced new test suite for validating dependencies in PackageSyncerService . |
test/fixtures/registry.npmjs.org/invalid-deps.json | - Added new JSON fixture for a package with invalid dependencies. |
PackageManagerService.ts
related to the addition of the acceptDependencies
property are relevant as they modify the same file and involve handling package metadata, which is closely related to the dependency validation introduced in the main PR.🐰 In the garden of code, where packages bloom,
A rabbit hops by, dispelling the gloom.
With dependencies checked, and errors in sight,
Publishing packages now feels just right!
So let’s raise a cheer, for validation's new song,
In the world of our code, where we all belong! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 95.23810%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 96.46%. Comparing base (
d6f0e1d
) to head (fd428b4
). Report is 2 commits behind head on master.
Files with missing lines | Patch % | Lines |
---|---|---|
app/core/service/PackageManagerService.ts | 92.59% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests
Chores