Skip to content

Commit

Permalink
reorg core
Browse files Browse the repository at this point in the history
  • Loading branch information
aricart committed Jun 14, 2024
1 parent f7c1f1c commit bc7433a
Show file tree
Hide file tree
Showing 102 changed files with 131 additions and 128 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions nats-base-client/deno.json → core/deno.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
NKeyAuth,
Status,
UserPass,
} from "../internal_mod.ts";
} from "../src/internal_mod.ts";
import {
createInbox,
credsAuthenticator,
Expand All @@ -56,7 +56,7 @@ import {
StringCodec,
tokenAuthenticator,
usernamePasswordAuthenticator,
} from "../internal_mod.ts";
} from "../src/internal_mod.ts";

const conf = {
authorization: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -50,7 +49,8 @@ import type {
Publisher,
PublishOptions,
SubscriptionImpl,
} from "../internal_mod.ts";
NatsError,
} from "../src/internal_mod.ts";
import {
_setup,
assertErrorCode,
Expand Down Expand Up @@ -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);
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
createInbox,
ErrorCode,
StringCodec,
} from "jsr:@nats-io/[email protected]";
import type { Msg } from "jsr:@nats-io/[email protected]";
} from "../src/internal_mod.ts";
import type { Msg } from "../src/internal_mod.ts";
import {
assertThrowsAsyncErrorCode,
assertThrowsErrorCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]";
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 () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
createInbox,
ErrorCode,
JSONCodec,
} from "jsr:@nats-io/[email protected]";
import type { Msg, NatsError } from "jsr:@nats-io/[email protected]";
} 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";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ import type {
Authenticator,
ConnectionOptions,
NatsConnectionImpl,
} from "../internal_mod.ts";
} from "../src/internal_mod.ts";
import {
Connect,
credsAuthenticator,
defaultOptions,
extend,
parseOptions,
Servers,
} from "../internal_mod.ts";
} from "../src/internal_mod.ts";

import { NatsServer } from "../../test_helpers/launcher.ts";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
* limitations under the License.
*/

import { createInbox } from "jsr:@nats-io/[email protected]";
import type { Subscription } from "jsr:@nats-io/[email protected]";
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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading

0 comments on commit bc7433a

Please sign in to comment.