Skip to content

v2.1.0

Latest

Choose a tag to compare

@aricart aricart released this 16 Nov 19:36
26ee75a

What's Changed

This is a packaging release - the API and the keys are unchanged.
The npm package now ships both ES modules and CommonJS.

Until now the npm package was CommonJS only. Bundlers (esbuild, webpack, Vite,
Metro) can't tree-shake CommonJS, and ESM apps loaded nkeys through a CommonJS
compatibility layer. Shipping an ES module build lets bundlers keep only what an
app uses and lets import load native ESM. The CommonJS build stays, so
existing require users, older TypeScript module settings and tools that
don't understand ESM keep working unchanged. Use one or the other within an
application: mixing import and require loads two copies.

The package now declares an exports map, so only @nats-io/nkeys (and
@nats-io/nkeys/package.json) can be imported. Imports of internal paths such
as @nats-io/nkeys/lib/nkeys no longer resolve; import from the package root
instead.

  • Update versions and dependencies by @aricart in #58
  • remove use of deprecated NODE_AUTH_TOKEN env in npm publish step by @aricart in #59
  • build: npm module enhancements, 2.1.0-0 by @aricart in #60
  • ci: supported node versions, current actions, deno 2.9, typescript 6, and claude reviews by @aricart in #61

Full Changelog: v2.0.3...v2.1.0