Use workspace meshtastic packages (#749)
* refactor: updated web package.json to use workspace * formatting fixes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
export * as Protobuf from "@meshtastic/protobufs";
|
||||
export { Constants } from "./src/constants.ts";
|
||||
export { MeshDevice } from "./src/meshDevice.ts";
|
||||
export * as Protobuf from "@meshtastic/protobufs";
|
||||
export * as Types from "./src/types.ts";
|
||||
export * as Utils from "./src/utils/mod.ts";
|
||||
|
||||
@@ -202,7 +202,7 @@ export class MeshDevice {
|
||||
});
|
||||
|
||||
if (echoResponse) {
|
||||
meshPacket.rxTime = Math.trunc(new Date().getTime() / 1000);
|
||||
meshPacket.rxTime = Math.trunc(Date.now() / 1000);
|
||||
this.handleMeshPacket(meshPacket);
|
||||
}
|
||||
return await this.sendRaw(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type * as Protobuf from "@meshtastic/protobufs";
|
||||
import { SimpleEventDispatcher } from "ste-simple-events";
|
||||
import type { PacketMetadata } from "../types.ts";
|
||||
import type * as Types from "../types.ts";
|
||||
import type { PacketMetadata } from "../types.ts";
|
||||
|
||||
export class EventSystem {
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export { EventSystem } from "./eventSystem.ts";
|
||||
export { Queue } from "./queue.ts";
|
||||
export { Xmodem } from "./xmodem.ts";
|
||||
export { toDeviceStream } from "./transform/toDevice.ts";
|
||||
export { fromDeviceStream } from "./transform/fromDevice.ts";
|
||||
export { toDeviceStream } from "./transform/toDevice.ts";
|
||||
export { Xmodem } from "./xmodem.ts";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { fromBinary } from "@bufbuild/protobuf";
|
||||
import { Constants, Protobuf, Types } from "../../../mod.ts";
|
||||
import type { MeshDevice } from "../../../mod.ts";
|
||||
import { Constants, Protobuf, Types } from "../../../mod.ts";
|
||||
import type { DeviceOutput } from "../../types.ts";
|
||||
|
||||
export const decodePacket = (device: MeshDevice) =>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Utils } from "@meshtastic/core";
|
||||
import type { Types } from "@meshtastic/core";
|
||||
import { Utils } from "@meshtastic/core";
|
||||
|
||||
export class TransportDeno implements Types.Transport {
|
||||
private _toDevice: WritableStream<Uint8Array>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Socket } from "node:net";
|
||||
import { Readable, Writable } from "node:stream";
|
||||
import { Utils } from "@meshtastic/core";
|
||||
import type { Types } from "@meshtastic/core";
|
||||
import { Utils } from "@meshtastic/core";
|
||||
|
||||
export class TransportNode implements Types.Transport {
|
||||
private readonly _toDevice: WritableStream<Uint8Array>;
|
||||
@@ -45,9 +45,9 @@ export class TransportNode implements Types.Transport {
|
||||
) as ReadableStream<Uint8Array>;
|
||||
this._fromDevice = fromDeviceSource.pipeThrough(Utils.fromDeviceStream());
|
||||
|
||||
// Stream for data going FROM the application TO the Meshtastic device.
|
||||
const toDeviceTransform = Utils.toDeviceStream;
|
||||
this._toDevice = toDeviceTransform.writable;
|
||||
// Stream for data going FROM the application TO the Meshtastic device.
|
||||
const toDeviceTransform = Utils.toDeviceStream;
|
||||
this._toDevice = toDeviceTransform.writable;
|
||||
|
||||
// The readable end of the transform is then piped to the Node.js socket.
|
||||
// A similar assertion is needed here because `Writable.toWeb` also returns
|
||||
|
||||
@@ -89,6 +89,7 @@ export class TransportWebBluetooth implements Types.Transport {
|
||||
|
||||
if (this._isFirstWrite && this._fromDeviceController) {
|
||||
this._isFirstWrite = false;
|
||||
|
||||
setTimeout(() => {
|
||||
this.readFromRadio(this._fromDeviceController!);
|
||||
}, 50);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Utils } from "@meshtastic/core";
|
||||
import type { Types } from "@meshtastic/core";
|
||||
import { Utils } from "@meshtastic/core";
|
||||
|
||||
export class TransportWebSerial implements Types.Transport {
|
||||
private _toDevice: WritableStream<Uint8Array>;
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
"dependencies": {
|
||||
"@bufbuild/protobuf": "^2.6.0",
|
||||
"@hookform/resolvers": "^5.1.1",
|
||||
"@meshtastic/core": "npm:@jsr/meshtastic__core@2.6.4",
|
||||
"@meshtastic/transport-http": "npm:@jsr/meshtastic__transport-http",
|
||||
"@meshtastic/transport-web-bluetooth": "npm:@jsr/meshtastic__transport-web-bluetooth",
|
||||
"@meshtastic/transport-web-serial": "npm:@jsr/meshtastic__transport-web-serial",
|
||||
"@meshtastic/core": "workspace:*",
|
||||
"@meshtastic/transport-http": "workspace:*",
|
||||
"@meshtastic/transport-web-bluetooth": "workspace:*",
|
||||
"@meshtastic/transport-web-serial": "workspace:*",
|
||||
"@noble/curves": "^1.9.2",
|
||||
"@radix-ui/react-accordion": "^1.2.11",
|
||||
"@radix-ui/react-checkbox": "^1.3.2",
|
||||
@@ -48,6 +48,7 @@
|
||||
"@radix-ui/react-tabs": "^1.1.12",
|
||||
"@radix-ui/react-toast": "^1.2.14",
|
||||
"@radix-ui/react-toggle-group": "^1.1.10",
|
||||
"@radix-ui/react-visually-hidden": "^1.2.3",
|
||||
"@radix-ui/react-tooltip": "^1.2.7",
|
||||
"@tailwindcss/vite": "^4.1.11",
|
||||
"@tanstack/react-router": "^1.127.9",
|
||||
|
||||
@@ -37,7 +37,7 @@ export const BLE = ({ closeDialog }: TabElementProps) => {
|
||||
device.addConnection(connection);
|
||||
subscribeAll(device, connection, messageStore);
|
||||
|
||||
const HEARTBEAT_INTERVAL = 5*60*1000;
|
||||
const HEARTBEAT_INTERVAL = 5 * 60 * 1000;
|
||||
connection.setHeartbeatInterval(HEARTBEAT_INTERVAL);
|
||||
|
||||
closeDialog();
|
||||
|
||||
@@ -43,7 +43,7 @@ export const Serial = ({ closeDialog }: TabElementProps) => {
|
||||
device.addConnection(connection);
|
||||
subscribeAll(device, connection, messageStore);
|
||||
|
||||
const HEARTBEAT_INTERVAL = 5*60*1000;
|
||||
const HEARTBEAT_INTERVAL = 5 * 60 * 1000;
|
||||
connection.setHeartbeatInterval(HEARTBEAT_INTERVAL);
|
||||
|
||||
closeDialog();
|
||||
|
||||
@@ -134,7 +134,7 @@ export const MessageItem = ({ message }: MessageItemProps) => {
|
||||
minute: "2-digit",
|
||||
hour12: config?.display?.use12hClock ?? true,
|
||||
}) ?? "",
|
||||
[messageDate, locale],
|
||||
[messageDate, locale, config?.display?.use12hClock],
|
||||
);
|
||||
|
||||
const fullDateTime = useMemo(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Dialog, DialogContent, DialogTitle } from "@components/UI/Dialog.tsx";
|
||||
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
||||
import { cn } from "@core/utils/cn.ts";
|
||||
import type { DialogProps } from "@radix-ui/react-dialog";
|
||||
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
||||
import { Command as CommandPrimitive } from "cmdk";
|
||||
import { Search } from "lucide-react";
|
||||
import * as React from "react";
|
||||
|
||||
Reference in New Issue
Block a user