v7.0.0
Changes
- break(package): 馃挜 Publish runtime-neutral ESM and CommonJS entry points
Release details
- npm: https://www.npmjs.com/package/@haskou/value-objects/v/7.0.0
- Pull request: #59
- Source branch:
break/package-formats - Version bump:
major
Pull request notes
Summary
Publish ESM and CommonJS entry points backed by one CommonJS runtime implementation, with format-appropriate TypeScript declarations. The ESM wrapper re-exports the same classes and the same type definitions, preserving equality and global configuration in mixed module graphs. import resolves to dist/index.mjs / dist/index.d.mts, while require resolves to dist/index.cjs / dist/index.d.cts.
- Remove the package-level Node.js
enginesrestriction. Generated code targets ES2022; identifier generation uses the installed platform-specificuuiddependency from #61. - Separate production and test TypeScript configuration so production does not inherit Node/Jest ambient types.
- Remove the unused direct
tslibdependency andimportHelpers. Generated JavaScript and declarations contain notslibreferences; it remains in the lockfile for development dependencies that require it. - Retain
buffer, which is used by IDs, hashes, and the publicMediaAPI. Replacing it requires a separate API migration. - Add distribution contract tests, ESM/CommonJS smoke checks, Publint and Are the Types Wrong validation, and update package documentation.
One commit based on current master after #53, #56, and #57. Replaces #58 using the repository-required break/* release branch convention. Includes the already merged #61 for Node/browser identifier generation. No production Value Object changes or GitHub workflow changes.
Review fixes from #58
- Both module conditions share runtime class identity and NullObject configuration. Distribution checks cover export identity, bidirectional equality, collection deduplication, and configuring null construction through either entry.
tests/tsconfig.jsonextends../tsconfig.test.json; the nested project type-checks successfully.
Compatibility / major release
CommonJS remains supported through the package root. The distribution layout changes, so this uses a break/* branch for a major release. Browser consumers need a bundler that supports CommonJS and the buffer package. Consumers importing the old internal dist/index.js path must migrate to the package root. Removing engines does not imply support for runtimes without the required JavaScript/Web APIs.
Validation
- Frozen-lockfile dependency installation passed.
- 567 tests passed.
- ESLint passed.
- Production TypeScript checking, nested test-project checking, and the shared-runtime distribution build passed.
- Both published entry points loaded successfully with identical exports and shared state; exported JavaScript/declaration paths exist.
- Are the Types Wrong reported no problems; Publint passed with informational suggestions about
typeandengines.node. - Documentation build passed.
- Confirmed generated JavaScript and declaration files do not reference
tslib.