diff --git a/Makefile b/Makefile index 5db9e635..6dd9c313 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,8 @@ lint: deno lint --ignore=docs/,debug/ test: clean - deno test --allow-all --parallel --reload --quiet --coverage=coverage nats-base-client/tests/ jetstream/tests kv/tests/ os/tests/ service/tests/ - deno test --allow-all --parallel --reload --quiet --unsafely-ignore-certificate-errors --coverage=coverage nats-base-client/unsafe_tests/ + deno test --allow-all --parallel --reload --quiet --coverage=coverage core/tests/ jetstream/tests kv/tests/ os/tests/ service/tests/ + deno test --allow-all --parallel --reload --quiet --unsafely-ignore-certificate-errors --coverage=coverage core/unsafe_tests/ testw: clean diff --git a/nats-base-client/README.md b/core/README.md similarity index 100% rename from nats-base-client/README.md rename to core/README.md diff --git a/nats-base-client/deno.json b/core/deno.json similarity index 74% rename from nats-base-client/deno.json rename to core/deno.json index 5b709fe3..c3eb7316 100644 --- a/nats-base-client/deno.json +++ b/core/deno.json @@ -1,9 +1,9 @@ { "name": "@nats-io/nats-core", - "version": "3.0.0-15", + "version": "3.0.0-17", "exports": { - ".": "./mod.ts", - "./internal": "./internal_mod.ts" + ".": "./src/mod.ts", + "./internal": "./src/internal_mod.ts" }, "publish": { "exclude": [ diff --git a/nats-base-client/package.json b/core/package.json similarity index 100% rename from nats-base-client/package.json rename to core/package.json diff --git a/nats-base-client/authenticator.ts b/core/src/authenticator.ts similarity index 100% rename from nats-base-client/authenticator.ts rename to core/src/authenticator.ts diff --git a/nats-base-client/base64.ts b/core/src/base64.ts similarity index 100% rename from nats-base-client/base64.ts rename to core/src/base64.ts diff --git a/nats-base-client/bench.ts b/core/src/bench.ts similarity index 100% rename from nats-base-client/bench.ts rename to core/src/bench.ts diff --git a/nats-base-client/codec.ts b/core/src/codec.ts similarity index 100% rename from nats-base-client/codec.ts rename to core/src/codec.ts diff --git a/nats-base-client/core.ts b/core/src/core.ts similarity index 100% rename from nats-base-client/core.ts rename to core/src/core.ts diff --git a/nats-base-client/databuffer.ts b/core/src/databuffer.ts similarity index 100% rename from nats-base-client/databuffer.ts rename to core/src/databuffer.ts diff --git a/nats-base-client/denobuffer.ts b/core/src/denobuffer.ts similarity index 100% rename from nats-base-client/denobuffer.ts rename to core/src/denobuffer.ts diff --git a/nats-base-client/encoders.ts b/core/src/encoders.ts similarity index 100% rename from nats-base-client/encoders.ts rename to core/src/encoders.ts diff --git a/nats-base-client/headers.ts b/core/src/headers.ts similarity index 100% rename from nats-base-client/headers.ts rename to core/src/headers.ts diff --git a/nats-base-client/heartbeats.ts b/core/src/heartbeats.ts similarity index 100% rename from nats-base-client/heartbeats.ts rename to core/src/heartbeats.ts diff --git a/nats-base-client/idleheartbeat_monitor.ts b/core/src/idleheartbeat_monitor.ts similarity index 100% rename from nats-base-client/idleheartbeat_monitor.ts rename to core/src/idleheartbeat_monitor.ts diff --git a/nats-base-client/internal_mod.ts b/core/src/internal_mod.ts similarity index 100% rename from nats-base-client/internal_mod.ts rename to core/src/internal_mod.ts diff --git a/nats-base-client/ipparser.ts b/core/src/ipparser.ts similarity index 100% rename from nats-base-client/ipparser.ts rename to core/src/ipparser.ts diff --git a/nats-base-client/mod.ts b/core/src/mod.ts similarity index 100% rename from nats-base-client/mod.ts rename to core/src/mod.ts diff --git a/nats-base-client/msg.ts b/core/src/msg.ts similarity index 100% rename from nats-base-client/msg.ts rename to core/src/msg.ts diff --git a/nats-base-client/muxsubscription.ts b/core/src/muxsubscription.ts similarity index 100% rename from nats-base-client/muxsubscription.ts rename to core/src/muxsubscription.ts diff --git a/nats-base-client/nats.ts b/core/src/nats.ts similarity index 100% rename from nats-base-client/nats.ts rename to core/src/nats.ts diff --git a/nats-base-client/nkeys.ts b/core/src/nkeys.ts similarity index 100% rename from nats-base-client/nkeys.ts rename to core/src/nkeys.ts diff --git a/nats-base-client/nuid.ts b/core/src/nuid.ts similarity index 100% rename from nats-base-client/nuid.ts rename to core/src/nuid.ts diff --git a/nats-base-client/options.ts b/core/src/options.ts similarity index 100% rename from nats-base-client/options.ts rename to core/src/options.ts diff --git a/nats-base-client/parser.ts b/core/src/parser.ts similarity index 100% rename from nats-base-client/parser.ts rename to core/src/parser.ts diff --git a/nats-base-client/protocol.ts b/core/src/protocol.ts similarity index 100% rename from nats-base-client/protocol.ts rename to core/src/protocol.ts diff --git a/nats-base-client/queued_iterator.ts b/core/src/queued_iterator.ts similarity index 100% rename from nats-base-client/queued_iterator.ts rename to core/src/queued_iterator.ts diff --git a/nats-base-client/request.ts b/core/src/request.ts similarity index 100% rename from nats-base-client/request.ts rename to core/src/request.ts diff --git a/nats-base-client/semver.ts b/core/src/semver.ts similarity index 100% rename from nats-base-client/semver.ts rename to core/src/semver.ts diff --git a/nats-base-client/servers.ts b/core/src/servers.ts similarity index 100% rename from nats-base-client/servers.ts rename to core/src/servers.ts diff --git a/nats-base-client/sha256.ts b/core/src/sha256.ts similarity index 100% rename from nats-base-client/sha256.ts rename to core/src/sha256.ts diff --git a/nats-base-client/transport.ts b/core/src/transport.ts similarity index 100% rename from nats-base-client/transport.ts rename to core/src/transport.ts diff --git a/nats-base-client/typedsub.ts b/core/src/typedsub.ts similarity index 100% rename from nats-base-client/typedsub.ts rename to core/src/typedsub.ts diff --git a/nats-base-client/types.ts b/core/src/types.ts similarity index 100% rename from nats-base-client/types.ts rename to core/src/types.ts diff --git a/nats-base-client/util.ts b/core/src/util.ts similarity index 100% rename from nats-base-client/util.ts rename to core/src/util.ts diff --git a/nats-base-client/tests/auth_test.ts b/core/tests/auth_test.ts similarity index 99% rename from nats-base-client/tests/auth_test.ts rename to core/tests/auth_test.ts index c0131404..50c7b753 100644 --- a/nats-base-client/tests/auth_test.ts +++ b/core/tests/auth_test.ts @@ -41,7 +41,7 @@ import { NKeyAuth, Status, UserPass, -} from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; import { createInbox, credsAuthenticator, @@ -56,7 +56,7 @@ import { StringCodec, tokenAuthenticator, usernamePasswordAuthenticator, -} from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; const conf = { authorization: { diff --git a/nats-base-client/tests/authenticator_test.ts b/core/tests/authenticator_test.ts similarity index 97% rename from nats-base-client/tests/authenticator_test.ts rename to core/tests/authenticator_test.ts index 559fc15f..1b4bbc2a 100644 --- a/nats-base-client/tests/authenticator_test.ts +++ b/core/tests/authenticator_test.ts @@ -14,7 +14,6 @@ */ import { _setup, cleanup } from "../../test_helpers/mod.ts"; -import type { Auth, Authenticator, NatsConnection } from "../mod.ts"; import { connect } from "./connect.ts"; import { @@ -28,8 +27,8 @@ import { nkeys, tokenAuthenticator, usernamePasswordAuthenticator, -} from "../internal_mod.ts"; -import type { NatsConnectionImpl } from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; +import type { NatsConnectionImpl, Auth, Authenticator, NatsConnection } from "../src/internal_mod.ts"; import { assertEquals } from "jsr:@std/assert"; import { diff --git a/nats-base-client/tests/autounsub_test.ts b/core/tests/autounsub_test.ts similarity index 97% rename from nats-base-client/tests/autounsub_test.ts rename to core/tests/autounsub_test.ts index afe360ad..a14dcb98 100644 --- a/nats-base-client/tests/autounsub_test.ts +++ b/core/tests/autounsub_test.ts @@ -14,8 +14,8 @@ */ import { assert, assertEquals } from "jsr:@std/assert"; -import { createInbox, Empty, ErrorCode } from "../internal_mod.ts"; -import type { NatsConnectionImpl, Subscription } from "../internal_mod.ts"; +import { createInbox, Empty, ErrorCode } from "../src/internal_mod.ts"; +import type { NatsConnectionImpl, Subscription } from "../src/internal_mod.ts"; import { _setup, cleanup, Lock } from "../../test_helpers/mod.ts"; import { connect } from "./connect.ts"; diff --git a/nats-base-client/tests/basics_test.ts b/core/tests/basics_test.ts similarity index 99% rename from nats-base-client/tests/basics_test.ts rename to core/tests/basics_test.ts index 964752c2..bd61427c 100644 --- a/nats-base-client/tests/basics_test.ts +++ b/core/tests/basics_test.ts @@ -36,12 +36,11 @@ import { isIP, JSONCodec, jwtAuthenticator, - NatsError, nuid, RequestStrategy, StringCodec, syncIterator, -} from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; import type { Msg, MsgHdrs, @@ -50,7 +49,8 @@ import type { Publisher, PublishOptions, SubscriptionImpl, -} from "../internal_mod.ts"; + NatsError, +} from "../src/internal_mod.ts"; import { _setup, assertErrorCode, @@ -1207,7 +1207,7 @@ Deno.test("basics - msg typed payload", async () => { const nc = await connect({ port: ns.port }); nc.subscribe("echo", { - callback: (_err, msg) => { + callback: (_err: Error|null, msg: Msg) => { msg.respond(msg.data); }, }); diff --git a/nats-base-client/tests/bench_test.ts b/core/tests/bench_test.ts similarity index 96% rename from nats-base-client/tests/bench_test.ts rename to core/tests/bench_test.ts index 80832499..ecaee89e 100644 --- a/nats-base-client/tests/bench_test.ts +++ b/core/tests/bench_test.ts @@ -13,9 +13,9 @@ * limitations under the License. */ import { assert, assertEquals, assertThrows } from "jsr:@std/assert"; -import { Bench, createInbox, Metric } from "../mod.ts"; +import { Bench, createInbox, Metric } from "../src/mod.ts"; import { connect } from "./connect.ts"; -import type { BenchOpts } from "../mod.ts"; +import type { BenchOpts } from "../src/mod.ts"; const u = "demo.nats.io:4222"; diff --git a/nats-base-client/tests/binary_test.ts b/core/tests/binary_test.ts similarity index 94% rename from nats-base-client/tests/binary_test.ts rename to core/tests/binary_test.ts index d3e22419..a02fdf12 100644 --- a/nats-base-client/tests/binary_test.ts +++ b/core/tests/binary_test.ts @@ -14,8 +14,8 @@ */ import { assertEquals } from "jsr:@std/assert"; -import { createInbox, deferred } from "../internal_mod.ts"; -import type { Msg } from "../internal_mod.ts"; +import { createInbox, deferred } from "../src/internal_mod.ts"; +import type { Msg } from "../src/internal_mod.ts"; import { _setup, cleanup } from "../../test_helpers/mod.ts"; import { connect } from "./connect.ts"; diff --git a/nats-base-client/tests/buffer_test.ts b/core/tests/buffer_test.ts similarity index 99% rename from nats-base-client/tests/buffer_test.ts rename to core/tests/buffer_test.ts index 2884bf92..fc3930c5 100644 --- a/nats-base-client/tests/buffer_test.ts +++ b/core/tests/buffer_test.ts @@ -8,7 +8,7 @@ // in a browser environment import { assert, assertEquals, assertThrows } from "jsr:@std/assert"; -import { DenoBuffer, MAX_SIZE, readAll, writeAll } from "../internal_mod.ts"; +import { DenoBuffer, MAX_SIZE, readAll, writeAll } from "../src/internal_mod.ts"; // N controls how many iterations of certain checks are performed. const N = 100; diff --git a/nats-base-client/tests/certs/RootCA.crt b/core/tests/certs/RootCA.crt similarity index 100% rename from nats-base-client/tests/certs/RootCA.crt rename to core/tests/certs/RootCA.crt diff --git a/nats-base-client/tests/certs/RootCA.key b/core/tests/certs/RootCA.key similarity index 100% rename from nats-base-client/tests/certs/RootCA.key rename to core/tests/certs/RootCA.key diff --git a/nats-base-client/tests/certs/RootCA.pem b/core/tests/certs/RootCA.pem similarity index 100% rename from nats-base-client/tests/certs/RootCA.pem rename to core/tests/certs/RootCA.pem diff --git a/nats-base-client/tests/certs/localhost.crt b/core/tests/certs/localhost.crt similarity index 100% rename from nats-base-client/tests/certs/localhost.crt rename to core/tests/certs/localhost.crt diff --git a/nats-base-client/tests/certs/localhost.key b/core/tests/certs/localhost.key similarity index 100% rename from nats-base-client/tests/certs/localhost.key rename to core/tests/certs/localhost.key diff --git a/nats-base-client/tests/clobber_test.ts b/core/tests/clobber_test.ts similarity index 96% rename from nats-base-client/tests/clobber_test.ts rename to core/tests/clobber_test.ts index 076aea7a..9612a012 100644 --- a/nats-base-client/tests/clobber_test.ts +++ b/core/tests/clobber_test.ts @@ -14,7 +14,7 @@ */ import { NatsServer } from "../../test_helpers/launcher.ts"; -import { createInbox, DataBuffer } from "../internal_mod.ts"; +import { createInbox, DataBuffer } from "../src/internal_mod.ts"; import { connect } from "./connect.ts"; import { assertEquals } from "jsr:@std/assert"; diff --git a/nats-base-client/tests/codec_test.ts b/core/tests/codec_test.ts similarity index 94% rename from nats-base-client/tests/codec_test.ts rename to core/tests/codec_test.ts index a606440d..0f8e1d1f 100644 --- a/nats-base-client/tests/codec_test.ts +++ b/core/tests/codec_test.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { JSONCodec, StringCodec } from "jsr:@nats-io/nats-core@3.0.0-14"; +import { JSONCodec, StringCodec } from "@nats-io/nats-core"; import { assertEquals } from "jsr:@std/assert"; Deno.test("codec - string", () => { diff --git a/nats-base-client/tests/connect.ts b/core/tests/connect.ts similarity index 100% rename from nats-base-client/tests/connect.ts rename to core/tests/connect.ts diff --git a/nats-base-client/tests/databuffer_test.ts b/core/tests/databuffer_test.ts similarity index 97% rename from nats-base-client/tests/databuffer_test.ts rename to core/tests/databuffer_test.ts index 8ed58452..42ee3cd1 100644 --- a/nats-base-client/tests/databuffer_test.ts +++ b/core/tests/databuffer_test.ts @@ -13,7 +13,7 @@ * limitations under the License. */ import { assertEquals } from "jsr:@std/assert"; -import { DataBuffer } from "../internal_mod.ts"; +import { DataBuffer } from "../src/internal_mod.ts"; Deno.test("databuffer - empty", () => { const buf = new DataBuffer(); diff --git a/nats-base-client/tests/disconnect_test.ts b/core/tests/disconnect_test.ts similarity index 95% rename from nats-base-client/tests/disconnect_test.ts rename to core/tests/disconnect_test.ts index b62f4a29..c6100182 100644 --- a/nats-base-client/tests/disconnect_test.ts +++ b/core/tests/disconnect_test.ts @@ -15,7 +15,7 @@ import { connect } from "./connect.ts"; import { Lock, NatsServer } from "../../test_helpers/mod.ts"; -import type { NatsConnectionImpl } from "../internal_mod.ts"; +import type { NatsConnectionImpl } from "../src/internal_mod.ts"; Deno.test("disconnect - close handler is called on close", async () => { const ns = await NatsServer.start(); diff --git a/nats-base-client/tests/doublesubs_test.ts b/core/tests/doublesubs_test.ts similarity index 96% rename from nats-base-client/tests/doublesubs_test.ts rename to core/tests/doublesubs_test.ts index 3ff9c067..aacba80b 100644 --- a/nats-base-client/tests/doublesubs_test.ts +++ b/core/tests/doublesubs_test.ts @@ -21,8 +21,8 @@ import { extend, headers, StringCodec, -} from "../internal_mod.ts"; -import type { NatsConnectionImpl } from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; +import type { NatsConnectionImpl } from "../src/internal_mod.ts"; import { assertArrayIncludes, assertEquals } from "jsr:@std/assert"; import { connect } from "./connect.ts"; diff --git a/nats-base-client/tests/drain_test.ts b/core/tests/drain_test.ts similarity index 98% rename from nats-base-client/tests/drain_test.ts rename to core/tests/drain_test.ts index 2e94d38d..3ce03ccd 100644 --- a/nats-base-client/tests/drain_test.ts +++ b/core/tests/drain_test.ts @@ -17,8 +17,8 @@ import { createInbox, ErrorCode, StringCodec, -} from "jsr:@nats-io/nats-core@3.0.0-14"; -import type { Msg } from "jsr:@nats-io/nats-core@3.0.0-14"; +} from "../src/internal_mod.ts"; +import type { Msg } from "../src/internal_mod.ts"; import { assertThrowsAsyncErrorCode, assertThrowsErrorCode, diff --git a/nats-base-client/tests/events_test.ts b/core/tests/events_test.ts similarity index 96% rename from nats-base-client/tests/events_test.ts rename to core/tests/events_test.ts index c1136c6d..fe403161 100644 --- a/nats-base-client/tests/events_test.ts +++ b/core/tests/events_test.ts @@ -15,8 +15,8 @@ import { Lock, NatsServer, ServerSignals } from "../../test_helpers/mod.ts"; import { connect } from "./connect.ts"; import { assertEquals } from "jsr:@std/assert"; -import { delay, Events } from "jsr:@nats-io/nats-core@3.0.0-14"; -import type { NatsConnectionImpl, ServersChanged } from "../internal_mod.ts"; +import { delay, Events } from "../src/internal_mod.ts"; +import type { NatsConnectionImpl, ServersChanged } from "../src/internal_mod.ts"; import { _setup } from "../../test_helpers/mod.ts"; Deno.test("events - close on close", async () => { diff --git a/nats-base-client/tests/headers_test.ts b/core/tests/headers_test.ts similarity index 99% rename from nats-base-client/tests/headers_test.ts rename to core/tests/headers_test.ts index e7745503..8ab50758 100644 --- a/nats-base-client/tests/headers_test.ts +++ b/core/tests/headers_test.ts @@ -24,12 +24,12 @@ import { NatsError, Parser, StringCodec, -} from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; import type { NatsConnectionImpl, Publisher, RequestOptions, -} from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; import { NatsServer } from "../../test_helpers/launcher.ts"; import { assert, assertEquals, assertThrows } from "jsr:@std/assert"; import { TestDispatcher } from "./parser_test.ts"; diff --git a/nats-base-client/tests/heartbeats_test.ts b/core/tests/heartbeats_test.ts similarity index 97% rename from nats-base-client/tests/heartbeats_test.ts rename to core/tests/heartbeats_test.ts index 5071a55f..46ef904c 100644 --- a/nats-base-client/tests/heartbeats_test.ts +++ b/core/tests/heartbeats_test.ts @@ -19,9 +19,8 @@ import { deferred, delay, Heartbeat, - PH, -} from "../internal_mod.ts"; -import type { Status } from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; +import type { Status, PH } from "../src/internal_mod.ts"; function pm( lag: number, diff --git a/nats-base-client/tests/idleheartbeats_test.ts b/core/tests/idleheartbeats_test.ts similarity index 97% rename from nats-base-client/tests/idleheartbeats_test.ts rename to core/tests/idleheartbeats_test.ts index 9e72c71b..15b64dfc 100644 --- a/nats-base-client/tests/idleheartbeats_test.ts +++ b/core/tests/idleheartbeats_test.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { deferred, IdleHeartbeatMonitor } from "../internal_mod.ts"; +import { deferred, IdleHeartbeatMonitor } from "../src/internal_mod.ts"; import { assert, assertEquals } from "jsr:@std/assert"; Deno.test("idleheartbeat - basic", async () => { diff --git a/nats-base-client/tests/iterators_test.ts b/core/tests/iterators_test.ts similarity index 98% rename from nats-base-client/tests/iterators_test.ts rename to core/tests/iterators_test.ts index 83c340f7..9727f4b4 100644 --- a/nats-base-client/tests/iterators_test.ts +++ b/core/tests/iterators_test.ts @@ -22,8 +22,8 @@ import { nuid, QueuedIteratorImpl, syncIterator, -} from "../internal_mod.ts"; -import type { NatsConnectionImpl } from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; +import type { NatsConnectionImpl } from "../src/internal_mod.ts"; import { _setup, cleanup } from "../../test_helpers/mod.ts"; Deno.test("iterators - unsubscribe breaks and closes", async () => { diff --git a/nats-base-client/tests/json_test.ts b/core/tests/json_test.ts similarity index 95% rename from nats-base-client/tests/json_test.ts rename to core/tests/json_test.ts index 44d2651f..80e01223 100644 --- a/nats-base-client/tests/json_test.ts +++ b/core/tests/json_test.ts @@ -18,8 +18,8 @@ import { createInbox, ErrorCode, JSONCodec, -} from "jsr:@nats-io/nats-core@3.0.0-14"; -import type { Msg, NatsError } from "jsr:@nats-io/nats-core@3.0.0-14"; +} from "../src/internal_mod.ts"; +import type { Msg, NatsError } from "../src/internal_mod.ts"; import { Lock } from "../../test_helpers/mod.ts"; import { assertThrowsErrorCode } from "../../test_helpers/asserts.ts"; import { _setup, cleanup } from "../../test_helpers/mod.ts"; diff --git a/nats-base-client/tests/launcher_test.ts b/core/tests/launcher_test.ts similarity index 100% rename from nats-base-client/tests/launcher_test.ts rename to core/tests/launcher_test.ts diff --git a/nats-base-client/tests/mrequest_test.ts b/core/tests/mrequest_test.ts similarity index 99% rename from nats-base-client/tests/mrequest_test.ts rename to core/tests/mrequest_test.ts index e4e6e3c1..012ad0bd 100644 --- a/nats-base-client/tests/mrequest_test.ts +++ b/core/tests/mrequest_test.ts @@ -14,7 +14,7 @@ */ import { _setup, cleanup } from "../../test_helpers/mod.ts"; import { connect } from "./connect.ts"; -import type { NatsConnectionImpl } from "../internal_mod.ts"; +import type { NatsConnectionImpl } from "../src/internal_mod.ts"; import { createInbox, deferred, @@ -23,7 +23,7 @@ import { Events, RequestStrategy, StringCodec, -} from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; import { assert, assertEquals, assertRejects, fail } from "jsr:@std/assert"; diff --git a/nats-base-client/tests/noresponders_test.ts b/core/tests/noresponders_test.ts similarity index 97% rename from nats-base-client/tests/noresponders_test.ts rename to core/tests/noresponders_test.ts index f30b2323..ca893137 100644 --- a/nats-base-client/tests/noresponders_test.ts +++ b/core/tests/noresponders_test.ts @@ -19,7 +19,7 @@ import { Empty, ErrorCode, headers, -} from "jsr:@nats-io/nats-core@3.0.0-14"; +} from "@nats-io/nats-core"; import { assertErrorCode, Lock, NatsServer } from "../../test_helpers/mod.ts"; import { assert, assertEquals, fail } from "jsr:@std/assert"; diff --git a/nats-base-client/tests/parseip_test.ts b/core/tests/parseip_test.ts similarity index 97% rename from nats-base-client/tests/parseip_test.ts rename to core/tests/parseip_test.ts index 6cb14058..bfda3e40 100644 --- a/nats-base-client/tests/parseip_test.ts +++ b/core/tests/parseip_test.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { ipV4, parseIP } from "../internal_mod.ts"; +import { ipV4, parseIP } from "../src/internal_mod.ts"; import { assertEquals } from "jsr:@std/assert"; diff --git a/nats-base-client/tests/parser_test.ts b/core/tests/parser_test.ts similarity index 99% rename from nats-base-client/tests/parser_test.ts rename to core/tests/parser_test.ts index 66e46445..08cb0a15 100644 --- a/nats-base-client/tests/parser_test.ts +++ b/core/tests/parser_test.ts @@ -22,13 +22,13 @@ import { MsgImpl, Parser, State, -} from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; import type { Dispatcher, Msg, ParserEvent, Publisher, -} from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; import { assert, assertEquals, assertThrows } from "jsr:@std/assert"; const te = new TextEncoder(); diff --git a/nats-base-client/tests/properties_test.ts b/core/tests/properties_test.ts similarity index 98% rename from nats-base-client/tests/properties_test.ts rename to core/tests/properties_test.ts index 7e1c69bf..024d3415 100644 --- a/nats-base-client/tests/properties_test.ts +++ b/core/tests/properties_test.ts @@ -24,7 +24,7 @@ import type { Authenticator, ConnectionOptions, NatsConnectionImpl, -} from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; import { Connect, credsAuthenticator, @@ -32,7 +32,7 @@ import { extend, parseOptions, Servers, -} from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; import { NatsServer } from "../../test_helpers/launcher.ts"; diff --git a/nats-base-client/tests/protocol_test.ts b/core/tests/protocol_test.ts similarity index 96% rename from nats-base-client/tests/protocol_test.ts rename to core/tests/protocol_test.ts index 344ce4f1..ba4ca12f 100644 --- a/nats-base-client/tests/protocol_test.ts +++ b/core/tests/protocol_test.ts @@ -21,8 +21,8 @@ import { RequestOne, SubscriptionImpl, Subscriptions, -} from "../internal_mod.ts"; -import type { Msg, ProtocolHandler } from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; +import type { Msg, ProtocolHandler } from "../src/internal_mod.ts"; import { assertErrorCode } from "../../test_helpers/mod.ts"; import { assertEquals, equal } from "jsr:@std/assert"; diff --git a/nats-base-client/tests/queues_test.ts b/core/tests/queues_test.ts similarity index 93% rename from nats-base-client/tests/queues_test.ts rename to core/tests/queues_test.ts index 470d612c..c117ef4f 100644 --- a/nats-base-client/tests/queues_test.ts +++ b/core/tests/queues_test.ts @@ -13,9 +13,9 @@ * limitations under the License. */ -import { createInbox } from "jsr:@nats-io/nats-core@3.0.0-14"; -import type { Subscription } from "jsr:@nats-io/nats-core@3.0.0-14"; -import { assertEquals } from "jsr:@std/assert"; +import { createInbox } from "../src/internal_mod.ts"; +import type { Subscription } from "../src/internal_mod.ts"; +import { assertEquals } from "@std/assert"; import { connect } from "./connect.ts"; import { _setup, cleanup } from "../../test_helpers/mod.ts"; diff --git a/nats-base-client/tests/reconnect_test.ts b/core/tests/reconnect_test.ts similarity index 99% rename from nats-base-client/tests/reconnect_test.ts rename to core/tests/reconnect_test.ts index 20139eda..b02b8acf 100644 --- a/nats-base-client/tests/reconnect_test.ts +++ b/core/tests/reconnect_test.ts @@ -24,8 +24,8 @@ import { ErrorCode, Events, tokenAuthenticator, -} from "../internal_mod.ts"; -import type { NatsConnectionImpl, NatsError } from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; +import type { NatsConnectionImpl, NatsError } from "../src/internal_mod.ts"; import { _setup, cleanup } from "../../test_helpers/mod.ts"; import { deadline } from "jsr:@std/async"; diff --git a/nats-base-client/tests/resub_test.ts b/core/tests/resub_test.ts similarity index 97% rename from nats-base-client/tests/resub_test.ts rename to core/tests/resub_test.ts index d870e2bd..05893f2b 100644 --- a/nats-base-client/tests/resub_test.ts +++ b/core/tests/resub_test.ts @@ -15,12 +15,12 @@ import { connect } from "./connect.ts"; import { _setup, cleanup } from "../../test_helpers/mod.ts"; -import { createInbox } from "../internal_mod.ts"; +import { createInbox } from "../src/internal_mod.ts"; import type { Msg, NatsConnection, NatsConnectionImpl, -} from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; import { assert, assertEquals, assertExists, fail } from "jsr:@std/assert"; import type { NatsServer } from "../../test_helpers/launcher.ts"; diff --git a/nats-base-client/tests/semver_test.ts b/core/tests/semver_test.ts similarity index 97% rename from nats-base-client/tests/semver_test.ts rename to core/tests/semver_test.ts index 4ee45155..9b38567a 100644 --- a/nats-base-client/tests/semver_test.ts +++ b/core/tests/semver_test.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { compare, Feature, Features, parseSemVer } from "../internal_mod.ts"; +import { compare, Feature, Features, parseSemVer } from "../src/internal_mod.ts"; import { assert, assertEquals, diff --git a/nats-base-client/tests/servers_test.ts b/core/tests/servers_test.ts similarity index 97% rename from nats-base-client/tests/servers_test.ts rename to core/tests/servers_test.ts index 8129fd9c..deb0e284 100644 --- a/nats-base-client/tests/servers_test.ts +++ b/core/tests/servers_test.ts @@ -16,8 +16,8 @@ import { isIPV4OrHostname, Servers, setTransportFactory, -} from "../internal_mod.ts"; -import type { ServerInfo } from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; +import type { ServerInfo } from "../src/internal_mod.ts"; import { assertEquals } from "jsr:@std/assert"; Deno.test("servers - single", () => { diff --git a/nats-base-client/tests/sub_extensions_test.ts b/core/tests/sub_extensions_test.ts similarity index 97% rename from nats-base-client/tests/sub_extensions_test.ts rename to core/tests/sub_extensions_test.ts index 65e09e96..05b08b08 100644 --- a/nats-base-client/tests/sub_extensions_test.ts +++ b/core/tests/sub_extensions_test.ts @@ -13,8 +13,8 @@ * limitations under the License. */ import { assert, assertEquals } from "jsr:@std/assert"; -import { createInbox, deferred, StringCodec } from "../internal_mod.ts"; -import type { Msg, SubscriptionImpl } from "../internal_mod.ts"; +import { createInbox, deferred, StringCodec } from "../src/internal_mod.ts"; +import type { Msg, SubscriptionImpl } from "../src/internal_mod.ts"; import { connect } from "./connect.ts"; import { _setup, cleanup } from "../../test_helpers/mod.ts"; diff --git a/nats-base-client/tests/timeout_test.ts b/core/tests/timeout_test.ts similarity index 95% rename from nats-base-client/tests/timeout_test.ts rename to core/tests/timeout_test.ts index cf24a774..20888df3 100644 --- a/nats-base-client/tests/timeout_test.ts +++ b/core/tests/timeout_test.ts @@ -14,7 +14,7 @@ */ import { assertStringIncludes, fail } from "jsr:@std/assert"; import { connect } from "./connect.ts"; -import { createInbox, Empty } from "jsr:@nats-io/nats-core@3.0.0-14"; +import { createInbox, Empty } from "../src/internal_mod.ts"; Deno.test("timeout - request noMux stack is useful", async () => { const nc = await connect({ servers: "demo.nats.io" }); diff --git a/nats-base-client/tests/tls_test.ts b/core/tests/tls_test.ts similarity index 97% rename from nats-base-client/tests/tls_test.ts rename to core/tests/tls_test.ts index 9a5cce3c..8ce76b01 100644 --- a/nats-base-client/tests/tls_test.ts +++ b/core/tests/tls_test.ts @@ -19,8 +19,8 @@ import { fail, } from "jsr:@std/assert"; import { connect } from "./connect.ts"; -import { ErrorCode } from "../internal_mod.ts"; -import type { NatsConnectionImpl } from "../internal_mod.ts"; +import { ErrorCode } from "../src/internal_mod.ts"; +import type { NatsConnectionImpl } from "../src/internal_mod.ts"; import { assertErrorCode, cleanup, diff --git a/nats-base-client/tests/token_test.ts b/core/tests/token_test.ts similarity index 96% rename from nats-base-client/tests/token_test.ts rename to core/tests/token_test.ts index 00aed735..c7af25fe 100644 --- a/nats-base-client/tests/token_test.ts +++ b/core/tests/token_test.ts @@ -13,7 +13,7 @@ * limitations under the License. */ import { fail } from "jsr:@std/assert"; -import { ErrorCode } from "jsr:@nats-io/nats-core@3.0.0-14"; +import { ErrorCode } from "../src/internal_mod.ts"; import { assertErrorCode, NatsServer } from "../../test_helpers/mod.ts"; import { connect } from "./connect.ts"; diff --git a/nats-base-client/tests/typedsub_test.ts b/core/tests/typedsub_test.ts similarity index 98% rename from nats-base-client/tests/typedsub_test.ts rename to core/tests/typedsub_test.ts index a16ee625..ad0c5d2a 100644 --- a/nats-base-client/tests/typedsub_test.ts +++ b/core/tests/typedsub_test.ts @@ -22,11 +22,10 @@ import { createInbox, deferred, ErrorCode, - NatsError, StringCodec, TypedSubscription, -} from "../internal_mod.ts"; -import type { Msg, TypedSubscriptionOptions } from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; +import type { Msg, TypedSubscriptionOptions, NatsError } from "../src/internal_mod.ts"; import { connect } from "./connect.ts"; import { _setup, cleanup } from "../../test_helpers/mod.ts"; diff --git a/nats-base-client/tests/types_test.ts b/core/tests/types_test.ts similarity index 95% rename from nats-base-client/tests/types_test.ts rename to core/tests/types_test.ts index 242a1b19..eedac8da 100644 --- a/nats-base-client/tests/types_test.ts +++ b/core/tests/types_test.ts @@ -14,14 +14,14 @@ */ import { connect } from "./connect.ts"; -import type { Msg, NatsConnection } from "../internal_mod.ts"; +import type { Msg, NatsConnection } from "../src/internal_mod.ts"; import { createInbox, DataBuffer, deferred, JSONCodec, StringCodec, -} from "../internal_mod.ts"; +} from "../src/internal_mod.ts"; import { assert, assertEquals } from "jsr:@std/assert"; import { NatsServer } from "../../test_helpers/launcher.ts"; diff --git a/nats-base-client/tests/util_test.ts b/core/tests/util_test.ts similarity index 95% rename from nats-base-client/tests/util_test.ts rename to core/tests/util_test.ts index 4dfed853..433ad195 100644 --- a/nats-base-client/tests/util_test.ts +++ b/core/tests/util_test.ts @@ -13,7 +13,7 @@ * limitations under the License. */ import { assert, assertEquals } from "jsr:@std/assert"; -import { backoff, SimpleMutex } from "../internal_mod.ts"; +import { backoff, SimpleMutex } from "../src/internal_mod.ts"; Deno.test("util - simple mutex", () => { const r = new SimpleMutex(1); diff --git a/nats-base-client/tsconfig.json b/core/tsconfig.json similarity index 100% rename from nats-base-client/tsconfig.json rename to core/tsconfig.json diff --git a/nats-base-client/unsafe_tests/tlsunsafe_test.ts b/core/unsafe_tests/tlsunsafe_test.ts similarity index 78% rename from nats-base-client/unsafe_tests/tlsunsafe_test.ts rename to core/unsafe_tests/tlsunsafe_test.ts index de01619b..5dc5b628 100644 --- a/nats-base-client/unsafe_tests/tlsunsafe_test.ts +++ b/core/unsafe_tests/tlsunsafe_test.ts @@ -9,16 +9,17 @@ Deno.test("tls-unsafe - handshake first", async () => { tls: { handshake_first: true, cert_file: resolve( - join(cwd, "./nats-base-client/tests/certs/localhost.crt"), + join(cwd, "./core/tests/certs/localhost.crt"), ), key_file: resolve( - join(cwd, "./nats-base-client/tests/certs/localhost.key"), + join(cwd, "./core/tests/certs/localhost.key"), ), - ca_file: resolve(join(cwd, "./nats-base-client/tests/certs/RootCA.crt")), + ca_file: resolve(join(cwd, "./core/tests/certs/RootCA.crt")), }, }; const ns = await NatsServer.start(config); + console.log("port", ns.port) const nc = await connect({ debug: true, servers: `localhost:${ns.port}`, diff --git a/deno.json b/deno.json new file mode 100644 index 00000000..29c50c09 --- /dev/null +++ b/deno.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "strict": true + }, + "imports": { + "@nats-io/nats-core": "./core/src/mod.ts", + "@nats-io/nats-core/internal": "./core/src/internal_mod.ts", + "@nats-io/jetstream": "./jetstream/src/mod.ts", + "@nats-io/jetstream/internal": "./jetstream/src/internal_mod.ts", + "@nats-io/kv": "jsr:@nats-io/kv", + "@nats-io/obj": "jsr:@nats-io/obj", + "@nats-io/service": "jsr:@nats-io/service", + "@nats-io/nats-transport-deno": "jsr:@nats-io/nats-transport-deno", + "@std/io": "jsr:@std/io", + "@std/assert": "jsr:@std/assert" + }, + "workspaces": [ + "./src", + "./core", + "./jetstream", + "./kv", + "./os", + "./service" + ] +} \ No newline at end of file diff --git a/examples/jetstream/util.ts b/examples/jetstream/util.ts index be3fdd4c..1df0bf87 100644 --- a/examples/jetstream/util.ts +++ b/examples/jetstream/util.ts @@ -13,13 +13,13 @@ * limitations under the License. */ -import { nuid } from "../../nats-base-client/nuid.ts"; +import { nuid } from "../../core/src/nuid.ts"; import { createConsumer, fill, initStream, } from "../../jetstream/tests/jstest_util.ts"; -import { NatsConnection } from "../../src/mod.ts"; +import { NatsConnection } from "../../core/src/mod.ts"; export async function setupStreamAndConsumer( nc: NatsConnection, diff --git a/jetstream/consumer.ts b/jetstream/consumer.ts index 9b8c47a6..538d9f1e 100644 --- a/jetstream/consumer.ts +++ b/jetstream/consumer.ts @@ -326,8 +326,9 @@ export class PullConsumerMessagesImpl extends QueuedIteratorImpl if (this.listeners.length > 0) { (() => { this.listeners.forEach((l) => { - if (!(l as QueuedIteratorImpl).done) { - l.push({ type, data }); + const qi = l as QueuedIteratorImpl; + if (!qi.done) { + qi.push({ type, data }); } }); })(); @@ -584,8 +585,9 @@ export class OrderedConsumerMessages extends QueuedIteratorImpl if (this.listeners.length > 0) { (() => { this.listeners.forEach((l) => { - if (!(l as QueuedIteratorImpl).done) { - l.push({ type, data }); + const qi = l as QueuedIteratorImpl; + if (!qi.done) { + qi.push({ type, data }); } }); })(); diff --git a/jetstream/tests/jsm_test.ts b/jetstream/tests/jsm_test.ts index c5705bec..45fc8977 100644 --- a/jetstream/tests/jsm_test.ts +++ b/jetstream/tests/jsm_test.ts @@ -23,9 +23,7 @@ import { } from "jsr:@std/assert"; import { Feature } from "@nats-io/nats-core/internal"; -import type { - NatsConnectionImpl, -} from "@nats-io/nats-core/internal"; +import type { NatsConnectionImpl } from "@nats-io/nats-core/internal"; import { connect, deferred, diff --git a/jetstream/tests/jstest_util.ts b/jetstream/tests/jstest_util.ts index 3bae205b..aec632df 100644 --- a/jetstream/tests/jstest_util.ts +++ b/jetstream/tests/jstest_util.ts @@ -18,10 +18,7 @@ import type { JsMsg, PubAck, StreamConfig } from "../mod.ts"; import { assert } from "jsr:@std/assert"; import { Empty, nanos, nuid } from "@nats-io/nats-core"; -import type { - NatsConnection, - QueuedIterator, -} from "@nats-io/nats-core"; +import type { NatsConnection, QueuedIterator } from "@nats-io/nats-core"; export async function consume(iter: QueuedIterator): Promise { const buf: JsMsg[] = []; diff --git a/jetstream/tests/next_test.ts b/jetstream/tests/next_test.ts index c5e5c8e9..3721f1be 100644 --- a/jetstream/tests/next_test.ts +++ b/jetstream/tests/next_test.ts @@ -26,9 +26,7 @@ import { delay, nanos, } from "jsr:@nats-io/nats-transport-deno@3.0.0-4"; -import type { - NatsConnectionImpl, -} from "@nats-io/nats-core/internal"; +import type { NatsConnectionImpl } from "@nats-io/nats-core/internal"; import { jetstream, jetstreamManager } from "../mod.ts"; Deno.test("next - basics", async () => { diff --git a/kv/deno.json b/kv/deno.json index 3fa99c50..6287a695 100644 --- a/kv/deno.json +++ b/kv/deno.json @@ -14,7 +14,7 @@ ] }, "imports": { - "@nats-io/nats-core": "jsr:@nats-io/nats-core@3.0.0-14", + "@nats-io/nats-core": "jsr:@nats-io/nats-core@3.0.0-17", "@nats-io/jetstream": "jsr:@nats-io/jetstream@3.0.0-3" } } diff --git a/kv/tests/kv_test.ts b/kv/tests/kv_test.ts index 03e433c4..4f4ab1d0 100644 --- a/kv/tests/kv_test.ts +++ b/kv/tests/kv_test.ts @@ -72,9 +72,7 @@ import { notCompatible, } from "../../test_helpers/mod.ts"; import { JSONCodec } from "@nats-io/nats-core/internal"; -import type { - QueuedIteratorImpl, -} from "@nats-io/nats-core/internal"; +import type { QueuedIteratorImpl } from "@nats-io/nats-core/internal"; import { connect } from "jsr:@nats-io/nats-transport-deno@3.0.0-4"; import { Kvm } from "../kv.ts"; diff --git a/os/deno.json b/os/deno.json index 2353d657..fc7390a4 100644 --- a/os/deno.json +++ b/os/deno.json @@ -14,7 +14,7 @@ ] }, "imports": { - "@nats-io/nats-core": "jsr:@nats-io/nats-core@3.0.0-14", + "@nats-io/nats-core": "jsr:@nats-io/nats-core@3.0.0-17", "@nats-io/jetstream": "jsr:@nats-io/jetstream@3.0.0-3" } } diff --git a/os/tests/objectstore_test.ts b/os/tests/objectstore_test.ts index 7baf5302..c9e9e96a 100644 --- a/os/tests/objectstore_test.ts +++ b/os/tests/objectstore_test.ts @@ -37,9 +37,7 @@ import { SHA256, StringCodec, } from "@nats-io/nats-core/internal"; -import type { - NatsConnectionImpl, -} from "@nats-io/nats-core/internal"; +import type { NatsConnectionImpl } from "@nats-io/nats-core/internal"; import { crypto } from "https://deno.land/std@0.221.0/crypto/mod.ts"; import type { ObjectInfo, ObjectStoreMeta } from "../types.ts"; import { jetstreamManager, StorageType } from "@nats-io/jetstream"; diff --git a/os/types.ts b/os/types.ts index bac9ef86..c1864c1d 100644 --- a/os/types.ts +++ b/os/types.ts @@ -20,11 +20,7 @@ import { StreamInfo, StreamInfoRequestOptions, } from "@nats-io/jetstream"; -import { - MsgHdrs, - Nanos, - QueuedIterator, -} from "@nats-io/nats-core"; +import { MsgHdrs, Nanos, QueuedIterator } from "@nats-io/nats-core"; export type ObjectStoreLink = { /** diff --git a/service/deno.json b/service/deno.json index e2848f7f..6e5f33b3 100644 --- a/service/deno.json +++ b/service/deno.json @@ -14,6 +14,6 @@ ] }, "imports": { - "@nats-io/nats-core": "jsr:@nats-io/nats-core@3.0.0-14" + "@nats-io/nats-core": "jsr:@nats-io/nats-core@3.0.0-17" } } diff --git a/service/internal_mod.ts b/service/internal_mod.ts index 4e492301..ae70d072 100644 --- a/service/internal_mod.ts +++ b/service/internal_mod.ts @@ -1,7 +1,4 @@ -import type { - NatsConnection, - RequestManyOptions, -} from "@nats-io/nats-core"; +import type { NatsConnection, RequestManyOptions } from "@nats-io/nats-core"; import { ServiceImpl } from "./service.ts"; import { ServiceClientImpl } from "./serviceclient.ts"; import type { Service, ServiceClient, ServiceConfig } from "./types.ts"; diff --git a/service/tests/service-check.ts b/service/tests/service-check.ts index e990b3f8..1a34b0b1 100644 --- a/service/tests/service-check.ts +++ b/service/tests/service-check.ts @@ -16,11 +16,7 @@ import { cli } from "https://deno.land/x/cobra@v0.0.9/mod.ts"; import { connect } from "jsr:@nats-io/nats-transport-deno@3.0.0-4"; import type { NatsConnection } from "jsr:@nats-io/nats-transport-deno@3.0.0-4"; -import { - collect, - parseSemVer, - StringCodec, -} from "@nats-io/nats-core/internal"; +import { collect, parseSemVer, StringCodec } from "@nats-io/nats-core/internal"; import type { ServiceIdentity, ServiceInfo, ServiceStats } from "../mod.ts"; import { ServiceError, ServiceResponseType, ServiceVerb, Svc } from "../mod.ts"; diff --git a/src/deno.json b/src/deno.json index 77da8b02..2ecdff4e 100644 --- a/src/deno.json +++ b/src/deno.json @@ -11,7 +11,7 @@ }, "imports": { "@std/io": "jsr:@std/io@0.224.0", - "@nats-io/nats-core": "jsr:@nats-io/nats-core@3.0.0-15", + "@nats-io/nats-core": "jsr:@nats-io/nats-core@3.0.0-17", "@nats-io/nkeys": "jsr:@nats-io/nkeys@1.2.0-4", "@nats-io/nuid": "jsr:@nats-io/nuid@2.0.1-2" } diff --git a/test_helpers/asserts.ts b/test_helpers/asserts.ts index 7f91e270..3b8f7fba 100644 --- a/test_helpers/asserts.ts +++ b/test_helpers/asserts.ts @@ -15,7 +15,7 @@ import { assert, assertThrows, fail } from "jsr:@std/assert"; import type { NatsError } from "../src/mod.ts"; -import { isNatsError } from "../nats-base-client/internal_mod.ts"; +import { isNatsError } from "../core/src/internal_mod.ts"; export function assertErrorCode(err?: Error, ...codes: string[]) { if (!err) { diff --git a/test_helpers/certs.ts b/test_helpers/certs.ts index 38cbbe79..0d168d67 100644 --- a/test_helpers/certs.ts +++ b/test_helpers/certs.ts @@ -1,4 +1,4 @@ -import { deferred } from "../nats-base-client/internal_mod.ts"; +import { deferred } from "../core/src/internal_mod.ts"; import { join } from "jsr:@std/path"; export class Certs { diff --git a/test_helpers/launcher.ts b/test_helpers/launcher.ts index f49e0474..efa31982 100644 --- a/test_helpers/launcher.ts +++ b/test_helpers/launcher.ts @@ -16,9 +16,9 @@ import { join, resolve } from "jsr:@std/path"; import { rgb24 } from "jsr:@std/fmt/colors"; import { check, jsopts } from "./mod.ts"; -import { extend, timeout } from "../nats-base-client/internal_mod.ts"; -import type { Deferred } from "../nats-base-client/internal_mod.ts"; -import { deferred, delay, nuid } from "../src/mod.ts"; +import { extend, timeout } from "../core/src/internal_mod.ts"; +import type { Deferred } from "../core/src/internal_mod.ts"; +import { deferred, delay, nuid } from "../core/src/mod.ts"; import {Certs} from "./certs.ts"; export const ServerSignals = Object.freeze({ diff --git a/test_helpers/mod.ts b/test_helpers/mod.ts index d5b8d65e..d4ece2e6 100644 --- a/test_helpers/mod.ts +++ b/test_helpers/mod.ts @@ -16,18 +16,18 @@ import type { ConnectionOptions, NatsConnection, -} from "../nats-base-client/internal_mod.ts"; +} from "../core/src/internal_mod.ts"; import { compare, extend, parseSemVer, -} from "../nats-base-client/internal_mod.ts"; +} from "../core/src/internal_mod.ts"; import { NatsServer } from "./launcher.ts"; import { red, yellow } from "jsr:@std/fmt/colors"; import { connect } from "./connect.ts"; export { connect } from "./connect.ts"; -import {ConnectFn} from "../nats-base-client/core.ts"; +import {ConnectFn} from "../core/src/core.ts"; export { check } from "./check.ts"; export { Lock } from "./lock.ts"; export { Connection, TestServer } from "./test_server.ts"; diff --git a/test_helpers/test_server.ts b/test_helpers/test_server.ts index 50227b2c..454ff875 100644 --- a/test_helpers/test_server.ts +++ b/test_helpers/test_server.ts @@ -12,8 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import type { Deferred } from "../nats-base-client/internal_mod.ts"; -import { deferred } from "../nats-base-client/internal_mod.ts"; +import type { Deferred } from "../core/src/internal_mod.ts"; +import { deferred } from "../core/src/internal_mod.ts"; export class Connection { conn: Deno.Conn | null; diff --git a/test_helpers/util.ts b/test_helpers/util.ts index a8ac1489..b2fb51e3 100644 --- a/test_helpers/util.ts +++ b/test_helpers/util.ts @@ -12,8 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { deferred, timeout } from "../nats-base-client/internal_mod.ts"; -import type { Msg, Subscription } from "../src/mod.ts"; +import { deferred, timeout } from "../core/src/internal_mod.ts"; +import type { Msg, Subscription } from "../core/src/internal_mod.ts";; export function consume(sub: Subscription, ms = 1000): Promise { const to = timeout(ms);