@classytic/repo-core 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/testing/conformance.mjs +25 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to `@classytic/repo-core` are documented here.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.22.0] - 2026-08-12
|
|
8
|
+
|
|
9
|
+
### Added — `pages: 0` conformance tests for empty results
|
|
10
|
+
|
|
11
|
+
- `runStandardRepoConformance` now asserts `pages: 0` for empty offset envelopes (both the primary `getAll` path and the `aggregatePaginate` path). The field had no assertion anywhere in the suite; two kit paths diverged silently: the primary offset path computed `ceil(0/limit) = 0` while aggregate and lookup paths used `Math.max(1, ceil(...)) = 1`. The contract is `0` — zero rows fill zero pages — and it is what every kit's primary path already returned. The missing assertion let the drift reach a consumer as golden-fixture breakage when a `lookups` join rerouted a list read onto the divergent path.
|
|
12
|
+
|
|
7
13
|
## [0.21.0] - 2026-08-10
|
|
8
14
|
|
|
9
15
|
### Added — LRU-bounded `createMemoryCacheAdapter`
|
|
@@ -1003,6 +1003,31 @@ function runStandardRepoConformance(harness) {
|
|
|
1003
1003
|
expect(out.data).toHaveLength(1);
|
|
1004
1004
|
expect(out.total).toBe(1);
|
|
1005
1005
|
});
|
|
1006
|
+
it("empty result reports pages: 0 (offset envelope)", async () => {
|
|
1007
|
+
const out = await ctx.repo.getAll({
|
|
1008
|
+
filters: { count: 999999 },
|
|
1009
|
+
page: 1,
|
|
1010
|
+
limit: 10
|
|
1011
|
+
});
|
|
1012
|
+
expect(out.data).toHaveLength(0);
|
|
1013
|
+
expect(out.total).toBe(0);
|
|
1014
|
+
expect(out.pages).toBe(0);
|
|
1015
|
+
});
|
|
1016
|
+
it.skipIf(skipNoAgg)("empty result reports pages: 0 (aggregatePaginate offset envelope)", async () => {
|
|
1017
|
+
if (!ctx.repo.aggregatePaginate) return;
|
|
1018
|
+
const result = await ctx.repo.aggregatePaginate.bind(ctx.repo)({
|
|
1019
|
+
filter: eq("category", "__no_such_category__"),
|
|
1020
|
+
groupBy: "category",
|
|
1021
|
+
measures: { n: { op: "count" } },
|
|
1022
|
+
page: 1,
|
|
1023
|
+
limit: 10
|
|
1024
|
+
});
|
|
1025
|
+
expect(result.method).toBe("offset");
|
|
1026
|
+
if (result.method !== "offset") throw new Error("expected offset envelope");
|
|
1027
|
+
expect(result.data).toHaveLength(0);
|
|
1028
|
+
expect(result.total).toBe(0);
|
|
1029
|
+
expect(result.pages).toBe(0);
|
|
1030
|
+
});
|
|
1006
1031
|
});
|
|
1007
1032
|
describe("Filter IR compilation parity", () => {
|
|
1008
1033
|
beforeEach(async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classytic/repo-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Driver-agnostic repository primitives: hooks, Filter IR, operations, pagination, cache contract. Foundation for mongokit, sqlitekit, pgkit, and prismakit. Lean by design — no plugins ship here; each kit owns its own.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|