Browse Source

formatting fixes

pull/749/head
Dan Ditomaso 12 months ago
parent
commit
052ae50dd4
  1. 2
      packages/core/mod.ts
  2. 2
      packages/core/src/meshDevice.ts
  3. 2
      packages/core/src/utils/eventSystem.ts
  4. 4
      packages/core/src/utils/mod.ts
  5. 2
      packages/core/src/utils/transform/decodePacket.ts
  6. 2
      packages/transport-deno/src/transport.ts
  7. 8
      packages/transport-node/src/transport.ts
  8. 1
      packages/transport-web-bluetooth/src/transport.ts
  9. 2
      packages/transport-web-serial/src/transport.ts
  10. 2
      packages/web/src/components/PageComponents/Connect/BLE.tsx
  11. 2
      packages/web/src/components/PageComponents/Connect/Serial.tsx
  12. 2
      packages/web/src/components/PageComponents/Messages/MessageItem.tsx
  13. 2
      packages/web/src/components/UI/Command.tsx

2
packages/core/mod.ts

@ -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";

2
packages/core/src/meshDevice.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(

2
packages/core/src/utils/eventSystem.ts

@ -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 {
/**

4
packages/core/src/utils/mod.ts

@ -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";

2
packages/core/src/utils/transform/decodePacket.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) =>

2
packages/transport-deno/src/transport.ts

@ -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>;

8
packages/transport-node/src/transport.ts

@ -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

1
packages/transport-web-bluetooth/src/transport.ts

@ -89,6 +89,7 @@ export class TransportWebBluetooth implements Types.Transport {
if (this._isFirstWrite && this._fromDeviceController) {
this._isFirstWrite = false;
setTimeout(() => {
this.readFromRadio(this._fromDeviceController!);
}, 50);

2
packages/transport-web-serial/src/transport.ts

@ -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>;

2
packages/web/src/components/PageComponents/Connect/BLE.tsx

@ -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();

2
packages/web/src/components/PageComponents/Connect/Serial.tsx

@ -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();

2
packages/web/src/components/PageComponents/Messages/MessageItem.tsx

@ -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(

2
packages/web/src/components/UI/Command.tsx

@ -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";

Loading…
Cancel
Save