keyv - chore: remove cyclic workspace dependencies#1844
Conversation
Remove devDependencies on @keyv/compress-brotli, @keyv/compress-gzip, @keyv/compress-lz4, @keyv/memcache, @keyv/mongo, @keyv/sqlite, and @keyv/test-suite from keyv core to eliminate cyclic workspace dependency warnings during pnpm install. Also remove unused @keyv/test-suite and keyv devDependencies from @keyv/serialize. Replace external adapter usage in tests with inline mock compression adapters and in-memory store adapters. Remove suite.test.ts as the compliance tests are already run by each adapter package. https://claude.ai/code/session_01NpH5nuxAZHEs8ApTeBoY5N
Summary of ChangesHello @jaredwray, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on improving the project's dependency management and testing infrastructure. By removing cyclic workspace dependencies and replacing external test adapters with internal mocks, the changes aim to create a more robust and isolated testing environment. This also streamlines the build process by eliminating unnecessary package references and redundant test suites. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively removes cyclic workspace dependencies by replacing dev dependencies on other @keyv packages with inline mock adapters for testing purposes. This is a valuable change that improves the overall health and maintainability of the monorepo. The implementation is solid, introducing mock compression and store adapters to decouple the core keyv package from its adapters during testing. I've identified one area for improvement concerning duplicated test helper functions across several test files and have left a comment with a suggestion to refactor them into a shared utility file. Besides that, the changes look great.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1844 +/- ##
===========================================
- Coverage 100.00% 99.79% -0.21%
===========================================
Files 32 32
Lines 2432 2432
Branches 448 448
===========================================
- Hits 2432 2427 -5
- Misses 0 5 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Move duplicated delay, createMockCompression, and createStore helpers from test.ts, get-raw.test.ts, and keyv-hooks.test.ts into a shared test/test-utils.ts file. Uses the most complete version of createStore (with getMany, has, iterator, disconnect, and namespace support). https://claude.ai/code/session_01NpH5nuxAZHEs8ApTeBoY5N
Rename test/test.ts to test/keyv.test.ts to follow the *.test.ts naming convention. This simplifies the vitest include pattern to just 'test/*.test.ts', cleanly excluding non-test files like test-utils.ts. https://claude.ai/code/session_01NpH5nuxAZHEs8ApTeBoY5N
Test helper files like test-utils.ts are not source code and should not count toward coverage metrics. https://claude.ai/code/session_01NpH5nuxAZHEs8ApTeBoY5N
Remove devDependencies on @keyv/compress-brotli, @keyv/compress-gzip,
@keyv/compress-lz4, @keyv/memcache, @keyv/mongo, @keyv/sqlite, and
@keyv/test-suite from keyv core to eliminate cyclic workspace dependency
warnings during pnpm install. Also remove unused @keyv/test-suite and
keyv devDependencies from @keyv/serialize.
Replace external adapter usage in tests with inline mock compression
adapters and in-memory store adapters. Remove suite.test.ts as the
compliance tests are already run by each adapter package.
https://claude.ai/code/session_01NpH5nuxAZHEs8ApTeBoY5N