@ledgerhq/hw-transport-node-hid 6.29.5 → 6.29.6-next.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +10 -0
- package/lib/TransportNodeHid.js +80 -80
- package/lib/TransportNodeHid.js.map +1 -1
- package/lib-es/TransportNodeHid.js +81 -82
- package/lib-es/TransportNodeHid.js.map +1 -1
- package/package.json +8 -7
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @ledgerhq/hw-transport-node-hid
|
|
2
2
|
|
|
3
|
+
## 6.29.6-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`107f35a`](https://github.com/LedgerHQ/ledger-live/commit/107f35a0650412716b088a3503b86435e6d9cf47), [`9081c26`](https://github.com/LedgerHQ/ledger-live/commit/9081c2648490f977469a33762a3c67bb2c2a0be5)]:
|
|
8
|
+
- @ledgerhq/errors@6.21.0-next.0
|
|
9
|
+
- @ledgerhq/devices@8.4.5-next.0
|
|
10
|
+
- @ledgerhq/hw-transport@6.31.5-next.0
|
|
11
|
+
- @ledgerhq/hw-transport-node-hid-noevents@6.30.6-next.0
|
|
12
|
+
|
|
3
13
|
## 6.29.5
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/lib/TransportNodeHid.js
CHANGED
|
@@ -41,6 +41,86 @@ let listenDevicesPollingSkip = () => false;
|
|
|
41
41
|
* TransportNodeHid.create().then(transport => ...)
|
|
42
42
|
*/
|
|
43
43
|
class TransportNodeHid extends hw_transport_node_hid_noevents_1.default {
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
static isSupported = hw_transport_node_hid_noevents_1.default.isSupported;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
static list = hw_transport_node_hid_noevents_1.default.list;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
static setListenDevicesDebounce = (delay) => {
|
|
56
|
+
listenDevicesDebounce = delay;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
*/
|
|
61
|
+
static setListenDevicesPollingSkip = (conditionToSkip) => {
|
|
62
|
+
listenDevicesPollingSkip = conditionToSkip;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
static setListenDevicesDebug = () => {
|
|
68
|
+
console.warn("setListenDevicesDebug is deprecated. Use @ledgerhq/logs instead. No logs will get emitted there anymore.");
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
*/
|
|
72
|
+
static listen = (observer) => {
|
|
73
|
+
let unsubscribed = false;
|
|
74
|
+
Promise.resolve((0, hw_transport_node_hid_noevents_1.getDevices)()).then(devices => {
|
|
75
|
+
// this needs to run asynchronously so the subscription is defined during this phase
|
|
76
|
+
for (const device of devices) {
|
|
77
|
+
if (!unsubscribed) {
|
|
78
|
+
const descriptor = device.path;
|
|
79
|
+
const deviceModel = (0, devices_1.identifyUSBProductId)(device.productId);
|
|
80
|
+
observer.next({
|
|
81
|
+
type: "add",
|
|
82
|
+
descriptor,
|
|
83
|
+
device,
|
|
84
|
+
deviceModel,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const { events, stop } = (0, listenDevices_1.default)(listenDevicesDebounce, listenDevicesPollingSkip);
|
|
90
|
+
const onAdd = device => {
|
|
91
|
+
if (unsubscribed || !device)
|
|
92
|
+
return;
|
|
93
|
+
const deviceModel = (0, devices_1.identifyUSBProductId)(device.productId);
|
|
94
|
+
observer.next({
|
|
95
|
+
type: "add",
|
|
96
|
+
descriptor: device.path,
|
|
97
|
+
deviceModel,
|
|
98
|
+
device,
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
const onRemove = device => {
|
|
102
|
+
if (unsubscribed || !device)
|
|
103
|
+
return;
|
|
104
|
+
const deviceModel = (0, devices_1.identifyUSBProductId)(device.productId);
|
|
105
|
+
observer.next({
|
|
106
|
+
type: "remove",
|
|
107
|
+
descriptor: device.path,
|
|
108
|
+
deviceModel,
|
|
109
|
+
device,
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
events.on("add", onAdd);
|
|
113
|
+
events.on("remove", onRemove);
|
|
114
|
+
function unsubscribe() {
|
|
115
|
+
unsubscribed = true;
|
|
116
|
+
events.removeListener("add", onAdd);
|
|
117
|
+
events.removeListener("remove", onRemove);
|
|
118
|
+
stop();
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
unsubscribe,
|
|
122
|
+
};
|
|
123
|
+
};
|
|
44
124
|
/**
|
|
45
125
|
* if path="" is not provided, the library will take the first device
|
|
46
126
|
*/
|
|
@@ -56,85 +136,5 @@ class TransportNodeHid extends hw_transport_node_hid_noevents_1.default {
|
|
|
56
136
|
});
|
|
57
137
|
}
|
|
58
138
|
}
|
|
59
|
-
/**
|
|
60
|
-
*
|
|
61
|
-
*/
|
|
62
|
-
TransportNodeHid.isSupported = hw_transport_node_hid_noevents_1.default.isSupported;
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
*/
|
|
66
|
-
TransportNodeHid.list = hw_transport_node_hid_noevents_1.default.list;
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
|
-
TransportNodeHid.setListenDevicesDebounce = (delay) => {
|
|
71
|
-
listenDevicesDebounce = delay;
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
*
|
|
75
|
-
*/
|
|
76
|
-
TransportNodeHid.setListenDevicesPollingSkip = (conditionToSkip) => {
|
|
77
|
-
listenDevicesPollingSkip = conditionToSkip;
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
*
|
|
81
|
-
*/
|
|
82
|
-
TransportNodeHid.setListenDevicesDebug = () => {
|
|
83
|
-
console.warn("setListenDevicesDebug is deprecated. Use @ledgerhq/logs instead. No logs will get emitted there anymore.");
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
*/
|
|
87
|
-
TransportNodeHid.listen = (observer) => {
|
|
88
|
-
let unsubscribed = false;
|
|
89
|
-
Promise.resolve((0, hw_transport_node_hid_noevents_1.getDevices)()).then(devices => {
|
|
90
|
-
// this needs to run asynchronously so the subscription is defined during this phase
|
|
91
|
-
for (const device of devices) {
|
|
92
|
-
if (!unsubscribed) {
|
|
93
|
-
const descriptor = device.path;
|
|
94
|
-
const deviceModel = (0, devices_1.identifyUSBProductId)(device.productId);
|
|
95
|
-
observer.next({
|
|
96
|
-
type: "add",
|
|
97
|
-
descriptor,
|
|
98
|
-
device,
|
|
99
|
-
deviceModel,
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
const { events, stop } = (0, listenDevices_1.default)(listenDevicesDebounce, listenDevicesPollingSkip);
|
|
105
|
-
const onAdd = device => {
|
|
106
|
-
if (unsubscribed || !device)
|
|
107
|
-
return;
|
|
108
|
-
const deviceModel = (0, devices_1.identifyUSBProductId)(device.productId);
|
|
109
|
-
observer.next({
|
|
110
|
-
type: "add",
|
|
111
|
-
descriptor: device.path,
|
|
112
|
-
deviceModel,
|
|
113
|
-
device,
|
|
114
|
-
});
|
|
115
|
-
};
|
|
116
|
-
const onRemove = device => {
|
|
117
|
-
if (unsubscribed || !device)
|
|
118
|
-
return;
|
|
119
|
-
const deviceModel = (0, devices_1.identifyUSBProductId)(device.productId);
|
|
120
|
-
observer.next({
|
|
121
|
-
type: "remove",
|
|
122
|
-
descriptor: device.path,
|
|
123
|
-
deviceModel,
|
|
124
|
-
device,
|
|
125
|
-
});
|
|
126
|
-
};
|
|
127
|
-
events.on("add", onAdd);
|
|
128
|
-
events.on("remove", onRemove);
|
|
129
|
-
function unsubscribe() {
|
|
130
|
-
unsubscribed = true;
|
|
131
|
-
events.removeListener("add", onAdd);
|
|
132
|
-
events.removeListener("remove", onRemove);
|
|
133
|
-
stop();
|
|
134
|
-
}
|
|
135
|
-
return {
|
|
136
|
-
unsubscribe,
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
139
|
exports.default = TransportNodeHid;
|
|
140
140
|
//# sourceMappingURL=TransportNodeHid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransportNodeHid.js","sourceRoot":"","sources":["../src/TransportNodeHid.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAA2B;AAC3B,2GAAgG;AAEhG,+CAAyD;AACzD,6CAAkD;AAClD,oEAA4C;AAC5C,IAAI,qBAAqB,GAAG,GAAG,CAAC;AAEhC,IAAI,wBAAwB,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC;AAC3C;;;;;;GAMG;AAEH,MAAqB,gBAAiB,SAAQ,wCAAwB;
|
|
1
|
+
{"version":3,"file":"TransportNodeHid.js","sourceRoot":"","sources":["../src/TransportNodeHid.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAA2B;AAC3B,2GAAgG;AAEhG,+CAAyD;AACzD,6CAAkD;AAClD,oEAA4C;AAC5C,IAAI,qBAAqB,GAAG,GAAG,CAAC;AAEhC,IAAI,wBAAwB,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC;AAC3C;;;;;;GAMG;AAEH,MAAqB,gBAAiB,SAAQ,wCAAwB;IACpE;;OAEG;IACH,MAAM,CAAC,WAAW,GAAG,wCAAwB,CAAC,WAAW,CAAC;IAE1D;;OAEG;IACH,MAAM,CAAC,IAAI,GAAG,wCAAwB,CAAC,IAAI,CAAC;IAE5C;;OAEG;IACH,MAAM,CAAC,wBAAwB,GAAG,CAAC,KAAa,EAAE,EAAE;QAClD,qBAAqB,GAAG,KAAK,CAAC;IAChC,CAAC,CAAC;IAEF;;O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C;IACL,CAAC;;AA3GH,mCA4GC"}
|
|
@@ -12,7 +12,87 @@ let listenDevicesPollingSkip = () => false;
|
|
|
12
12
|
* ...
|
|
13
13
|
* TransportNodeHid.create().then(transport => ...)
|
|
14
14
|
*/
|
|
15
|
-
class TransportNodeHid extends TransportNodeHidNoEvents {
|
|
15
|
+
export default class TransportNodeHid extends TransportNodeHidNoEvents {
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
static isSupported = TransportNodeHidNoEvents.isSupported;
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
static list = TransportNodeHidNoEvents.list;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
static setListenDevicesDebounce = (delay) => {
|
|
28
|
+
listenDevicesDebounce = delay;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
static setListenDevicesPollingSkip = (conditionToSkip) => {
|
|
34
|
+
listenDevicesPollingSkip = conditionToSkip;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
static setListenDevicesDebug = () => {
|
|
40
|
+
console.warn("setListenDevicesDebug is deprecated. Use @ledgerhq/logs instead. No logs will get emitted there anymore.");
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
*/
|
|
44
|
+
static listen = (observer) => {
|
|
45
|
+
let unsubscribed = false;
|
|
46
|
+
Promise.resolve(getDevices()).then(devices => {
|
|
47
|
+
// this needs to run asynchronously so the subscription is defined during this phase
|
|
48
|
+
for (const device of devices) {
|
|
49
|
+
if (!unsubscribed) {
|
|
50
|
+
const descriptor = device.path;
|
|
51
|
+
const deviceModel = identifyUSBProductId(device.productId);
|
|
52
|
+
observer.next({
|
|
53
|
+
type: "add",
|
|
54
|
+
descriptor,
|
|
55
|
+
device,
|
|
56
|
+
deviceModel,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const { events, stop } = listenDevices(listenDevicesDebounce, listenDevicesPollingSkip);
|
|
62
|
+
const onAdd = device => {
|
|
63
|
+
if (unsubscribed || !device)
|
|
64
|
+
return;
|
|
65
|
+
const deviceModel = identifyUSBProductId(device.productId);
|
|
66
|
+
observer.next({
|
|
67
|
+
type: "add",
|
|
68
|
+
descriptor: device.path,
|
|
69
|
+
deviceModel,
|
|
70
|
+
device,
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
const onRemove = device => {
|
|
74
|
+
if (unsubscribed || !device)
|
|
75
|
+
return;
|
|
76
|
+
const deviceModel = identifyUSBProductId(device.productId);
|
|
77
|
+
observer.next({
|
|
78
|
+
type: "remove",
|
|
79
|
+
descriptor: device.path,
|
|
80
|
+
deviceModel,
|
|
81
|
+
device,
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
events.on("add", onAdd);
|
|
85
|
+
events.on("remove", onRemove);
|
|
86
|
+
function unsubscribe() {
|
|
87
|
+
unsubscribed = true;
|
|
88
|
+
events.removeListener("add", onAdd);
|
|
89
|
+
events.removeListener("remove", onRemove);
|
|
90
|
+
stop();
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
unsubscribe,
|
|
94
|
+
};
|
|
95
|
+
};
|
|
16
96
|
/**
|
|
17
97
|
* if path="" is not provided, the library will take the first device
|
|
18
98
|
*/
|
|
@@ -28,85 +108,4 @@ class TransportNodeHid extends TransportNodeHidNoEvents {
|
|
|
28
108
|
});
|
|
29
109
|
}
|
|
30
110
|
}
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
TransportNodeHid.isSupported = TransportNodeHidNoEvents.isSupported;
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
38
|
-
TransportNodeHid.list = TransportNodeHidNoEvents.list;
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
TransportNodeHid.setListenDevicesDebounce = (delay) => {
|
|
43
|
-
listenDevicesDebounce = delay;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
*/
|
|
48
|
-
TransportNodeHid.setListenDevicesPollingSkip = (conditionToSkip) => {
|
|
49
|
-
listenDevicesPollingSkip = conditionToSkip;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
*/
|
|
54
|
-
TransportNodeHid.setListenDevicesDebug = () => {
|
|
55
|
-
console.warn("setListenDevicesDebug is deprecated. Use @ledgerhq/logs instead. No logs will get emitted there anymore.");
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
*/
|
|
59
|
-
TransportNodeHid.listen = (observer) => {
|
|
60
|
-
let unsubscribed = false;
|
|
61
|
-
Promise.resolve(getDevices()).then(devices => {
|
|
62
|
-
// this needs to run asynchronously so the subscription is defined during this phase
|
|
63
|
-
for (const device of devices) {
|
|
64
|
-
if (!unsubscribed) {
|
|
65
|
-
const descriptor = device.path;
|
|
66
|
-
const deviceModel = identifyUSBProductId(device.productId);
|
|
67
|
-
observer.next({
|
|
68
|
-
type: "add",
|
|
69
|
-
descriptor,
|
|
70
|
-
device,
|
|
71
|
-
deviceModel,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
const { events, stop } = listenDevices(listenDevicesDebounce, listenDevicesPollingSkip);
|
|
77
|
-
const onAdd = device => {
|
|
78
|
-
if (unsubscribed || !device)
|
|
79
|
-
return;
|
|
80
|
-
const deviceModel = identifyUSBProductId(device.productId);
|
|
81
|
-
observer.next({
|
|
82
|
-
type: "add",
|
|
83
|
-
descriptor: device.path,
|
|
84
|
-
deviceModel,
|
|
85
|
-
device,
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
const onRemove = device => {
|
|
89
|
-
if (unsubscribed || !device)
|
|
90
|
-
return;
|
|
91
|
-
const deviceModel = identifyUSBProductId(device.productId);
|
|
92
|
-
observer.next({
|
|
93
|
-
type: "remove",
|
|
94
|
-
descriptor: device.path,
|
|
95
|
-
deviceModel,
|
|
96
|
-
device,
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
events.on("add", onAdd);
|
|
100
|
-
events.on("remove", onRemove);
|
|
101
|
-
function unsubscribe() {
|
|
102
|
-
unsubscribed = true;
|
|
103
|
-
events.removeListener("add", onAdd);
|
|
104
|
-
events.removeListener("remove", onRemove);
|
|
105
|
-
stop();
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
unsubscribe,
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
export default TransportNodeHid;
|
|
112
111
|
//# sourceMappingURL=TransportNodeHid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransportNodeHid.js","sourceRoot":"","sources":["../src/TransportNodeHid.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,wBAAwB,EAAE,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEhG,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,IAAI,qBAAqB,GAAG,GAAG,CAAC;AAEhC,IAAI,wBAAwB,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC;AAC3C;;;;;;GAMG;AAEH,
|
|
1
|
+
{"version":3,"file":"TransportNodeHid.js","sourceRoot":"","sources":["../src/TransportNodeHid.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,wBAAwB,EAAE,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEhG,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MA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,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;YACjC,IAAI,IAAI,EAAE,CAAC;gBACT,OAAO,IAAI,gBAAgB,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;YACjD,CAAC;YAED,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,CAAC,MAAM;gBAAE,MAAM,IAAI,cAAc,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;YAC9D,OAAO,IAAI,gBAAgB,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,IAAc,CAAC,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;IACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/hw-transport-node-hid",
|
|
3
|
-
"version": "6.29.
|
|
3
|
+
"version": "6.29.6-next.0",
|
|
4
4
|
"description": "Ledger Hardware Wallet Node implementation of the communication layer, using node-hid",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
"lodash": "^4.17.21",
|
|
31
31
|
"node-hid": "2.1.2",
|
|
32
32
|
"usb": "2.9.0",
|
|
33
|
-
"@ledgerhq/devices": "
|
|
34
|
-
"@ledgerhq/errors": "^6.
|
|
35
|
-
"@ledgerhq/hw-transport": "^6.31.
|
|
36
|
-
"@ledgerhq/hw-transport-node-hid-noevents": "^6.30.
|
|
33
|
+
"@ledgerhq/devices": "8.4.5-next.0",
|
|
34
|
+
"@ledgerhq/errors": "^6.21.0-next.0",
|
|
35
|
+
"@ledgerhq/hw-transport": "^6.31.5-next.0",
|
|
36
|
+
"@ledgerhq/hw-transport-node-hid-noevents": "^6.30.6-next.0",
|
|
37
37
|
"@ledgerhq/logs": "^6.12.0"
|
|
38
38
|
},
|
|
39
39
|
"gitHead": "dd0dea64b58e5a9125c8a422dcffd29e5ef6abec",
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/jest": "^29.5.10",
|
|
42
|
-
"@types/node": "^
|
|
42
|
+
"@types/node": "^22.10.10",
|
|
43
43
|
"documentation": "14.0.2",
|
|
44
44
|
"jest": "^29.7.0",
|
|
45
45
|
"rimraf": "^4.4.1",
|
|
@@ -49,9 +49,10 @@
|
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"clean": "rimraf lib lib-es",
|
|
52
|
-
"build": "tsc && tsc -m
|
|
52
|
+
"build": "tsc && tsc -m esnext --moduleResolution bundler --outDir lib-es",
|
|
53
53
|
"prewatch": "pnpm build",
|
|
54
54
|
"watch": "tsc --watch",
|
|
55
|
+
"watch:es": "tsc --watch -m esnext --moduleResolution bundler --outDir lib-es",
|
|
55
56
|
"doc": "documentation readme src/** --section=API --pe ts --re ts --re d.ts",
|
|
56
57
|
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache",
|
|
57
58
|
"lint:fix": "pnpm lint --fix",
|