feat(core-shared): add NoopRateLimit and InMemoryRateLimit implementations

NoopRateLimit always allows with Infinity remaining — zero-overhead default
for apps without a wired rate-limit impl. InMemoryRateLimit uses a Map-backed
fixed-window with check-at-read expiry and an injected clock for testability.
Both exported from the core-shared barrel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-20 08:30:35 +00:00
parent e2a5278899
commit 5ddc8e6484
7 changed files with 293 additions and 22 deletions

View File

@@ -1,18 +1,18 @@
{
"generatedAt": "2026-05-20T08:21:18.294Z",
"commit": "a633561",
"generatedAt": "2026-05-20T08:30:19.042Z",
"commit": "e2a5278",
"repo": {
"statements": 97.38,
"branches": 92.2,
"functions": 97.11,
"lines": 97.38,
"statements": 97.41,
"branches": 92.31,
"functions": 97.18,
"lines": 97.41,
"counts": {
"lf": 5807,
"lh": 5655,
"brf": 1166,
"brh": 1075,
"fnf": 346,
"fnh": 336
"lf": 5867,
"lh": 5715,
"brf": 1184,
"brh": 1093,
"fnf": 354,
"fnh": 344
}
},
"byPackage": {
@@ -101,17 +101,17 @@
}
},
"@repo/core-shared": {
"statements": 98.04,
"branches": 95.9,
"functions": 92.16,
"lines": 98.04,
"statements": 98.15,
"branches": 96.12,
"functions": 92.73,
"lines": 98.15,
"counts": {
"lf": 1073,
"lh": 1052,
"brf": 317,
"brh": 304,
"fnf": 102,
"fnh": 94
"lf": 1133,
"lh": 1112,
"brf": 335,
"brh": 322,
"fnf": 110,
"fnh": 102
}
},
"@repo/core-ui": {