Skip to content

Commit

Permalink
Merge pull request #21 from seriousme/export-tcp-client-server
Browse files Browse the repository at this point in the history
Export TcpClient,TcpServer, mqttPacket and utils
  • Loading branch information
seriousme authored Jan 18, 2025
2 parents 6ace4a3 + 98102b1 commit 2bc3a86
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

### Changed

## [v1.6.0] 18-01-2025

### Changed

- added: export TcpClient and TcpServer for both NodeJS and Deno
- added: export mqttPacket and utils

## [v1.5.1] 16-01-2025

### Changed
Expand Down
2 changes: 1 addition & 1 deletion bin/conformanceServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AuthenticationResult } from "../server/mod.ts";
import type { Context, TAuthenticationResult, Topic } from "../server/mod.ts";
import { logger, LogLevel } from "../utils/mod.ts";
import { getArgs, parseArgs } from "../utils/mod.ts";
import { TcpServer } from "../node/server.ts";
import { TcpServer } from "../node/tcpServer.ts";

const utf8Decoder = new TextDecoder();
const userTable = new Map();
Expand Down
2 changes: 1 addition & 1 deletion bin/demoServer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env -S node --experimental-strip-types
import { TcpServer } from "../node/server.ts";
import { TcpServer } from "../node/tcpServer.ts";
import type { Context, TAuthenticationResult, Topic } from "../server/mod.ts";
import { AuthenticationResult } from "../server/mod.ts";
import { getArgs, logger, LogLevel, parseArgs } from "../utils/mod.ts";
Expand Down
2 changes: 1 addition & 1 deletion bin/mqtt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { DEFAULT_URL } from "../client/mod.ts";
import { logger, LogLevel } from "../utils/mod.ts";
import { getArgs, parseArgs } from "../utils/mod.ts";
import { getFileData, TcpClient } from "../node/client.ts";
import { getFileData, TcpClient } from "../node/tcpClient.ts";
import type { Args } from "../utils/args.ts";

const client = new TcpClient();
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion deno/server.test.ts → deno/tcpServer.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from "node:assert/strict";
import { test } from "node:test";
import { TcpServer } from "./server.ts";
import { TcpServer } from "./tcpServer.ts";

test("Deno testServer", () => {
const server = new TcpServer({ port: 0 }, {});
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion dist/bin/conformanceServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { AuthenticationResult } from "../server/mod.js";
import { logger, LogLevel } from "../utils/mod.js";
import { getArgs, parseArgs } from "../utils/mod.js";
import { TcpServer } from "../node/server.js";
import { TcpServer } from "../node/tcpServer.js";
const utf8Decoder = new TextDecoder();
const userTable = new Map();
userTable.set("IoTester_1", "strong_password");
Expand Down
2 changes: 1 addition & 1 deletion dist/bin/demoServer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env -S node --experimental-strip-types
import { TcpServer } from "../node/server.js";
import { TcpServer } from "../node/tcpServer.js";
import { AuthenticationResult } from "../server/mod.js";
import { getArgs, logger, LogLevel, parseArgs } from "../utils/mod.js";
const utf8Decoder = new TextDecoder();
Expand Down
2 changes: 1 addition & 1 deletion dist/bin/mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { DEFAULT_URL } from "../client/mod.js";
import { logger, LogLevel } from "../utils/mod.js";
import { getArgs, parseArgs } from "../utils/mod.js";
import { getFileData, TcpClient } from "../node/client.js";
import { getFileData, TcpClient } from "../node/tcpClient.js";
const client = new TcpClient();
const encoder = new TextEncoder();
const decoder = new TextDecoder();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions node/server.test.ts → node/tcpServer.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test } from "node:test";
import assert from "node:assert/strict";
import { TcpClient } from "./client.ts";
import { TcpServer } from "./server.ts";
import { TcpClient } from "./tcpClient.ts";
import { TcpServer } from "./tcpServer.ts";
import { logger, LogLevel } from "../utils/mod.ts";
import type { PublishPacket, QoS } from "../mqttPacket/mod.ts";

Expand Down
File renamed without changes.
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@
},
"exports": {
"./server": "./dist/server/mod.js",
"./client": "./dist/client/mod.js"
"./client": "./dist/client/mod.js",
"./mqttPacket": "./dist/mqttPacket/mod.js",
"./utils": "./dist/utils/mod.js,",
"./tcpClient": "./dist/node/tcpClient.js",
"./tcpServer": "./dist/node/tcpServer.js"
},
"deno": {
"exports": {
"./server": "./server/mod.ts",
"./client": "./client/mod.ts"
"./client": "./client/mod.ts",
"./mqttPacket": "./mqttPacket/mod.ts",
"./utils": "./utils/mod.ts,",
"./tcpClient": "./deno/tcpClient.ts",
"./tcpServer": "./deno/tcpServer.ts"
},
"exclude": [
"dist"
Expand Down

0 comments on commit 2bc3a86

Please sign in to comment.