Skip to content

v0.1.0

Latest

Choose a tag to compare

@aricart aricart released this 16 Nov 19:43
fda3a1f

What's Changed

This is a packaging release - the API is unchanged. The npm package now ships
both ES modules and CommonJS, and depends on @nats-io/nkeys 2.1.0, which
ships the same dual build.

Until now the npm package was CommonJS only. Bundlers (esbuild, webpack, Vite,
Metro) can't tree-shake CommonJS, and ESM apps loaded jwt 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/jwt (and
@nats-io/jwt/package.json) can be imported. Imports of internal paths such
as @nats-io/jwt/lib/jwt no longer resolve; import from the package root
instead. Node 18 or later is required.

  • Update Node.js, Deno versions, and dependencies by @aricart in #48
  • build: npm module enhancements, ci, 0.1.0-0 by @aricart in #52
  • ci: publish to jsr with the runner's deno by @aricart in #53
  • chore: bump version to 0.1.0-1 by @aricart in #54

Full Changelog: v0.0.11...v0.1.0