@notabene/javascript-sdk 2.0.0-next.9 → 2.0.1
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/LICENSE.md +21 -0
- package/README.md +477 -111
- package/dist/js/notabene.js +1 -0
- package/dist/notabene.cjs +1 -1
- package/dist/notabene.js +286 -110
- package/package.json +34 -25
- package/src/__tests__/notabene.test.ts +113 -2
- package/src/arbitraries.ts +0 -13
- package/src/components/EmbeddedComponent.ts +125 -63
- package/src/components/__tests__/EmbeddedComponent.test.ts +402 -32
- package/src/ivms/types.ts +177 -140
- package/src/locales.ts +48 -0
- package/src/notabene.ts +199 -63
- package/src/types.ts +773 -150
- package/src/utils/MessageEventManager.ts +70 -9
- package/src/utils/__tests__/MessageEventManager.test.ts +29 -5
- package/src/utils/__tests__/urls.test.ts +112 -0
- package/src/utils/arbitraries.ts +219 -1
- package/src/utils/urls.ts +30 -5
- package/dist/notabene.d.ts +0 -780
- package/dist/tsdoc-metadata.json +0 -11
package/dist/notabene.js
CHANGED
|
@@ -1,167 +1,343 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var h = /* @__PURE__ */ ((
|
|
5
|
-
class
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var m = (e, t, r) => t in e ? c(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var o = (e, t, r) => m(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
var u = /* @__PURE__ */ ((e) => (e.PRIVATE = "WALLET", e.VASP = "VASP", e))(u || {}), E = /* @__PURE__ */ ((e) => (e.NATURAL = "natural", e.LEGAL = "legal", e.SELF = "self", e))(E || {}), f = /* @__PURE__ */ ((e) => (e.EMPTY = "empty", e.VERIFY = "verify", e.PENDING = "pending", e.VERIFIED = "verified", e.BANNED = "banned", e))(f || {}), p = /* @__PURE__ */ ((e) => (e.ASSET = "asset", e.DESTINATION = "destination", e.COUNTERPARTY = "counterparty", e.AGENT = "agent", e))(p || {}), h = /* @__PURE__ */ ((e) => (e.COMPLETE = "complete", e.RESIZE = "resize", e.RESULT = "result", e.READY = "ready", e.INVALID = "invalid", e.ERROR = "error", e.CANCEL = "cancel", e))(h || {}), d = /* @__PURE__ */ ((e) => (e.UPDATE = "update", e.REQUEST_RESPONSE = "requestResponse", e))(d || {}), v = /* @__PURE__ */ ((e) => (e.PENDING = "pending", e.FAILED = "rejected", e.FLAGGED = "flagged", e.VERIFIED = "verified", e))(v || {}), g = /* @__PURE__ */ ((e) => (e.SelfDeclaration = "self-declaration", e.SIWE = "siwe", e.SIWX = "siwx", e.EIP191 = "eip-191", e.EIP712 = "eip-712", e.EIP1271 = "eip-1271", e.BIP137 = "bip-137", e.BIP137_XPUB = "xpub", e.ED25519 = "ed25519", e.MicroTransfer = "microtransfer", e.Screenshot = "screenshot", e.Connect = "connect", e))(g || {});
|
|
5
|
+
class I {
|
|
6
6
|
constructor() {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
o(this, "listeners", /* @__PURE__ */ new Map());
|
|
8
|
+
o(this, "port");
|
|
9
9
|
this.handleMessage = this.handleMessage.bind(this);
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Sets up the message port for communication.
|
|
13
|
+
*
|
|
14
|
+
* Initializes the MessagePort for receiving messages by setting up the message handler
|
|
15
|
+
* and starting the port.
|
|
16
|
+
*
|
|
17
|
+
* @param port - The MessagePort instance to use for communication
|
|
18
|
+
*/
|
|
19
|
+
setPort(t) {
|
|
20
|
+
this.port = t, this.port.onmessage = this.handleMessage, this.port.start();
|
|
13
21
|
}
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Registers a callback for a specific message type.
|
|
24
|
+
*
|
|
25
|
+
* When messages of the specified type are received, the callback will be executed
|
|
26
|
+
* with the message data.
|
|
27
|
+
*
|
|
28
|
+
* @param messageType - The type of message to listen for
|
|
29
|
+
* @param callback - The callback function to execute when matching messages are received
|
|
30
|
+
|
|
31
|
+
*/
|
|
32
|
+
on(t, r) {
|
|
33
|
+
return this.listeners.has(t) || this.listeners.set(t, /* @__PURE__ */ new Set()), this.listeners.get(t).add(r), () => this.off(t, r);
|
|
16
34
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Removes a callback for a specific message type.
|
|
37
|
+
*
|
|
38
|
+
* If the callback is the last one registered for the message type,
|
|
39
|
+
* the message type entry will be removed entirely.
|
|
40
|
+
*
|
|
41
|
+
* @param messageType - The type of message to remove listener from
|
|
42
|
+
* @param callback - The callback function to remove
|
|
43
|
+
*/
|
|
44
|
+
off(t, r) {
|
|
45
|
+
const i = this.listeners.get(t);
|
|
46
|
+
i && (i.delete(r), i.size === 0 && this.listeners.delete(t));
|
|
20
47
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Internal message handler for processing received messages.
|
|
50
|
+
*
|
|
51
|
+
* Validates incoming messages and dispatches them to registered callbacks
|
|
52
|
+
* based on the message type.
|
|
53
|
+
*
|
|
54
|
+
* @param event - The message event containing the component message
|
|
55
|
+
*/
|
|
56
|
+
handleMessage(t) {
|
|
57
|
+
const r = t.data;
|
|
58
|
+
if (typeof r == "object" && r !== null && "type" in r) {
|
|
59
|
+
const i = r.type, s = this.listeners.get(i);
|
|
60
|
+
s && s.forEach((n) => n(r));
|
|
27
61
|
}
|
|
28
62
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Sends a message through the message port
|
|
65
|
+
* @param message The host message to send
|
|
66
|
+
*/
|
|
67
|
+
send(t) {
|
|
68
|
+
this.port && this.port.postMessage(t);
|
|
32
69
|
}
|
|
33
70
|
}
|
|
34
|
-
class
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this
|
|
71
|
+
class w {
|
|
72
|
+
/**
|
|
73
|
+
* Creates an instance of EmbeddedComponent.
|
|
74
|
+
* @param url - The URL of the embedded component
|
|
75
|
+
* @param value - The initial transaction value
|
|
76
|
+
*/
|
|
77
|
+
constructor(t, r, i) {
|
|
78
|
+
o(this, "_url");
|
|
79
|
+
o(this, "_value");
|
|
80
|
+
o(this, "_options");
|
|
81
|
+
o(this, "_errors", []);
|
|
82
|
+
o(this, "iframe");
|
|
83
|
+
o(this, "eventManager");
|
|
84
|
+
o(this, "modal");
|
|
85
|
+
this._url = t, this._value = r, this._options = i, this.eventManager = new I(), this.on(h.INVALID, (s) => {
|
|
45
86
|
s.type === h.INVALID && (this._errors = s.errors, this._value = s.value);
|
|
46
87
|
}), this.on(h.RESIZE, (s) => {
|
|
47
88
|
s.type === h.RESIZE && this.iframe && (this.iframe.style.height = `${s.height}px`);
|
|
48
89
|
});
|
|
49
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Gets the URL of the embedded component
|
|
93
|
+
* @returns The URL of the embedded component
|
|
94
|
+
*/
|
|
50
95
|
get url() {
|
|
51
96
|
return this._url;
|
|
52
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Gets the current transaction value
|
|
100
|
+
* @returns The current transaction value
|
|
101
|
+
*/
|
|
53
102
|
get value() {
|
|
54
103
|
return this._value;
|
|
55
104
|
}
|
|
105
|
+
get options() {
|
|
106
|
+
return this._options;
|
|
107
|
+
}
|
|
56
108
|
get errors() {
|
|
57
109
|
return this._errors;
|
|
58
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Opens the component URL in the current window
|
|
113
|
+
*/
|
|
59
114
|
open() {
|
|
60
115
|
document.location.href = this.url;
|
|
61
116
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Mounts the component to a parent element
|
|
119
|
+
* @param parentId - The ID of the parent element
|
|
120
|
+
* @throws Will throw an error if the parent element is not found
|
|
121
|
+
*/
|
|
122
|
+
mount(t) {
|
|
123
|
+
const r = document.querySelector(t);
|
|
124
|
+
if (!r) throw new Error(`parentID ${t} not found`);
|
|
125
|
+
this.embed(r);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Embeds the component into a parent element
|
|
129
|
+
* @param parent - The parent element to embed the component into
|
|
130
|
+
*/
|
|
131
|
+
embed(t, r = !1) {
|
|
132
|
+
var i, s;
|
|
133
|
+
this.removeEmbed(), this.iframe = document.createElement("iframe"), this.iframe.src = this.url + (r ? "" : "&embedded=true"), this.iframe.allow = "web-share", this.iframe.style.width = "100%", this.iframe.style.height = "100px", this.iframe.style.border = "none", this.iframe.style.overflow = "hidden", t.appendChild(this.iframe), window.addEventListener("message", (n) => {
|
|
134
|
+
var a, l;
|
|
135
|
+
n.source === ((a = this.iframe) == null ? void 0 : a.contentWindow) && ((l = this.eventManager) == null || l.setPort(n.ports[0]));
|
|
136
|
+
}), (s = (i = this.iframe) == null ? void 0 : i.contentWindow) == null || s.focus();
|
|
66
137
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
this.iframe = document.createElement("iframe"), this.iframe.src = this.url, this.iframe.style.width = "100%", this.iframe.style.height = "100px", this.iframe.style.border = "none", this.iframe.style.overflow = "hidden", this.iframe.setAttribute("allowtransparency", "true"), this.iframe.style.backgroundColor = "transparent", e.appendChild(this.iframe), window.addEventListener("message", (o) => {
|
|
70
|
-
var i, a;
|
|
71
|
-
o.source === ((i = this.iframe) == null ? void 0 : i.contentWindow) && (console.log("received message from iframe", o.data), (a = this.eventManager) == null || a.setPort(o.ports[0]), this.ready = !0);
|
|
72
|
-
}), (s = (t = this.iframe) == null ? void 0 : t.contentWindow) == null || s.focus();
|
|
138
|
+
removeEmbed() {
|
|
139
|
+
this.iframe && this.iframe.remove();
|
|
73
140
|
}
|
|
74
|
-
|
|
75
|
-
|
|
141
|
+
/**
|
|
142
|
+
* Sends a message to the embedded component
|
|
143
|
+
* @param message - The message to send
|
|
144
|
+
*/
|
|
145
|
+
send(t) {
|
|
146
|
+
this.eventManager.send(t);
|
|
76
147
|
}
|
|
77
|
-
|
|
78
|
-
|
|
148
|
+
/**
|
|
149
|
+
* Adds an event listener for a specific message type
|
|
150
|
+
* @param messageType - The type of message to listen for
|
|
151
|
+
* @param callback - The callback function to execute when the message is received
|
|
152
|
+
*/
|
|
153
|
+
on(t, r) {
|
|
154
|
+
return this.eventManager.on(t, r);
|
|
79
155
|
}
|
|
80
|
-
|
|
81
|
-
|
|
156
|
+
/**
|
|
157
|
+
* Removes an event listener for a specific message type
|
|
158
|
+
* @param messageType - The type of message to stop listening for
|
|
159
|
+
* @param callback - The callback function to remove
|
|
160
|
+
*/
|
|
161
|
+
off(t, r) {
|
|
162
|
+
this.eventManager.off(t, r);
|
|
82
163
|
}
|
|
83
|
-
|
|
84
|
-
|
|
164
|
+
/**
|
|
165
|
+
* Updates the transaction value and sends an update message to the component
|
|
166
|
+
* @param value - The new transaction value
|
|
167
|
+
*/
|
|
168
|
+
update(t, r) {
|
|
169
|
+
this._value = t, r && (this._options = r), this.send({ type: d.UPDATE, value: t, options: this._options });
|
|
85
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Waits for the component to complete and returns the transaction response
|
|
173
|
+
* @returns A promise that resolves with the transaction response
|
|
174
|
+
*/
|
|
86
175
|
completion() {
|
|
87
|
-
return new Promise((
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
176
|
+
return new Promise((t, r) => {
|
|
177
|
+
let i, s;
|
|
178
|
+
function n() {
|
|
179
|
+
i && i(), s && s();
|
|
180
|
+
}
|
|
181
|
+
i = this.on(h.COMPLETE, (a) => {
|
|
182
|
+
t(a.response), n();
|
|
183
|
+
}), s = this.on("error", (a) => {
|
|
184
|
+
r(new Error(a.message)), n();
|
|
92
185
|
});
|
|
93
186
|
});
|
|
94
187
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
// }
|
|
188
|
+
/**
|
|
189
|
+
* Opens the component in a modal dialog
|
|
190
|
+
*/
|
|
99
191
|
openModal() {
|
|
100
|
-
this.modal && this.closeModal(), this.modal = document.createElement("dialog"), document.body.appendChild(this.modal), this.embed(this.modal
|
|
192
|
+
return this.modal && this.closeModal(), this.modal = document.createElement("dialog"), this.modal.style.border = "none", this.modal.style.backgroundColor = "white", this.modal.style.maxWidth = "100vw", this.modal.style.maxHeight = "100vh", this.modal.style.width = "600px", this.modal.style.height = "600px", document.body.appendChild(this.modal), this.embed(this.modal, !0), this.on(h.CANCEL, () => {
|
|
101
193
|
this.closeModal();
|
|
102
|
-
})
|
|
194
|
+
}), this.on(h.COMPLETE, () => {
|
|
195
|
+
this.closeModal();
|
|
196
|
+
}), this.modal.showModal(), this.modal.addEventListener("click", () => {
|
|
197
|
+
this.closeModal();
|
|
198
|
+
}), this.completion();
|
|
103
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Closes the modal dialog
|
|
202
|
+
*
|
|
203
|
+
*/
|
|
104
204
|
closeModal() {
|
|
105
|
-
var
|
|
106
|
-
this.modal && (
|
|
205
|
+
var t;
|
|
206
|
+
this.modal && ((t = this.modal) == null || t.close(), this.modal.remove(), this.modal = void 0);
|
|
107
207
|
}
|
|
108
208
|
}
|
|
109
|
-
function
|
|
110
|
-
return Object.entries(
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
typeof
|
|
209
|
+
function U(e) {
|
|
210
|
+
return Object.entries(e).map(([t, r]) => {
|
|
211
|
+
if (r == null) return;
|
|
212
|
+
const i = encodeURIComponent(t), s = encodeURIComponent(
|
|
213
|
+
typeof r == "object" ? JSON.stringify(r) : String(r)
|
|
214
|
+
// Use String() to handle all primitive types
|
|
114
215
|
);
|
|
115
|
-
return `${
|
|
116
|
-
}).filter((
|
|
216
|
+
return `${i}=${s}`;
|
|
217
|
+
}).filter((t) => t !== void 0).join("&");
|
|
218
|
+
}
|
|
219
|
+
function b(e) {
|
|
220
|
+
const t = e.slice(1);
|
|
221
|
+
return t ? t.split("&").filter(Boolean).reduce(
|
|
222
|
+
(i, s) => {
|
|
223
|
+
const [n, a] = s.split("=");
|
|
224
|
+
return n && (i[decodeURIComponent(n)] = a ? decodeURIComponent(a) : ""), i;
|
|
225
|
+
},
|
|
226
|
+
{}
|
|
227
|
+
) : {};
|
|
117
228
|
}
|
|
118
|
-
class
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
this
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
229
|
+
class A {
|
|
230
|
+
/**
|
|
231
|
+
* Creates a new instance of the Notabene SDK
|
|
232
|
+
*
|
|
233
|
+
* @param config - Configuration options for the Notabene SDK
|
|
234
|
+
*/
|
|
235
|
+
constructor(t) {
|
|
236
|
+
o(this, "nodeUrl");
|
|
237
|
+
o(this, "authToken");
|
|
238
|
+
o(this, "uxUrl");
|
|
239
|
+
o(this, "theme");
|
|
240
|
+
o(this, "locale");
|
|
241
|
+
this.uxUrl = t.uxUrl || "https://connect.notabene.id", this.nodeUrl = t.nodeUrl, this.authToken = t.authToken, this.theme = t.theme, this.locale = t.locale;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Generates a URL for a Notabene component
|
|
245
|
+
*
|
|
246
|
+
* @param path - The path of the component
|
|
247
|
+
* @param value - Transaction data
|
|
248
|
+
* @param configuration - Optional transaction configuration
|
|
249
|
+
* @param callbacks - Optional callback configuration
|
|
250
|
+
* @returns component URL
|
|
251
|
+
* @internal
|
|
252
|
+
*/
|
|
253
|
+
componentUrl(t, r, i, s) {
|
|
254
|
+
const n = new URL(this.uxUrl);
|
|
255
|
+
n.pathname = t;
|
|
256
|
+
const a = U({
|
|
131
257
|
authToken: this.authToken,
|
|
132
|
-
value:
|
|
133
|
-
configuration:
|
|
258
|
+
value: r,
|
|
259
|
+
configuration: i
|
|
134
260
|
});
|
|
135
|
-
return
|
|
261
|
+
return n.hash = a, this.nodeUrl && n.searchParams.set("nodeUrl", this.nodeUrl), this.theme && n.searchParams.set("theme", JSON.stringify(this.theme)), this.locale && n.searchParams.set("locale", this.locale), s && (s.callback && n.searchParams.set("callback_url", s.callback), s.redirectUri && n.searchParams.set("redirect_uri", s.redirectUri)), n.toString();
|
|
136
262
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
263
|
+
/**
|
|
264
|
+
* Creates a new embedded component
|
|
265
|
+
*
|
|
266
|
+
* @param path - The path of the component
|
|
267
|
+
* @param value - Transaction data
|
|
268
|
+
* @param options - Optional transaction options
|
|
269
|
+
* @param callbacks - Optional callback configuration
|
|
270
|
+
* @returns A new EmbeddedComponent instance
|
|
271
|
+
* @internal
|
|
272
|
+
*/
|
|
273
|
+
createComponent(t, r, i, s) {
|
|
274
|
+
return new w(
|
|
275
|
+
this.componentUrl(t, r, i, s),
|
|
276
|
+
r,
|
|
277
|
+
i
|
|
141
278
|
);
|
|
142
279
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
280
|
+
/**
|
|
281
|
+
* Creates a withdrawal assist component
|
|
282
|
+
*
|
|
283
|
+
* @param value - Withdrawal transaction data
|
|
284
|
+
* @param options - Optional transaction options
|
|
285
|
+
* @param callbacks - Optional callback configuration
|
|
286
|
+
* @returns A new EmbeddedComponent instance for withdrawal assistance
|
|
287
|
+
*/
|
|
288
|
+
createWithdrawalAssist(t, r, i) {
|
|
289
|
+
return this.createComponent(
|
|
290
|
+
"withdrawal-assist",
|
|
291
|
+
t,
|
|
292
|
+
r,
|
|
293
|
+
i
|
|
294
|
+
);
|
|
151
295
|
}
|
|
152
|
-
|
|
153
|
-
|
|
296
|
+
/**
|
|
297
|
+
* Creates a connect component
|
|
298
|
+
*
|
|
299
|
+
* @param value - Connection request data
|
|
300
|
+
* @param options - Optional transaction options
|
|
301
|
+
* @param callbacks - Optional callback configuration
|
|
302
|
+
* @returns A new EmbeddedComponent instance for connection
|
|
303
|
+
* @alpha
|
|
304
|
+
*/
|
|
305
|
+
createConnectWallet(t, r, i) {
|
|
306
|
+
return this.createComponent(
|
|
307
|
+
"connect",
|
|
308
|
+
t,
|
|
309
|
+
r,
|
|
310
|
+
i
|
|
311
|
+
);
|
|
154
312
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
313
|
+
/**
|
|
314
|
+
* Creates a deposit request component
|
|
315
|
+
*
|
|
316
|
+
* @param value - Deposit request data
|
|
317
|
+
* @param options - Optional transaction options
|
|
318
|
+
* @param callbacks - Optional callback configuration
|
|
319
|
+
* @returns A new EmbeddedComponent instance for deposit requests
|
|
320
|
+
* @public
|
|
321
|
+
*/
|
|
322
|
+
createDepositRequest(t, r, i) {
|
|
323
|
+
return this.createComponent(
|
|
324
|
+
"deposit-request",
|
|
325
|
+
t,
|
|
326
|
+
r,
|
|
327
|
+
i
|
|
162
328
|
);
|
|
163
329
|
}
|
|
164
330
|
}
|
|
165
331
|
export {
|
|
166
|
-
|
|
332
|
+
u as AgentType,
|
|
333
|
+
h as CMType,
|
|
334
|
+
w as EmbeddedComponent,
|
|
335
|
+
d as HMType,
|
|
336
|
+
E as PersonType,
|
|
337
|
+
v as ProofStatus,
|
|
338
|
+
g as ProofTypes,
|
|
339
|
+
f as Status,
|
|
340
|
+
p as ValidationSections,
|
|
341
|
+
b as decodeFragmentToObject,
|
|
342
|
+
A as default
|
|
167
343
|
};
|
package/package.json
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
},
|
|
10
10
|
"author": "Notabene <developers@notabene.id>",
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"
|
|
12
|
+
"packageManager": "yarn@3.2.2",
|
|
13
|
+
"version": "2.0.1",
|
|
13
14
|
"source": "src/notabene.ts",
|
|
14
15
|
"main": "dist/notabene.js",
|
|
15
16
|
"types": "dist/notabene.d.ts",
|
|
@@ -21,44 +22,52 @@
|
|
|
21
22
|
"README.md"
|
|
22
23
|
],
|
|
23
24
|
"scripts": {
|
|
24
|
-
"
|
|
25
|
+
"docs": "typedoc --options typedoc.json",
|
|
26
|
+
"prepare": "husky",
|
|
25
27
|
"dev": "vite",
|
|
26
28
|
"preview": "vite preview",
|
|
27
29
|
"watch": "parcel watch",
|
|
28
30
|
"build:dev": "yarn build && yarn dev",
|
|
29
|
-
"build:clean": "rimraf dist/ ts-out",
|
|
30
|
-
"build": "vite build &&
|
|
31
|
+
"build:clean": "rimraf dist/ ts-out coverage temp etc",
|
|
32
|
+
"build": "yarn lint && vite build && yarn typecheck && yarn docs",
|
|
31
33
|
"lint": "eslint .",
|
|
34
|
+
"format": "prettier --write .",
|
|
32
35
|
"test": "vitest",
|
|
36
|
+
"typecheck": "tsc --noEmit",
|
|
37
|
+
"coverage": "vitest run --coverage --coverage.extension=.ts",
|
|
33
38
|
"release": "semantic-release",
|
|
34
|
-
"publish": "yarn build && npm publish
|
|
39
|
+
"publish": "yarn build && npm publish"
|
|
35
40
|
},
|
|
36
41
|
"devDependencies": {
|
|
37
|
-
"@commitlint/cli": "^19.
|
|
38
|
-
"@commitlint/config-conventional": "^19.
|
|
39
|
-
"@eslint/js": "^9.
|
|
40
|
-
"@fast-check/vitest": "^0.1.
|
|
41
|
-
"@microsoft/api-extractor": "^7.47.
|
|
42
|
+
"@commitlint/cli": "^19.5.0",
|
|
43
|
+
"@commitlint/config-conventional": "^19.5.0",
|
|
44
|
+
"@eslint/js": "^9.13.0",
|
|
45
|
+
"@fast-check/vitest": "^0.1.4",
|
|
46
|
+
"@microsoft/api-extractor": "^7.47.11",
|
|
42
47
|
"@semantic-release/git": "^10.0.1",
|
|
43
|
-
"@semantic-release/gitlab": "^
|
|
44
|
-
"@semantic-release/npm": "^
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
46
|
-
"@typescript-eslint/parser": "^8.
|
|
47
|
-
"
|
|
48
|
+
"@semantic-release/gitlab": "^13.2.1",
|
|
49
|
+
"@semantic-release/npm": "^12.0.1",
|
|
50
|
+
"@typescript-eslint/eslint-plugin": "^8.11.0",
|
|
51
|
+
"@typescript-eslint/parser": "^8.11.0",
|
|
52
|
+
"@vitest/coverage-v8": "2.1.3",
|
|
53
|
+
"eslint": "^9.14.0",
|
|
48
54
|
"eslint-config-prettier": "^9.1.0",
|
|
49
55
|
"eslint-plugin-prettier": "^5.2.1",
|
|
50
|
-
"fast-check": "^3.
|
|
51
|
-
"globals": "^15.
|
|
52
|
-
"husky": "^
|
|
53
|
-
"
|
|
54
|
-
"
|
|
56
|
+
"fast-check": "^3.23.1",
|
|
57
|
+
"globals": "^15.11.0",
|
|
58
|
+
"husky": "^9.1.6",
|
|
59
|
+
"jsdom": "^25.0.1",
|
|
60
|
+
"lint-staged": "^15.2.10",
|
|
61
|
+
"organize-imports-cli": "^0.10.0",
|
|
55
62
|
"prettier": "^3.3.3",
|
|
56
63
|
"rimraf": "^6.0.1",
|
|
57
|
-
"semantic-release": "^24.
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
64
|
+
"semantic-release": "^24.2.0",
|
|
65
|
+
"typedoc": "^0.26.11",
|
|
66
|
+
"typedoc-plugin-markdown": "^4.2.10",
|
|
67
|
+
"typescript": "^5.6.3",
|
|
68
|
+
"typescript-eslint": "^8.12.2",
|
|
69
|
+
"vite": "^5.4.10",
|
|
70
|
+
"vitest": "^2.1.3"
|
|
62
71
|
},
|
|
63
72
|
"lint-staged": {
|
|
64
73
|
"*.ts": [
|