Closed fengmk2 closed 1 month ago
The changes enhance the package version file synchronization process by introducing a whitelist mechanism for unpkg file synchronization, improving logging, and adding new configuration options. These modifications provide better control over the packages allowed for unpkg synchronization and enhance code readability and maintainability.
Files | Change Summary |
---|---|
app.ts | Added binaryHTML: string; to the Application interface. |
app/core/event/SyncPackageVersionFile.ts | Imported ForbiddenError from 'egg-errors'. |
app/core/service/PackageVersionFileService.ts | Introduced getFullname function, PackageVersionRepository , private fields for unpkg whitelist, and new methods for whitelist management. Updated syncPackageVersionFiles method. |
app/port/config.ts | Added enableSyncUnpkgFilesWhiteList boolean property to CnpmcoreConfig type. |
app/port/controller/PackageVersionFileController.ts | Simplified conditional logic for file redirection. |
app/port/controller/package/SavePackageVersionController.ts | Introduced lockName constant and updated logging to include it. |
config/config.default.ts | Added enableSyncUnpkgFilesWhiteList: false to cnpmcoreConfig object. |
test/port/controller/PackageVersionFileController/listFiles.test.ts | Added test cases related to enableSyncUnpkgFilesWhiteList . |
🐇 In code we trust, with changes bright, A whitelist guards the sync at night. Logs now clear, with names in sight, Configs set to steer the flight. Test the files, ensure they're right, Our app's now ready for the light. 🌟
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 91.01124%
with 8 lines
in your changes are missing coverage. Please review.
Project coverage is 96.81%. Comparing base (
ff00e42
) to head (344bf2d
). Report is 2 commits behind head on master.
Files | Patch % | Lines |
---|---|---|
app/core/event/SyncPackageVersionFile.ts | 46.66% | 8 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
see https://github.com/cnpm/unpkg-white-list
Summary by CodeRabbit
New Features
enableSyncUnpkgFilesWhiteList
to enhance package version file synchronization.Improvements
Tests
enableSyncUnpkgFilesWhiteList
configuration to ensure reliability.