# Release Notes

## Version 1.3.0

### 📅 Release Date

September 11, 2026

### 📖 Overview

Two helpers arrive in `utils/`, and both are here for the same reason: they had already been written twice in the
estate's applications, and the copies had started to disagree.

`chunk` existed in two applications with genuinely different edge-case behaviour — one treated a non-positive size as
`1`, the other returned the whole input as a single run. `Json.parse` existed in two other applications, identical down
to the doc comment, differing only in the example. Neither divergence had caused an incident. Neither could be caught by
a test, because no test could see both copies.

That is the test `utils/` sets for itself, stated in its own remarks: a helper that is pure, vendor-neutral, and already
written twice in two consumers is one those consumers should share rather than keep diverging copies of. Both qualify.
Nothing else in this release changes the surface.

### ⚠️ Breaking Changes

- **None.** Both additions are new exports; no existing export is removed, renamed, or narrowed.

### 🚀 Features

| Export | Method  | For                                                              |
| ------ | ------- | ---------------------------------------------------------------- |
| `List` | `chunk` | Partitioning a batch against a ceiling the caller names          |
| `Json` | `parse` | Reading a body the caller did not write, without a `try`/`catch` |

- **`List.chunk(values, size)`** splits a list into consecutive runs of at most `size`. Written for the case where a
  downstream call has a ceiling on how much it will take at once — a database batch bounded by statements or bound
  parameters, an API bounded by ids per request — and the caller knows that ceiling while this function does not. The
  bound is the caller's to name.

  On the reconciliation: a `size` that is non-positive or non-finite yields a step of `1` rather than looping forever or
  collapsing the input into a single run. A `size` read from configuration can arrive as `0` or `NaN`, and of the two
  behaviours the estate had, a step of `1` is the one that degrades safely — the alternative turns a concurrency limiter
  into an unbounded fan-out precisely when its configuration is wrong.

  Both existing call sites already guard against a non-positive size before reaching `chunk`, so adopting this is
  behaviour-preserving for them today. The reconciliation matters for the next caller, not the current ones.

- **`Json.parse<T>(text)`** parses without throwing, answering `null` for every way the input fails to be a usable
  object — malformed syntax, an empty body, or a bare `null` literal — because none of them is something a handler can
  act on differently. A falsy primitive that is still a value (`0`, `false`) comes back intact.

### 🔧 Enhancements

- **CI follows the estate's current workflow shape.** `features.yml`, `main.yml`, and `release.yml` were updated in step
  with the other packages, so a change to the shared reusable workflows lands the same way here as everywhere else.
- **`wrangler.json` carries its `$schema` and the reference binding order.** Repository configuration only — nothing in
  `package.json#files` changes — but this file is what a consumer copies when wiring their own bindings, so its ordering
  is documentation.
- **`CODE_OF_CONDUCT.md`** was brought in line with the Contributor Covenant text the rest of the estate carries.

### 🐛 Bug Fixes

- **None.** No prior behaviour changed.

### 🔐 Security

- **The kernel is still dependency-free.** `dependencies` and `peerDependencies` both remain empty, and neither helper
  reaches for anything: `List.chunk` is array arithmetic and `Json.parse` wraps a global. The `no-restricted-imports`
  rule naming no vendor, runtime, or HTTP framework is unchanged and still passing.
- **`qs` bumped in the development tree** via Dependabot. A `devDependency` only — it does not ship, since
  `package.json#files` publishes `lib/` alone.

### 🧪 Tests

`npm run lint`, `npm run test:run`, `npm run build`, and `npm run build:docs` all clean. **164 specs across 12 suites**,
up from 145 across 10.

- `test/utils/List.spec.ts` covers the boundaries that matter — an exact multiple, a remainder, an empty input — and the
  arguments a caller should never pass but eventually does, since a `size` of `0` or `NaN` from configuration would
  otherwise not terminate.
- `test/utils/Json.spec.ts` covers each way input fails to be usable, and asserts that `0` and `false` survive, which is
  the case a naive falsy check gets wrong.

### 📚 Documentation

- **`utils/` states its own admission test.** The module remarks now name why `Signature`, `List` and `Json` are here
  although the kernel itself calls none of them, and why an application's own helpers — the ones encoding decisions
  about its input and its domain — are not.
- `docs/changes-log/2026-09-05.md` records the working detail behind `List`.

### ⬆️ Upgrading

```bash
npm install @bayudwiyansatria/core@1.3.0
```

Nothing to change on upgrade. To adopt the helpers, delete the local copy and re-export in its place, which keeps every
existing import path working:

```ts
// src/utils/chunk.ts — entire file
export { List } from '@bayudwiyansatria/core'

export const chunk = List.chunk
```

Check the edge-case behaviour of the copy being deleted before replacing it. Where a caller can pass a size from
configuration, confirm it guards against `0` — this release's semantics give a step of `1` there, which is not what
every previous copy did.

### 🚨 Known Issues

- **None.**

### 📦 Dependencies

| Kind    | Package |
| ------- | ------- |
| Runtime | None    |
| Peer    | None    |

Unchanged. The kernel names no vendor and takes no dependency by design.

### 👥 Contributors

- Bayu Dwiyan Satria

### 🙏 Acknowledgments

Thanks to the four applications that carried these helpers independently long enough to make the case for sharing them —
and, in `chunk`'s case, long enough for the two copies to disagree, which is the clearest argument this package makes
for its own existence.

For more information, visit the project's [GitHub repository](https://github.com/bayudwiyansatria/nodejs-core).
