From a5d26fbf5ed2636c8933e98839f4a7fc2f87b5b1 Mon Sep 17 00:00:00 2001 From: Stephen Hellicar Date: Tue, 14 Apr 2026 05:52:14 +1000 Subject: [PATCH 1/2] Release core-di 3.1.7 --- .claude/testament/2026-04-14.md | 18 ++++++++++++++++++ packages/core-di/CHANGELOG.md | 11 +++++++++++ packages/core-di/changes.jsonl | 1 + packages/core-di/package.json | 2 +- 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/.claude/testament/2026-04-14.md b/.claude/testament/2026-04-14.md index fce5874..f51af18 100644 --- a/.claude/testament/2026-04-14.md +++ b/.claude/testament/2026-04-14.md @@ -19,3 +19,21 @@ Missing the `inject.ts` change would have left a dead import and a broken build. ### Where metadata flows `dependsOn.ts` writes when a `@dependsOn` decorator fires. `ServiceProvider.ts` reads when resolving dependencies. The key is always `'design:dependencies'`, the value is `Record>`. Nothing else in the package touches the metadata API. + + +# 05:52 + +## Release core-di 3.1.7 + +Straightforward patch release. The changes (WeakMap replacement, @abraham/reflection removal) were already merged in PR #24. + +The three-step release process: +1. `pnpm version patch --no-git-tag-version` in the package directory +2. Append the release entry to `changes.jsonl` manually (the tag field uses `core-di@3.1.7` format, not bare `3.1.7`) +3. `pnpm changelog ../packages/core-di` from the `scripts/` directory + +The changelog generator reads `changes.jsonl` in full and regenerates the entire `CHANGELOG.md`. The version link at the bottom correctly uses the `core-di@3.1.7` tag format because that is what the `tag` field in the release entry contains. + +All older releases in the CHANGELOG still have bare version tags (e.g. `3.1.6`) because that is what was recorded in their release entries at the time. This is expected and correct. + +Build, type-check, 64 tests: all passed. diff --git a/packages/core-di/CHANGELOG.md b/packages/core-di/CHANGELOG.md index 7a24683..098573a 100644 --- a/packages/core-di/CHANGELOG.md +++ b/packages/core-di/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.1.7] - 2026-04-14 + +### Changed + +- Replace @abraham/reflection with a global WeakMap for metadata storage + +### Removed + +- Remove @abraham/reflection dependency + ## [3.1.6] - 2026-02-28 ### Changed @@ -183,6 +193,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial release. +[3.1.7]: https://github.com/shellicar/ecosystem/releases/tag/core-di@3.1.7 [3.1.6]: https://github.com/shellicar/ecosystem/releases/tag/3.1.6 [3.1.5]: https://github.com/shellicar/ecosystem/releases/tag/3.1.5 [3.1.4]: https://github.com/shellicar/ecosystem/releases/tag/3.1.4 diff --git a/packages/core-di/changes.jsonl b/packages/core-di/changes.jsonl index 0edbc77..282dd12 100644 --- a/packages/core-di/changes.jsonl +++ b/packages/core-di/changes.jsonl @@ -64,3 +64,4 @@ {"type":"release","version":"3.1.6","date":"2026-02-28","tag":"3.1.6"} {"description":"Replace @abraham/reflection with a global WeakMap for metadata storage","category":"changed"} {"description":"Remove @abraham/reflection dependency","category":"removed"} +{"type":"release","version":"3.1.7","date":"2026-04-14","tag":"core-di@3.1.7"} diff --git a/packages/core-di/package.json b/packages/core-di/package.json index 1d59ce7..1bc7f81 100644 --- a/packages/core-di/package.json +++ b/packages/core-di/package.json @@ -1,7 +1,7 @@ { "name": "@shellicar/core-di", "private": false, - "version": "3.1.6", + "version": "3.1.7", "type": "module", "license": "MIT", "author": "Stephen Hellicar", From 78da21750b3c8b9b1f1f3a4730584d464732017b Mon Sep 17 00:00:00 2001 From: Stephen Hellicar Date: Tue, 14 Apr 2026 05:53:57 +1000 Subject: [PATCH 2/2] Distil testament for core-di release --- .claude/testament/2026-04-14.md | 40 +++++++++------------------------ 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/.claude/testament/2026-04-14.md b/.claude/testament/2026-04-14.md index f51af18..1003a36 100644 --- a/.claude/testament/2026-04-14.md +++ b/.claude/testament/2026-04-14.md @@ -1,39 +1,19 @@ -# 05:30 +# core-di @abraham/reflection removal -## Remove @abraham/reflection from core-di +## inject.ts is not just a side effect -### Not just metadata.ts - -The prompt says to update `metadata.ts`. Three files actually needed touching: +The prompt targets `metadata.ts`. Three files actually need touching: 1. `src/private/metadata.ts` - the WeakMap replacement -2. `inject.ts` at the package root - this was the tsup inject target (prepended to every bundle). It imported `@abraham/reflection` to ensure the polyfill loaded before any bundle code. After the dependency was removed, this file needed its import cleared. The file still exists and `tsconfig.json` still references it as the inject entry; leaving it empty is correct and harmless. -3. `package.json` / `pnpm-lock.yaml` - via `pnpm remove` - -Missing the `inject.ts` change would have left a dead import and a broken build. - -### WeakMap semantics are equivalent here - -`@abraham/reflection` `getMetadata` walked the prototype chain (`ordinaryGetMetadata`). The WeakMap replacement does not. This is fine: both callers (`dependsOn.ts` and `ServiceProvider.ts`) always call with the class constructor directly, never with an instance or subclass. The prototype walk was never exercised by this codebase. - -### Where metadata flows - -`dependsOn.ts` writes when a `@dependsOn` decorator fires. `ServiceProvider.ts` reads when resolving dependencies. The key is always `'design:dependencies'`, the value is `Record>`. Nothing else in the package touches the metadata API. - - -# 05:52 - -## Release core-di 3.1.7 +2. `inject.ts` at the package root - this is the tsup inject entry, prepended to every bundle. It imported `@abraham/reflection` to bootstrap the polyfill before any bundle code ran. After the dependency is removed, the import must be cleared. The file should remain (tsconfig still references it); leaving it empty is correct. +3. `package.json` / `pnpm-lock.yaml` via `pnpm remove` -Straightforward patch release. The changes (WeakMap replacement, @abraham/reflection removal) were already merged in PR #24. +Missing the `inject.ts` change leaves a dead import and a broken build with no obvious connection to `metadata.ts`. -The three-step release process: -1. `pnpm version patch --no-git-tag-version` in the package directory -2. Append the release entry to `changes.jsonl` manually (the tag field uses `core-di@3.1.7` format, not bare `3.1.7`) -3. `pnpm changelog ../packages/core-di` from the `scripts/` directory +## Why the WeakMap replacement is safe -The changelog generator reads `changes.jsonl` in full and regenerates the entire `CHANGELOG.md`. The version link at the bottom correctly uses the `core-di@3.1.7` tag format because that is what the `tag` field in the release entry contains. +`@abraham/reflection` `getMetadata` walked the prototype chain. The WeakMap replacement does not. This is safe because both callers (`dependsOn.ts` and `ServiceProvider.ts`) always pass the class constructor directly, never an instance or subclass. The prototype walk was never exercised. -All older releases in the CHANGELOG still have bare version tags (e.g. `3.1.6`) because that is what was recorded in their release entries at the time. This is expected and correct. +## Older CHANGELOG entries have bare version tags -Build, type-check, 64 tests: all passed. +The changelog generator uses whatever `tag` field is in each release entry. Releases before the `core-di@X.Y.Z` tag format was adopted used bare `3.1.6`-style values. Those links will not resolve to real tags. This is pre-existing; do not touch it.