Repository navigation
Releases: haskou/metrics
Release list
v1.2.3
Changes
- fix(deps): ⬆️ update dependency @haskou/value-objects to ^8.4.3
Release details
- npm: https://www.npmjs.com/package/@haskou/metrics/v/1.2.3
- Pull request: #20
- Source branch:
- Version bump:
Pull request notes
This PR contains the following updates:
| Package | Change | Age | Confidence |
|---|---|---|---|
| @haskou/value-objects (source) | ^8.3.4 → ^8.4.3 |
Release Notes
haskou/value-objects (@haskou/value-objects)
v8.4.3
Changes
- fix(exports): 🐛 Export ComparableItem and SerializedValue
Release details
- npm: https://www.npmjs.com/package/@haskou/value-objects/v/8.4.3
- Pull request: #101
- Source branch:
fix/export-comparable-item-serialized-value - Version bump:
patch
Pull request notes
What
ComparableItem (constraint of UniqueObjectArray<T>) and SerializedValue (constraint of PrimitiveOf<T>) appear in the public signatures but were not exported, so consumers could not name them.
ComparableItemmoves tosrc/interfaces/ComparableItem.ts.SerializedValuemoves tosrc/types/SerializedValue.ts.- Both are re-exported through the existing
interfacesandtypesbarrels, so they are available from the package root. UniqueObjectArray.tsandPrimitiveOf.tsnow import them instead of declaring them.
Notes
- Neither type was exported in any earlier release I checked (8.3.4, 8.4.2). This adds exports, it does not restore removed ones.
- Pure type-level change, no runtime behaviour change.
Verification
yarn test (717 tests) and yarn build pass. Coverage stays at 100%. dist/index.d.cts declares both with export, and a throwaway consumer importing them from dist compiled under --strict.
v8.4.2
Changes
- fix(positive-integer): 🐛 Extend PositiveNumber instead of Integer
Release details
- npm: https://www.npmjs.com/package/@haskou/value-objects/v/8.4.2
- Pull request: #100
- Source branch:
fix/positive-integer-extends-positive-number - Version bump:
patch
Pull request notes
What
PositiveInteger now extends PositiveNumber instead of Integer. PositiveNumber validates the sign and PositiveInteger adds the integer check (InvalidIntegerError).
Behaviour changes
new PositiveInteger(1) instanceof Integeris nowfalse. Code typing a parameter asIntegerand passing aPositiveIntegerwill stop compiling.FileSizeis the only consumer in this repo and is unaffected.- The sign is validated first, so
new PositiveInteger(-0.5)throwsInvalidPositiveNumberError(it used to throwInvalidIntegerError). - The
% 1 === 0check now exists in bothIntegerandPositiveInteger.
Docs and tests
docs/reference/positive-integer.md updated (signature and notes). Spec now asserts inheritance from PositiveNumber, no inheritance from Integer, and the new error for -0.5.
Verification
yarn test (717 tests) and yarn build pass. Coverage stays at 100%.
v8.4.1
Changes
- fix(file-size): 🐛 Type FileSize add and subtract as FileSize
Release details
- npm: https://www.npmjs.com/package/@haskou/value-objects/v/8.4.1
- Pull request: #99
- Source branch:
fix/file-size-arithmetic-types - Version bump:
patch
Pull request notes
What
FileSize.add and FileSize.subtract were typed as NumberValueObject (inherited), although at runtime they return a FileSize. They are now declared as add(other: FileSize): FileSize and subtract(other: FileSize): FileSize.
Notes
- Adding or subtracting two
FileSizeis a closed operation, so the return type is exact.NumberValueObjectis unchanged: its arithmetic can fail on subclass invariants, sothiswould be a wrong promise there. - Implemented with
clone(), so subclasses ofFileSizekeep their own type at runtime. - Breaking at type level:
size.add(100)with a plain number no longer compiles. Passnew FileSize(100). - Docs for
FileSizeupdated with the new signatures and the negative-result error.
Verification
yarn test, yarn build pass. Coverage stays at 100%. The arithmetic test calls FileSize.to() on the results, so it only compiles if both return FileSize.
v8.4.0
Changes
- feat(file-size): ✨ Add FileSize, FileSizeUnit and PositiveInteger value objects
Release details
- npm: https://www.npmjs.com/package/@haskou/value-objects/v/8.4.0
- Pull request: #98
- Source branch:
feat/file-size - Version bump:
minor
Pull request notes
What
PositiveInteger(extendsInteger, accepts0).FileSizeUnit(extendsEnum): SI (kB..PB, base 1000) and IEC (KiB..PiB, base 1024) units, with a single typed bytes-per-unit table andFileSizeUnit.SI/FileSizeUnit.IECsets.FileSize(extendsPositiveInteger, stored in bytes):fromBytes,from(value, unit),parse,toBytes,to(unit),toHumanReadable(units), plus inherited arithmetic.
Behaviour worth reviewing
toHumanReadablereturns{ value, unit }: no formatting or rounding in the domain.fromandparseround to the nearest byte.multiply/dividedo not round and throwInvalidIntegerErroron non-integer results.subtractbelow zero throwsInvalidPositiveNumberError.- Static factories use the
this: new (...) => Tpattern from #94, so subclasses get their own type (covered inSubclassFactories.spec.ts). parseunits are exact and case-sensitive (KBis invalid).
Docs
Reference pages for the three classes, plus sidebar, reference index, docs home and README entries. The README table was re-aligned by prettier.
Verification
yarn test, yarn build and yarn docs:build pass. Coverage is 100% (statements, branches, functions, lines).
Configuration
📅 Schedule: (in timezone Europe/Madrid)
- Branch creation
- At any time (no schedule defined)
- Automerge
- At any time (no schedule defined)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.
v1.2.2
Changes
- fix(deps): ⬆️ update dependency @haskou/value-objects to ^8.3.4
Release details
- npm: https://www.npmjs.com/package/@haskou/metrics/v/1.2.2
- Pull request: #9
- Source branch:
- Version bump:
Pull request notes
This PR contains the following updates:
| Package | Change | Age | Confidence |
|---|---|---|---|
| @haskou/value-objects (source) | ^8.3.3 → ^8.3.4 |
Release Notes
haskou/value-objects (@haskou/value-objects)
v8.3.4
Changes
- fix(factories): 🐛 Return subclass from static factories (#94)
Release details
- npm: https://www.npmjs.com/package/@haskou/value-objects/v/8.3.4
- Pull request: #95
- Source branch:
fix/subclass-static-factories - Version bump:
patch
Pull request notes
Closes #94
UUID.generate, ShortId.generate, Timestamp.now/new/fromSeconds and Duration.from* now instantiate through the receiver (new this(...)) with a typed this, so subclasses get subclass instances and types, and isEqual works against them.
Note: calling the factories detached (const f = UUID.generate; f(), .map(Duration.fromDays)) no longer works.
Adds regression tests in tests/value-objects/SubclassFactories.spec.ts.
Configuration
📅 Schedule: (in timezone Europe/Madrid)
- Branch creation
- At any time (no schedule defined)
- Automerge
- At any time (no schedule defined)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.
v1.2.1
Changes
- fix(deps): ⬆️ update dependency @haskou/value-objects to ^8.3.3
Release details
- npm: https://www.npmjs.com/package/@haskou/metrics/v/1.2.1
- Pull request: #7
- Source branch:
- Version bump:
Pull request notes
Bumps runtime dependency @haskou/value-objects ^7.0.3 → ^8.3.3 (major; yarn.lock also drops the now-removed buffer/uuid transitive deps).
Breaking changes in v8 (UniqueObjectArray now immutable; Media.getBuffer returns Uint8Array) do not affect this repo: only simple value objects are used; no source changes needed.
Verification (all pass): yarn install, yarn build, yarn lint, yarn test (build + typecheck + jest), yarn test:package. Note: yarn lint before yarn build reports errors in tests/compatibility because they import dist; unrelated to the bump.
v1.2.0
Changes
- feat(runtime): ✨ Add runtime portability and shared ESM/CJS state
Release details
- npm: https://www.npmjs.com/package/@haskou/metrics/v/1.2.0
- Pull request: #6
- Source branch:
- Version bump:
Pull request notes
El paquete exigía Node >=22 y duplicaba configuración, buffers e identidad de clases al combinar ESM, CommonJS o subpaths. Esta PR hace portable el núcleo y comparte implementación y tipos entre los formatos en Node.
- Selecciona el muestreo nativo automáticamente en Node mediante imports condicionales:
recordCpuyrecordMemorysiguen funcionando sin configuración adicional. En navegador se omiten esas mediciones; unresourceUsagepersonalizado conserva prioridad. - Publica ESM nativo para navegador y wrappers ESM sobre módulos CJS compartidos en Node, con declaraciones compatibles entre ambos formatos.
- Actualiza dependencias, README y documentación; conserva TypeScript 6 por compatibilidad con ESLint.
- Añade verificación del paquete en Node 22/24/26 y del bundle de navegador sin globals de Node. El playground funciona sin compilar previamente la librería.
Validación local: lint, typecheck, 87 tests con cobertura del 100 %, consumidores TypeScript ESM/CJS y Bundler, comprobaciones del paquete en Node 22/24/26, bundle portable y compilación de docs/playground. publint únicamente sugirió añadir engines.node, omitido deliberadamente.
No cambia el comportamiento público de CPU/memoria en Node. Publicación minor mediante rama feat/*.
v1.1.0
Changes
- feat(playground): ✨ Show call attributes in logs
Release details
- npm: https://www.npmjs.com/package/@haskou/metrics/v/1.1.0
- Pull request: #5
- Source branch:
- Version bump:
Pull request notes
Summary
- render attributes for
calledlog entries in the playground telemetry panel - pass the searched repository as an instrumentation attribute
- keep the attribute rendering compact and stable by sorting keys
Validation
- yarn typecheck
- yarn playground:build
v1.0.0
Changes
- break(metrics): 💥 Harden metrics public API
Release details
- npm: https://www.npmjs.com/package/@haskou/metrics/v/1.0.0
- Pull request: #4
- Source branch:
- Version bump:
Pull request notes
Summary
- add global instrumentation defaults to
configureMetrics - restrict the root package exports to the public entrypoints
- expose advanced APIs through
contractsandmodelsubpaths - include structured error details in failure logs
- document Prometheus cardinality rules
Impact
This is a breaking API hardening change because support/model exports are no longer re-exported from the package root.
Validation
- yarn lint
- yarn typecheck
- yarn test:coverage
- yarn docs:build
- yarn test:package
- yarn build
v0.4.0
Changes
- feat(playground): ✨ Show telemetry from live requests
Release details
- npm: https://www.npmjs.com/package/@haskou/metrics/v/0.4.0
- Pull request: #3
- Source branch:
- Version bump:
Pull request notes
Summary
- add a Vite playground that calls the GitHub repository API
- show live metrics, logs, request results, and source context
- include playground-specific errors and build configuration
Validation
- yarn typecheck
- yarn playground:build
v0.3.0
Changes
- feat(playground): ✨ Show telemetry from live requests
Release details
- npm: https://www.npmjs.com/package/@haskou/metrics/v/0.3.0
- Pull request: #2
- Source branch:
- Version bump:
Pull request notes
Changes
- Replace the fixed delay and forced failure controls with a live GitHub repository request.
- Present repository data, metrics, structured logs, and stack traces as readable UI elements.
- Add explicit errors for invalid repository names and unsuccessful GitHub responses.
- Import the Node resource and system clock adapters directly so browser builds do not traverse
prom-client.
Motivation
The previous playground manufactured an 80 ms duration and accepted a boolean that forced the method to fail. Those controls demonstrated the output shape without proving that the library measured real work.
The new flow calls GitHub's public API through GitHubRepositoryFinder.find(). Visitors can inspect a public repository or enter a missing repository to capture a real HTTP failure.
Impact
The playground now reports network duration, calls, failures, logs, and stack traces produced by real executions. It keeps arguments out of telemetry and explains that CPU and RAM sampling require the Node.js adapter.
Direct adapter imports also remove Node module externalization warnings from the browser bundle.
Validation
yarn format:checkyarn lintyarn test:coverage: 39 suites, 81 tests, and 100% coverageyarn test:packageyarn pages:build
v0.2.0
Changes
- feat(ci): 👷 Add Codecov coverage reporting
Release details
- npm: https://www.npmjs.com/package/@haskou/metrics/v/0.2.0
- Pull request: #1
- Source branch:
- Version bump:
Pull request notes
Changes
- Match the
@haskou/value-objectsCI pattern with Node 24.18.0, Yarn caching, and a combined lint and coverage step. - Upload
coverage/lcov.infothroughcodecov-action@v5while retaining the metrics export and tarball checks. - Add the Codecov badge, link the published documentation, and document the release branches.
- Ignore
.npmrcso local configuration and tokens cannot enter Git.
Motivation
The repository generated coverage without sending it to Codecov. The README also omitted the release branch convention and linked the documentation through a repository path.
Impact
CI sends each coverage report to Codecov through the CODECOV_TOKEN secret. A Codecov outage will not block the pipeline.
Merging this feat/* branch triggers the corresponding minor release.
Validation
yarn format:checkyarn test:coverage: 39 suites, 81 tests, and 100% coverageyarn test:packageyarn pages:build