Skip to content

Conversation

@jaredwray
Copy link
Owner

@jaredwray jaredwray commented Jan 5, 2026

Please check if the PR fulfills these requirements

  • Followed the Contributing guidelines and Code of Conduct
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
node-cache - feat: (breaking) moving to Keyv as the storage

@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0280657) to head (036e00c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1524   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines         2369      2401   +32     
  Branches       516       530   +14     
=========================================
+ Hits          2369      2401   +32     

☔ 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a breaking change to the node-cache package by replacing the Cacheable storage layer with direct Keyv integration. The primary goal is to simplify the storage architecture while maintaining compatibility with Keyv adapters.

Key Changes

  • Replaced Cacheable with direct Keyv usage, removing the primary/secondary store concept
  • Added support for shorthand TTL strings (e.g., '1h', '100ms') in addition to milliseconds
  • Replaced dependency from cacheable to @cacheable/utils for utility functions

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
packages/node-cache/src/store.ts Refactored NodeCacheStore to use Keyv directly, added manual stats tracking, removed Cacheable abstraction
packages/node-cache/src/index.ts Updated NodeCache to use Stats from @cacheable/utils, implemented custom clone method
packages/node-cache/test/store.test.ts Updated tests to reflect single store model, removed Keyv import, fixed typos (restult -> result)
packages/node-cache/test/index.test.ts Added test for null value handling with cloning
packages/node-cache/package.json Changed dependency from cacheable to @cacheable/utils
packages/node-cache/README.md Updated documentation to reflect single store model, clarified TTL shorthand support
Comments suppressed due to low confidence (1)

packages/node-cache/test/store.test.ts:50

  • The test assumes that when maxKeys limit is reached (3 keys), the 4th set operation will fail and return false, so test4 should be undefined. However, the test doesn't verify the return value of the set operations. It should verify that the first 3 set operations return true and the 4th returns false to properly test the maxKeys behavior.
		await store.set("test1", "value1");
		await store.set("test2", "value2");
		await store.set("test3", "value3");
		await store.set("test4", "value4");
		const result1 = await store.get("test4");
		expect(result1).toBeUndefined();

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI commented Jan 5, 2026

@jaredwray I've opened a new pull request, #1525, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Jan 5, 2026

@jaredwray I've opened a new pull request, #1526, to work on those changes. Once the pull request is ready, I'll request review from you.

jaredwray and others added 2 commits January 5, 2026 16:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Jan 5, 2026

@jaredwray I've opened a new pull request, #1527, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Jan 5, 2026

@jaredwray I've opened a new pull request, #1528, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Jan 5, 2026

@jaredwray I've opened a new pull request, #1529, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Jan 5, 2026

@jaredwray I've opened a new pull request, #1530, to work on those changes. Once the pull request is ready, I'll request review from you.

jaredwray and others added 2 commits January 5, 2026 17:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Jan 5, 2026

@jaredwray I've opened a new pull request, #1531, to work on those changes. Once the pull request is ready, I'll request review from you.

@jaredwray jaredwray merged commit b27af32 into main Jan 5, 2026
9 checks passed
@jaredwray jaredwray deleted the node-cache---feat-(breaking)-moving-to-Keyv-as-the-storage branch January 5, 2026 22:27
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