poe-svelte-ui-lib 2.29.2 → 2.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/locales/constructor.d.ts +1 -1
- package/dist/locales/constructor.js +1 -1
- package/dist/protocols/can.d.ts +15 -0
- package/dist/protocols/can.js +36 -0
- package/dist/protocols/dronecan/README.md +70 -0
- package/dist/protocols/dronecan/bits.d.ts +5 -0
- package/dist/protocols/dronecan/bits.js +80 -0
- package/dist/protocols/dronecan/codec.d.ts +13 -0
- package/dist/protocols/dronecan/codec.js +240 -0
- package/dist/protocols/dronecan/generated/types.d.ts +2 -0
- package/dist/protocols/dronecan/generated/types.js +2825 -0
- package/dist/protocols/dronecan/index.d.ts +34 -0
- package/dist/protocols/dronecan/index.js +39 -0
- package/dist/protocols/dronecan/transfer.d.ts +26 -0
- package/dist/protocols/dronecan/transfer.js +130 -0
- package/dist/protocols/dronecan/types.d.ts +41 -0
- package/dist/protocols/dronecan/types.js +2 -0
- package/dist/protocols/index.d.ts +1 -1
- package/dist/protocols/index.js +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type DroneCanValue } from "./codec.js";
|
|
2
|
+
import { type DroneCanId, type DroneCanTransfer, type DroneCanTransferType } from "./transfer.js";
|
|
3
|
+
import type { DroneCanTypeDef } from "./types.js";
|
|
4
|
+
export * from "./types.js";
|
|
5
|
+
export * from "./codec.js";
|
|
6
|
+
export * from "./transfer.js";
|
|
7
|
+
export { encodeScalar, decodeScalar, floatToFloat16, float16ToFloat } from "./bits.js";
|
|
8
|
+
export declare const droneCanTypeOf: (id: Pick<DroneCanId, "type" | "dataTypeId" | "source">) => DroneCanTypeDef | undefined;
|
|
9
|
+
export declare const createDroneCanTransferReceiver: (timeoutMs?: number) => {
|
|
10
|
+
push(canId: number, data: Uint8Array, now?: number): DroneCanTransfer | undefined;
|
|
11
|
+
reset(): void;
|
|
12
|
+
};
|
|
13
|
+
export interface DroneCanDecoded {
|
|
14
|
+
typeName: string;
|
|
15
|
+
value?: {
|
|
16
|
+
[key: string]: DroneCanValue;
|
|
17
|
+
};
|
|
18
|
+
error?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const decodeDroneCanTransfer: (t: DroneCanTransfer) => DroneCanDecoded;
|
|
21
|
+
export interface DroneCanOutgoing {
|
|
22
|
+
typeName: string;
|
|
23
|
+
type: DroneCanTransferType;
|
|
24
|
+
value: Record<string, unknown>;
|
|
25
|
+
source: number;
|
|
26
|
+
destination?: number;
|
|
27
|
+
priority?: number;
|
|
28
|
+
transferId: number;
|
|
29
|
+
dataTypeId?: number;
|
|
30
|
+
}
|
|
31
|
+
export declare const encodeDroneCanTransfer: (out: DroneCanOutgoing) => {
|
|
32
|
+
canId: number;
|
|
33
|
+
frames: Uint8Array[];
|
|
34
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* src/lib/protocols/dronecan/index.ts - DroneCAN (протокол CAN ArduPilot, классический CAN 1 Мбит/с), отдельная точка входа "poe-svelte-ui-lib/dronecan" (таблица типов большая и не нужна вебу прошивок): типы из официальных DSDL, кодек и передачи по алгоритмам libcanard, разбор и сборка передачи целиком */
|
|
2
|
+
import { droneCanMessage, droneCanService, droneCanStruct, droneCanType, decodeDroneCan, encodeDroneCan } from "./codec.js";
|
|
3
|
+
import { createDroneCanReceiver, droneCanFrames, makeDroneCanId } from "./transfer.js";
|
|
4
|
+
export * from "./types.js";
|
|
5
|
+
export * from "./codec.js";
|
|
6
|
+
export * from "./transfer.js";
|
|
7
|
+
export { encodeScalar, decodeScalar, floatToFloat16, float16ToFloat } from "./bits.js";
|
|
8
|
+
/* Тип передачи по её ID: сообщение - по ID сообщения, запрос и ответ - по ID сервиса */
|
|
9
|
+
export const droneCanTypeOf = (id) => id.type === "msg" ? (id.source === 0 ? undefined : droneCanMessage(id.dataTypeId)) : droneCanService(id.dataTypeId);
|
|
10
|
+
/* Сборщик передач с сигнатурами известных типов - для CRC многокадровых передач */
|
|
11
|
+
export const createDroneCanTransferReceiver = (timeoutMs = 2000) => createDroneCanReceiver({ timeoutMs, signatureOf: (id) => droneCanTypeOf(id)?.signature });
|
|
12
|
+
/* Значение передачи по описанию её типа; неизвестный тип или битые данные - error, байты остаются в transfer.payload */
|
|
13
|
+
export const decodeDroneCanTransfer = (t) => {
|
|
14
|
+
const def = droneCanTypeOf(t);
|
|
15
|
+
if (!def)
|
|
16
|
+
return { typeName: "", error: t.source === 0 && t.type === "msg" ? "anonymous" : `unknown ${t.type} ${t.dataTypeId}` };
|
|
17
|
+
if (!t.crcOk)
|
|
18
|
+
return { typeName: def.name, error: "CRC" };
|
|
19
|
+
try {
|
|
20
|
+
return { typeName: def.name, value: decodeDroneCan(droneCanStruct(def, t.type), t.payload) };
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
return { typeName: def.name, error: error instanceof Error ? error.message : String(error) };
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
/* Передача в кадры CAN: 29-битный ID и данные каждого кадра с хвостовым байтом */
|
|
27
|
+
export const encodeDroneCanTransfer = (out) => {
|
|
28
|
+
const def = droneCanType(out.typeName);
|
|
29
|
+
if (!def)
|
|
30
|
+
throw new Error(`DroneCAN: нет типа ${out.typeName}`);
|
|
31
|
+
if ((def.kind === "msg") !== (out.type === "msg"))
|
|
32
|
+
throw new Error(`DroneCAN: ${out.typeName} - ${def.kind === "msg" ? "сообщение" : "сервис"}`);
|
|
33
|
+
const dataTypeId = out.dataTypeId ?? def.id;
|
|
34
|
+
if (dataTypeId === null)
|
|
35
|
+
throw new Error(`DroneCAN: у ${out.typeName} нет ID по умолчанию`);
|
|
36
|
+
const payload = encodeDroneCan(droneCanStruct(def, out.type), out.value);
|
|
37
|
+
const canId = makeDroneCanId({ priority: out.priority ?? 16, type: out.type, dataTypeId, source: out.source, destination: out.destination ?? 0 });
|
|
38
|
+
return { canId, frames: droneCanFrames(canId, payload, out.transferId, def.signature) };
|
|
39
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type DroneCanTransferType = "msg" | "req" | "res";
|
|
2
|
+
export interface DroneCanId {
|
|
3
|
+
priority: number;
|
|
4
|
+
type: DroneCanTransferType;
|
|
5
|
+
dataTypeId: number;
|
|
6
|
+
source: number;
|
|
7
|
+
destination: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const parseDroneCanId: (canId: number) => DroneCanId;
|
|
10
|
+
export declare const makeDroneCanId: (id: DroneCanId) => number;
|
|
11
|
+
export declare const droneCanCrc: (signature: bigint, payload: Uint8Array) => number;
|
|
12
|
+
export declare const droneCanFrames: (canId: number, payload: Uint8Array, transferId: number, signature: bigint) => Uint8Array[];
|
|
13
|
+
export interface DroneCanTransfer extends DroneCanId {
|
|
14
|
+
transferId: number;
|
|
15
|
+
payload: Uint8Array;
|
|
16
|
+
timestamp: number;
|
|
17
|
+
crcOk: boolean;
|
|
18
|
+
frames: number;
|
|
19
|
+
}
|
|
20
|
+
export declare const createDroneCanReceiver: ({ timeoutMs, signatureOf }: {
|
|
21
|
+
timeoutMs?: number;
|
|
22
|
+
signatureOf: (id: DroneCanId) => bigint | undefined;
|
|
23
|
+
}) => {
|
|
24
|
+
push(canId: number, data: Uint8Array, now?: number): DroneCanTransfer | undefined;
|
|
25
|
+
reset(): void;
|
|
26
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/* src/lib/protocols/dronecan/transfer.ts - передачи DroneCAN поверх кадров CAN с 29-битным ID: разбор и сборка ID, хвостовой байт (начало, конец, toggle, transfer_id), CRC-16 многокадровой передачи с сигнатурой типа - перенос canardHandleRxFrame, enqueueTxFrames и calculateCRC из libcanard (canard.c) */
|
|
2
|
+
export const parseDroneCanId = (canId) => {
|
|
3
|
+
const priority = (canId >>> 24) & 0x1f;
|
|
4
|
+
const source = canId & 0x7f;
|
|
5
|
+
if (!((canId >>> 7) & 1)) {
|
|
6
|
+
let dataTypeId = (canId >>> 8) & 0xffff;
|
|
7
|
+
if (source === 0)
|
|
8
|
+
dataTypeId &= 0x3;
|
|
9
|
+
return { priority, type: "msg", dataTypeId, source, destination: 0 };
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
priority,
|
|
13
|
+
type: (canId >>> 15) & 1 ? "req" : "res",
|
|
14
|
+
dataTypeId: (canId >>> 16) & 0xff,
|
|
15
|
+
source,
|
|
16
|
+
destination: (canId >>> 8) & 0x7f,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export const makeDroneCanId = (id) => {
|
|
20
|
+
const head = ((id.priority & 0x1f) << 24) >>> 0;
|
|
21
|
+
if (id.type === "msg")
|
|
22
|
+
return (head | ((id.dataTypeId & 0xffff) << 8) | (id.source & 0x7f)) >>> 0;
|
|
23
|
+
return (head | ((id.dataTypeId & 0xff) << 16) | ((id.type === "req" ? 1 : 0) << 15) | ((id.destination & 0x7f) << 8) | 0x80 | (id.source & 0x7f)) >>> 0;
|
|
24
|
+
};
|
|
25
|
+
/* CRC-16-CCITT (0x1021, начальное 0xFFFF): сначала 8 байт сигнатуры младшим вперёд, затем данные */
|
|
26
|
+
const crcAddByte = (crc, byte) => {
|
|
27
|
+
crc ^= byte << 8;
|
|
28
|
+
for (let j = 0; j < 8; j++)
|
|
29
|
+
crc = crc & 0x8000 ? ((crc << 1) ^ 0x1021) & 0xffff : (crc << 1) & 0xffff;
|
|
30
|
+
return crc;
|
|
31
|
+
};
|
|
32
|
+
const crcAdd = (crc, bytes) => bytes.reduce(crcAddByte, crc);
|
|
33
|
+
const crcAddSignature = (crc, signature) => {
|
|
34
|
+
for (let shift = 0n; shift < 64n; shift += 8n)
|
|
35
|
+
crc = crcAddByte(crc, Number((signature >> shift) & 0xffn));
|
|
36
|
+
return crc;
|
|
37
|
+
};
|
|
38
|
+
export const droneCanCrc = (signature, payload) => crcAdd(crcAddSignature(0xffff, signature), payload);
|
|
39
|
+
const TAIL_START = 0x80;
|
|
40
|
+
const TAIL_END = 0x40;
|
|
41
|
+
const TAIL_TOGGLE = 0x20;
|
|
42
|
+
/* Передача в кадры CAN (данные до 8 байт): до 7 байт - один кадр, иначе CRC в первых двух байтах и куски по 7 байт; последний байт кадра - хвостовой */
|
|
43
|
+
export const droneCanFrames = (canId, payload, transferId, signature) => {
|
|
44
|
+
const tid = transferId & 0x1f;
|
|
45
|
+
if (payload.length < 8) {
|
|
46
|
+
const frame = new Uint8Array(payload.length + 1);
|
|
47
|
+
frame.set(payload);
|
|
48
|
+
frame[payload.length] = TAIL_START | TAIL_END | tid;
|
|
49
|
+
return [frame];
|
|
50
|
+
}
|
|
51
|
+
const crc = droneCanCrc(signature, payload);
|
|
52
|
+
const stream = new Uint8Array(payload.length + 2);
|
|
53
|
+
stream[0] = crc & 0xff;
|
|
54
|
+
stream[1] = crc >> 8;
|
|
55
|
+
stream.set(payload, 2);
|
|
56
|
+
const frames = [];
|
|
57
|
+
for (let offset = 0, toggle = 0; offset < stream.length; offset += 7, toggle ^= 1) {
|
|
58
|
+
const chunk = stream.subarray(offset, offset + 7);
|
|
59
|
+
const frame = new Uint8Array(chunk.length + 1);
|
|
60
|
+
frame.set(chunk);
|
|
61
|
+
const flags = (offset === 0 ? TAIL_START : 0) | (offset + 7 >= stream.length ? TAIL_END : 0);
|
|
62
|
+
frame[chunk.length] = flags | (toggle ? TAIL_TOGGLE : 0) | tid;
|
|
63
|
+
frames.push(frame);
|
|
64
|
+
}
|
|
65
|
+
return frames;
|
|
66
|
+
};
|
|
67
|
+
/* Сборщик передач: по ключу (тип, вид, отправитель, получатель) копит кадры с проверкой toggle и transfer_id; незавершённое старше timeoutMs сбрасывается. signatureOf - сигнатура типа для CRC; неизвестный тип многокадровой передачи выдаётся с crcOk = false. В отличие от libcanard принимает передачи всем узлам - терминал видит всю шину */
|
|
68
|
+
export const createDroneCanReceiver = ({ timeoutMs = 2000, signatureOf }) => {
|
|
69
|
+
const states = new Map();
|
|
70
|
+
return {
|
|
71
|
+
push(canId, data, now = Date.now()) {
|
|
72
|
+
if (data.length < 1)
|
|
73
|
+
return undefined;
|
|
74
|
+
const id = parseDroneCanId(canId);
|
|
75
|
+
const tail = data[data.length - 1];
|
|
76
|
+
const tid = tail & 0x1f;
|
|
77
|
+
const start = !!(tail & TAIL_START);
|
|
78
|
+
const end = !!(tail & TAIL_END);
|
|
79
|
+
const body = data.subarray(0, data.length - 1);
|
|
80
|
+
if (start && end)
|
|
81
|
+
return { ...id, transferId: tid, payload: body.slice(), timestamp: now, crcOk: true, frames: 1 };
|
|
82
|
+
const key = `${id.type}:${id.dataTypeId}:${id.source}:${id.destination}`;
|
|
83
|
+
for (const [k, s] of states)
|
|
84
|
+
if (now - s.last > timeoutMs)
|
|
85
|
+
states.delete(k);
|
|
86
|
+
if (start) {
|
|
87
|
+
if (body.length < 2)
|
|
88
|
+
return undefined;
|
|
89
|
+
const signature = signatureOf(id);
|
|
90
|
+
states.set(key, {
|
|
91
|
+
tid,
|
|
92
|
+
toggle: 1,
|
|
93
|
+
parts: [body.subarray(2).slice()],
|
|
94
|
+
size: body.length - 2,
|
|
95
|
+
crc: signature === undefined ? -1 : crcAdd(crcAddSignature(0xffff, signature), body.subarray(2)),
|
|
96
|
+
expected: body[0] | (body[1] << 8),
|
|
97
|
+
timestamp: now,
|
|
98
|
+
last: now,
|
|
99
|
+
frames: 1,
|
|
100
|
+
});
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
const state = states.get(key);
|
|
104
|
+
if (!state || state.tid !== tid || !!(tail & TAIL_TOGGLE) !== !!state.toggle) {
|
|
105
|
+
states.delete(key);
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
state.parts.push(body.slice());
|
|
109
|
+
state.size += body.length;
|
|
110
|
+
state.toggle ^= 1;
|
|
111
|
+
state.last = now;
|
|
112
|
+
state.frames++;
|
|
113
|
+
if (state.crc >= 0)
|
|
114
|
+
state.crc = crcAdd(state.crc, body);
|
|
115
|
+
if (!end)
|
|
116
|
+
return undefined;
|
|
117
|
+
states.delete(key);
|
|
118
|
+
const payload = new Uint8Array(state.size);
|
|
119
|
+
let offset = 0;
|
|
120
|
+
for (const part of state.parts) {
|
|
121
|
+
payload.set(part, offset);
|
|
122
|
+
offset += part.length;
|
|
123
|
+
}
|
|
124
|
+
return { ...id, transferId: tid, payload, timestamp: state.timestamp, crcOk: state.crc === state.expected, frames: state.frames };
|
|
125
|
+
},
|
|
126
|
+
reset() {
|
|
127
|
+
states.clear();
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type DroneCanField = {
|
|
2
|
+
k: "p";
|
|
3
|
+
kind: "b" | "u" | "i" | "f";
|
|
4
|
+
bits: number;
|
|
5
|
+
trunc?: boolean;
|
|
6
|
+
} | {
|
|
7
|
+
k: "v";
|
|
8
|
+
bits: number;
|
|
9
|
+
} | {
|
|
10
|
+
k: "a";
|
|
11
|
+
of: DroneCanField;
|
|
12
|
+
max: number;
|
|
13
|
+
dyn?: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
k: "c";
|
|
16
|
+
name: string;
|
|
17
|
+
};
|
|
18
|
+
export interface DroneCanStruct {
|
|
19
|
+
fields: {
|
|
20
|
+
name: string | null;
|
|
21
|
+
type: DroneCanField;
|
|
22
|
+
}[];
|
|
23
|
+
union?: boolean;
|
|
24
|
+
min: number;
|
|
25
|
+
max: number;
|
|
26
|
+
constants?: Record<string, number>;
|
|
27
|
+
}
|
|
28
|
+
export type DroneCanTypeDef = {
|
|
29
|
+
name: string;
|
|
30
|
+
id: number | null;
|
|
31
|
+
kind: "msg";
|
|
32
|
+
signature: bigint;
|
|
33
|
+
msg: DroneCanStruct;
|
|
34
|
+
} | {
|
|
35
|
+
name: string;
|
|
36
|
+
id: number | null;
|
|
37
|
+
kind: "srv";
|
|
38
|
+
signature: bigint;
|
|
39
|
+
req: DroneCanStruct;
|
|
40
|
+
res: DroneCanStruct;
|
|
41
|
+
};
|
|
@@ -7,7 +7,7 @@ export { BUS_ID_REGEXP, parseBusId, formatBusId, makeHar, splitHar, packetObject
|
|
|
7
7
|
export { createPlotGroups, debugPlotValues, DEBUG_PLOT_ARGUMENT, type PlotPoint } from "./plotGroups.js";
|
|
8
8
|
export { encodeXPoeDebugFrame, createXPoeDebugParser, xPoeDebugValueFromText, xPoeDebugRow, DEBUG_LOG_ARGUMENT, type XPoeDebugItem, type XPoeDebugRow, } from "./xPoeDebug.js";
|
|
9
9
|
export { formatXPoeDebugValue, formatXPoeDebugPretty, xPoeDebugMessage } from "./xPoeDebugView.js";
|
|
10
|
-
export { CAN_FINAL_BIT, CAN_PACKET_ID_MASK, canFragments, encodeSlcanFrame, encodeCanPacket, createCanParser, slcanOpenCommands, type CanFrame, type CanMessage, } from "./can.js";
|
|
10
|
+
export { CAN_FINAL_BIT, CAN_PACKET_ID_MASK, canFragments, encodeSlcanFrame, encodeCanPacket, createCanParser, slcanOpenCommands, createSlcanReader, encodeSlcanExtFrame, type CanFrame, type CanMessage, type SlcanFrame, } from "./can.js";
|
|
11
11
|
export { HEADER_CODES, DEFAULT_ARGUMENT_CODES, DEFAULT_DICTIONARY, createDictionary, encodeHar, decodeHar, type Dictionary, type HarParts, } from "./dictionary.js";
|
|
12
12
|
export { encodeWsEnvelope, decodeWsEnvelope, type WsEnvelope, type WsMessage } from "./wsEnvelope.js";
|
|
13
13
|
export { formatDeviceMessage, parseDebugLogMessage, DEVICE_MESSAGES, MESSAGE_CODES, MESSAGE_GROUPS, type DeviceMessage, type DeviceMessageEntry, type DeviceMessageGroup, type DeviceMessageLevel, type FormattedDeviceMessage, } from "./messages.js";
|
package/dist/protocols/index.js
CHANGED
|
@@ -15,7 +15,7 @@ export { encodeXPoeDebugFrame, createXPoeDebugParser, xPoeDebugValueFromText, xP
|
|
|
15
15
|
/* Вид Payload xPOE-Debug: кратко для строки таблицы и развёрнуто для окна */
|
|
16
16
|
export { formatXPoeDebugValue, formatXPoeDebugPretty, xPoeDebugMessage } from "./xPoeDebugView.js";
|
|
17
17
|
/* CAN/CAN FD через slcan-адаптер: нарезка пакета на кадры как в can_service прошивки, кадры slcan, потоковый разбор со сборкой фрагментов */
|
|
18
|
-
export { CAN_FINAL_BIT, CAN_PACKET_ID_MASK, canFragments, encodeSlcanFrame, encodeCanPacket, createCanParser, slcanOpenCommands, } from "./can.js";
|
|
18
|
+
export { CAN_FINAL_BIT, CAN_PACKET_ID_MASK, canFragments, encodeSlcanFrame, encodeCanPacket, createCanParser, slcanOpenCommands, createSlcanReader, encodeSlcanExtFrame, } from "./can.js";
|
|
19
19
|
/* Словарь заголовков и аргументов HAR - по умолчанию из мастер-словаря команд dictionaries/poe_cmd.yaml библиотеки (устройства и облако), разбор файла словаря, словарь устройства с обратным поиском; HAR из слов и обратно */
|
|
20
20
|
export { HEADER_CODES, DEFAULT_ARGUMENT_CODES, DEFAULT_DICTIONARY, createDictionary, encodeHar, decodeHar, } from "./dictionary.js";
|
|
21
21
|
/* Конверт WebSocket {HAR, VAL} на всех соединениях: сборка из заголовка и аргумента (имя или код), разбор в слова по словарю */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "poe-svelte-ui-lib",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.30.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Oleg-Perevyshin/ElementsUI.git"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"build": "vite build",
|
|
22
22
|
"prepare": "node -e \"try{require('child_process').execSync('git config core.hooksPath .githooks',{stdio:'ignore'})}catch{}\"",
|
|
23
23
|
"prepack": "npm run Generate && svelte-kit sync && svelte-check --tsconfig ./tsconfig.json && svelte-package && tsc -p tests/dist-types.tsconfig.json && node --test tests/*.test.mjs && publint",
|
|
24
|
-
"Generate": "node scripts/GenerateDictionary.mjs && tsx scripts/UpdateIconsLib.ts && prettier --write --log-level warn src/lib/icons.ts",
|
|
24
|
+
"Generate": "node scripts/GenerateDictionary.mjs && node scripts/GenerateDroneCAN.mjs && tsx scripts/UpdateIconsLib.ts && prettier --write --log-level warn src/lib/icons.ts src/lib/protocols/dronecan/generated/types.ts",
|
|
25
25
|
"Test": "npm run Generate && svelte-package && node --test tests/*.test.mjs",
|
|
26
26
|
"Formatting": "prettier --write .",
|
|
27
27
|
"CheckUpdate": "npx npm-check-updates -u && npm install"
|
|
@@ -37,6 +37,10 @@
|
|
|
37
37
|
"types": "./dist/protocols/index.d.ts",
|
|
38
38
|
"default": "./dist/protocols/index.js"
|
|
39
39
|
},
|
|
40
|
+
"./dronecan": {
|
|
41
|
+
"types": "./dist/protocols/dronecan/index.d.ts",
|
|
42
|
+
"default": "./dist/protocols/dronecan/index.js"
|
|
43
|
+
},
|
|
40
44
|
"./dictionaries/*": "./dist/dictionaries/*",
|
|
41
45
|
"./constructor": {
|
|
42
46
|
"types": "./dist/constructor.d.ts",
|