4 Commits

Author SHA1 Message Date
9b2d4d1096 Version 1.1.1 2026-03-10 18:22:04 +01:00
fae58c223b Export everything from types 2026-03-10 18:21:32 +01:00
7e5a8c74a5 Move tests to their own folder 2026-03-10 18:13:01 +01:00
df09c952de Move tests to their own folder 2026-03-10 18:12:42 +01:00
7 changed files with 14 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "meshcore", "name": "meshcore",
"version": "1.1.0", "version": "1.1.1",
"description": "MeshCore protocol support for Typescript", "description": "MeshCore protocol support for Typescript",
"keywords": [ "keywords": [
"MeshCore", "MeshCore",

View File

@@ -3,7 +3,9 @@ export * from './identity.types';
export type * from './identity.types'; export type * from './identity.types';
export * from './crypto'; export * from './crypto';
export * from './crypto.types';
export type * from './crypto.types'; export type * from './crypto.types';
export * from './packet'; export * from './packet';
export * from './packet.types';
export type * from './packet.types'; export type * from './packet.types';

View File

@@ -1,6 +1,6 @@
import { describe, it, expect } from 'vitest'; import { describe, it, expect } from 'vitest';
import { PublicKey, PrivateKey, SharedSecret, StaticSecret } from './crypto'; import { PublicKey, PrivateKey, SharedSecret, StaticSecret } from '../src/crypto';
import { bytesToHex, hexToBytes } from './parser'; import { bytesToHex, hexToBytes } from '../src/parser';
const randomBytes = (len: number) => Uint8Array.from({ length: len }, () => Math.floor(Math.random() * 256)); const randomBytes = (len: number) => Uint8Array.from({ length: len }, () => Math.floor(Math.random() * 256));

View File

@@ -1,8 +1,8 @@
import { describe, it, expect, beforeEach } from 'vitest'; import { describe, it, expect, beforeEach } from 'vitest';
import { Identity, LocalIdentity, Contact, Group, Contacts, parseNodeHash } from './identity'; import { Identity, LocalIdentity, Contact, Group, Contacts, parseNodeHash } from '../src/identity';
import { PrivateKey, PublicKey, SharedSecret } from './crypto'; import { PrivateKey, PublicKey, SharedSecret } from '../src/crypto';
import { DecryptedGroupText, DecryptedGroupData } from './packet.types'; import { DecryptedGroupText, DecryptedGroupData } from '../src/packet.types';
import { bytesToHex } from './parser'; import { bytesToHex } from '../src/parser';
function randomBytes(len: number) { function randomBytes(len: number) {
return Uint8Array.from({ length: len }, () => Math.floor(Math.random() * 256)); return Uint8Array.from({ length: len }, () => Math.floor(Math.random() * 256));

View File

@@ -1,7 +1,7 @@
import { describe, expect, test } from 'vitest'; import { describe, expect, test } from 'vitest';
import { Packet } from './packet'; import { Packet } from '../src/packet';
import { PayloadType, RouteType, NodeType, TracePayload, AdvertPayload, RequestPayload, TextPayload, ResponsePayload, RawCustomPayload, AnonReqPayload } from './packet.types'; import { PayloadType, RouteType, NodeType, TracePayload, AdvertPayload, RequestPayload, TextPayload, ResponsePayload, RawCustomPayload, AnonReqPayload } from '../src/packet.types';
import { hexToBytes, bytesToHex } from './parser'; import { hexToBytes, bytesToHex } from '../src/parser';
describe('Packet.fromBytes', () => { describe('Packet.fromBytes', () => {
test('frame 1: len=122 type=5 payload_len=99', () => { test('frame 1: len=122 type=5 payload_len=99', () => {

View File

@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest'; import { describe, it, expect } from 'vitest';
import { base64ToBytes, hexToBytes, BufferReader, BufferWriter } from './parser'; import { base64ToBytes, hexToBytes, BufferReader, BufferWriter } from '../src/parser';
describe('base64ToBytes', () => { describe('base64ToBytes', () => {
it('decodes a simple base64 string', () => { it('decodes a simple base64 string', () => {

View File

@@ -14,6 +14,6 @@
"isolatedModules": true, "isolatedModules": true,
"forceConsistentCasingInFileNames": true "forceConsistentCasingInFileNames": true
}, },
"include": ["src"], "include": ["src", "test/crypto.test.ts", "test/identity.test.ts", "test/packet.test.ts", "test/parser.test.ts"],
"exclude": ["node_modules", "dist", "test"] "exclude": ["node_modules", "dist", "test"]
} }