Repository navigation
fix: replace deprecated nats package with @nats-io/transport-node - #9
Merged
Merged
Conversation
nats@2 is deprecated ("Package moved. Use @nats-io/transport-node").
Switch the optional subscribe() dependency to @nats-io/transport-node@3,
which drops StringCodec in favour of Msg.string(). It stays optional.
Add an npm test suite (node:test) with a small in-process NATS broker,
and run it in CI.
Fixes #5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
npm i @priompt/clientpulled the optionalnats@2.29.3, which npm flags as deprecated:Fix
optionalDependencies:nats@^2→@nats-io/transport-node@^3(still optional).subscribe()requires@nats-io/transport-node; v3 dropsStringCodec, so payloads are read withMsg.string(). Behaviour is otherwise unchanged (JSON event, pre-0.7 bare-hash fallback, token fromnatsUrl/natsToken).npm test(node --test) with a small in-process NATS broker (test/fake-nats.js), and CI now runs it.Test evidence
Regression test, before the fix (main's
client.js/package.json):After:
Fresh install of the package from this branch (
npm i ../js-sdk --install-links): no deprecation warning, tree contains@nats-io/transport-node@3.4.0.Real run against
priompt v0.7.2 serve -nats-token natssecret(subscribe withnats://natssecret@127.0.0.1:48222, then publish over gRPC):Fixes #5
🤖 Generated with Claude Code