@lovable.dev/email-js 0.1.1-rc.6 → 0.1.1-rc.8
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/dist/index.cjs +313 -220
- package/dist/index.d.cts +112 -116
- package/dist/index.d.ts +112 -116
- package/dist/index.js +275 -218
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,251 +1,308 @@
|
|
|
1
|
-
|
|
1
|
+
// src/auth-email-handler.ts
|
|
2
|
+
import { WebhookError as WebhookError2, verifyWebhookRequest as verifyWebhookRequest2 } from "@lovable.dev/webhooks-js";
|
|
3
|
+
|
|
4
|
+
// src/http.ts
|
|
5
|
+
var DEFAULT_AUTH_HEADER = "Authorization";
|
|
6
|
+
var DEFAULT_API_BASE_URL = "https://api.lovable.dev";
|
|
2
7
|
function resolveApiBaseUrl(apiBaseUrl) {
|
|
3
|
-
|
|
8
|
+
return (apiBaseUrl ?? DEFAULT_API_BASE_URL).replace(/\/$/, "");
|
|
4
9
|
}
|
|
5
10
|
var EmailAPIError = class extends Error {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
constructor(status, message, retryAfterSeconds, code = null) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = "EmailAPIError";
|
|
14
|
+
this.status = status;
|
|
15
|
+
this.retryAfterSeconds = retryAfterSeconds;
|
|
16
|
+
this.code = code;
|
|
17
|
+
}
|
|
18
|
+
get retryable() {
|
|
19
|
+
return this.status === 429 || this.status >= 500 && this.status < 600;
|
|
20
|
+
}
|
|
16
21
|
};
|
|
17
22
|
function parseRetryAfter(header) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
if (!header)
|
|
24
|
+
return null;
|
|
25
|
+
const parsed = Number(header);
|
|
26
|
+
if (!Number.isNaN(parsed))
|
|
27
|
+
return parsed;
|
|
28
|
+
const date = new Date(header);
|
|
29
|
+
if (!Number.isNaN(date.getTime())) {
|
|
30
|
+
return Math.max(0, Math.ceil((date.getTime() - Date.now()) / 1e3));
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
24
33
|
}
|
|
25
34
|
function buildAuthHeaderValue(apiKey) {
|
|
26
|
-
|
|
35
|
+
return `Bearer ${apiKey}`;
|
|
27
36
|
}
|
|
28
37
|
function parseErrorCode(body) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
try {
|
|
39
|
+
const parsed = JSON.parse(body);
|
|
40
|
+
if (parsed && typeof parsed === "object" && "type" in parsed && typeof parsed.type === "string") {
|
|
41
|
+
return parsed.type;
|
|
42
|
+
}
|
|
43
|
+
} catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
36
47
|
}
|
|
37
48
|
async function throwIfNotOk(response) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
if (response.ok)
|
|
50
|
+
return;
|
|
51
|
+
const errorText = await response.text();
|
|
52
|
+
const safeErrorText = errorText.length > 500 ? `${errorText.slice(0, 500)}...` : errorText;
|
|
53
|
+
const retryAfterSeconds = parseRetryAfter(response.headers.get("Retry-After"));
|
|
54
|
+
const code = parseErrorCode(errorText);
|
|
55
|
+
if (response.status === 429) {
|
|
56
|
+
console.error("[email-js] rate limited:", { status: response.status, code, retryAfterSeconds });
|
|
57
|
+
}
|
|
58
|
+
throw new EmailAPIError(
|
|
59
|
+
response.status,
|
|
60
|
+
`Email API error: ${response.status} ${safeErrorText}`,
|
|
61
|
+
retryAfterSeconds,
|
|
62
|
+
code
|
|
63
|
+
);
|
|
49
64
|
}
|
|
50
65
|
async function emailApiRequest(options, path, init = { method: "GET" }) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
if (!options.apiKey) {
|
|
67
|
+
throw new Error("Missing Lovable API key");
|
|
68
|
+
}
|
|
69
|
+
const headers = {
|
|
70
|
+
[options.authHeader ?? DEFAULT_AUTH_HEADER]: buildAuthHeaderValue(options.apiKey)
|
|
71
|
+
};
|
|
72
|
+
if (init.body !== void 0) {
|
|
73
|
+
headers["Content-Type"] = "application/json";
|
|
74
|
+
}
|
|
75
|
+
const response = await fetch(`${resolveApiBaseUrl(options.apiBaseUrl)}${path}`, {
|
|
76
|
+
method: init.method,
|
|
77
|
+
headers,
|
|
78
|
+
body: init.body === void 0 ? void 0 : JSON.stringify(init.body)
|
|
79
|
+
});
|
|
80
|
+
await throwIfNotOk(response);
|
|
81
|
+
return await response.json();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// src/email.ts
|
|
85
|
+
var DEFAULT_SEND_PATH = "/v1/messaging/email/send";
|
|
65
86
|
async function sendLovableEmail(payload, options) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
const apiKey = options.apiKey;
|
|
88
|
+
if (!apiKey) {
|
|
89
|
+
throw new Error("Missing Lovable API key");
|
|
90
|
+
}
|
|
91
|
+
const authHeader = options.authHeader ?? DEFAULT_AUTH_HEADER;
|
|
92
|
+
const sendUrl = options.sendUrl;
|
|
93
|
+
const url = sendUrl || `${resolveApiBaseUrl(options.apiBaseUrl)}${DEFAULT_SEND_PATH}`;
|
|
94
|
+
const idempotencyKey = options.idempotencyKey ?? payload.idempotency_key ?? payload.run_id;
|
|
95
|
+
const headers = {
|
|
96
|
+
[authHeader]: buildAuthHeaderValue(apiKey),
|
|
97
|
+
"Content-Type": "application/json"
|
|
98
|
+
};
|
|
99
|
+
if (idempotencyKey) {
|
|
100
|
+
headers["Idempotency-Key"] = idempotencyKey;
|
|
101
|
+
}
|
|
102
|
+
const response = await fetch(url, {
|
|
103
|
+
method: "POST",
|
|
104
|
+
headers,
|
|
105
|
+
body: JSON.stringify(payload)
|
|
106
|
+
});
|
|
107
|
+
await throwIfNotOk(response);
|
|
108
|
+
return await response.json();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// src/webhook-handler.ts
|
|
112
|
+
import { WebhookError, verifyWebhookRequest } from "@lovable.dev/webhooks-js";
|
|
113
|
+
|
|
114
|
+
// src/webhook.ts
|
|
86
115
|
function parseEmailWebhookPayload(body) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
116
|
+
const parsed = JSON.parse(body);
|
|
117
|
+
if (!parsed || typeof parsed !== "object") {
|
|
118
|
+
throw new Error("Invalid email webhook payload: missing version or type");
|
|
119
|
+
}
|
|
120
|
+
const payload = parsed;
|
|
121
|
+
if (typeof payload.version !== "string" || typeof payload.type !== "string") {
|
|
122
|
+
throw new Error("Invalid email webhook payload: missing version or type");
|
|
123
|
+
}
|
|
124
|
+
return payload;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// src/webhook-handler.ts
|
|
128
|
+
var WEBHOOK_ERROR_STATUS = {
|
|
129
|
+
missing_secret: 401,
|
|
130
|
+
missing_timestamp: 401,
|
|
131
|
+
invalid_timestamp: 401,
|
|
132
|
+
stale_timestamp: 401,
|
|
133
|
+
invalid_signature: 401,
|
|
134
|
+
body_too_large: 400,
|
|
135
|
+
invalid_json: 400,
|
|
136
|
+
invalid_payload: 400
|
|
104
137
|
};
|
|
105
138
|
function parseEmailWebhookEvent(body) {
|
|
106
|
-
|
|
139
|
+
return parseEmailWebhookPayload(body);
|
|
107
140
|
}
|
|
108
141
|
function createEmailWebhookHandler(options) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
const { apiKey, on } = options;
|
|
143
|
+
if (!apiKey) {
|
|
144
|
+
throw new Error("Missing Lovable API key");
|
|
145
|
+
}
|
|
146
|
+
return async (req) => {
|
|
147
|
+
if (req.method !== "POST") {
|
|
148
|
+
return Response.json({ error: "Method not allowed" }, { status: 405, headers: { Allow: "POST" } });
|
|
149
|
+
}
|
|
150
|
+
let event;
|
|
151
|
+
try {
|
|
152
|
+
({ payload: event } = await verifyWebhookRequest({ req, secret: apiKey, parser: parseEmailWebhookEvent }));
|
|
153
|
+
} catch (error) {
|
|
154
|
+
if (error instanceof WebhookError) {
|
|
155
|
+
return Response.json({ error: error.message }, { status: WEBHOOK_ERROR_STATUS[error.code] });
|
|
156
|
+
}
|
|
157
|
+
console.error("[email-js] webhook verification failed:", error);
|
|
158
|
+
return Response.json({ error: "Webhook verification failed" }, { status: 500 });
|
|
159
|
+
}
|
|
160
|
+
if (event.version !== "1") {
|
|
161
|
+
return Response.json({ received: true });
|
|
162
|
+
}
|
|
163
|
+
const handler = on[event.type];
|
|
164
|
+
if (handler) {
|
|
165
|
+
try {
|
|
166
|
+
await handler(event);
|
|
167
|
+
} catch (error) {
|
|
168
|
+
console.error("[email-js] webhook handler failed:", error);
|
|
169
|
+
return Response.json({ error: "Handler failed" }, { status: 500 });
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return Response.json({ received: true });
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// src/auth-email-handler.ts
|
|
141
177
|
function parseAuthEmailWebhookPayload(body) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
178
|
+
const parsed = JSON.parse(body);
|
|
179
|
+
const payload = parsed;
|
|
180
|
+
if (!parsed || typeof parsed !== "object" || typeof payload.version !== "string" || payload.type !== "auth" || !payload.data || typeof payload.data !== "object" || typeof payload.data.action_type !== "string" || typeof payload.data.email !== "string") {
|
|
181
|
+
throw new Error("Invalid auth email webhook payload");
|
|
182
|
+
}
|
|
183
|
+
return payload;
|
|
146
184
|
}
|
|
147
185
|
function domainOfAddress(from) {
|
|
148
|
-
|
|
186
|
+
const match = /@([^@\s<>]+)>?\s*$/.exec(from.trim());
|
|
187
|
+
return match?.[1];
|
|
149
188
|
}
|
|
150
189
|
function createAuthEmailHandler(options) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
190
|
+
const { apiKey, from, emails } = options;
|
|
191
|
+
if (!apiKey) {
|
|
192
|
+
throw new Error("Missing Lovable API key");
|
|
193
|
+
}
|
|
194
|
+
const senderDomain = options.senderDomain ?? domainOfAddress(from);
|
|
195
|
+
if (!senderDomain) {
|
|
196
|
+
throw new Error(`Cannot derive a sender domain from "${from}"; pass senderDomain`);
|
|
197
|
+
}
|
|
198
|
+
return async (req) => {
|
|
199
|
+
if (req.method !== "POST") {
|
|
200
|
+
return Response.json({ error: "Method not allowed" }, { status: 405, headers: { Allow: "POST" } });
|
|
201
|
+
}
|
|
202
|
+
let event;
|
|
203
|
+
try {
|
|
204
|
+
({ payload: event } = await verifyWebhookRequest2({ req, secret: apiKey, parser: parseAuthEmailWebhookPayload }));
|
|
205
|
+
} catch (error) {
|
|
206
|
+
if (error instanceof WebhookError2) {
|
|
207
|
+
return Response.json({ error: error.message }, { status: WEBHOOK_ERROR_STATUS[error.code] });
|
|
208
|
+
}
|
|
209
|
+
console.error("[email-js] auth webhook verification failed:", error);
|
|
210
|
+
return Response.json({ error: "Webhook verification failed" }, { status: 500 });
|
|
211
|
+
}
|
|
212
|
+
if (!event.run_id) {
|
|
213
|
+
return Response.json({ error: "Missing run_id" }, { status: 400 });
|
|
214
|
+
}
|
|
215
|
+
if (event.version !== "1") {
|
|
216
|
+
return Response.json({ error: `Unsupported payload version: ${event.version}` }, { status: 400 });
|
|
217
|
+
}
|
|
218
|
+
const actionType = event.data.action_type;
|
|
219
|
+
const definition = Object.prototype.hasOwnProperty.call(emails, actionType) ? emails[actionType] : void 0;
|
|
220
|
+
if (!definition) {
|
|
221
|
+
return Response.json({ error: `Unknown auth email action type: ${actionType}` }, { status: 400 });
|
|
222
|
+
}
|
|
223
|
+
try {
|
|
224
|
+
const { render } = await import("@react-email/render");
|
|
225
|
+
const { subject, element } = typeof definition === "function" ? await definition(event.data) : { subject: definition.subject, element: await definition.render(event.data) };
|
|
226
|
+
const html = await render(element);
|
|
227
|
+
const text = await render(element, { plainText: true });
|
|
228
|
+
await sendLovableEmail(
|
|
229
|
+
{
|
|
230
|
+
run_id: event.run_id,
|
|
231
|
+
to: event.data.email,
|
|
232
|
+
from,
|
|
233
|
+
sender_domain: senderDomain,
|
|
234
|
+
subject,
|
|
235
|
+
html,
|
|
236
|
+
text,
|
|
237
|
+
purpose: "transactional",
|
|
238
|
+
label: actionType
|
|
239
|
+
},
|
|
240
|
+
{ apiKey, sendUrl: options.sendUrl }
|
|
241
|
+
);
|
|
242
|
+
} catch (error) {
|
|
243
|
+
console.error("[email-js] auth email send failed:", error);
|
|
244
|
+
if (error instanceof EmailAPIError && !error.retryable) {
|
|
245
|
+
return Response.json({ error: "Email send rejected" }, { status: 400 });
|
|
246
|
+
}
|
|
247
|
+
return Response.json({ error: "Failed to send email" }, { status: 500 });
|
|
248
|
+
}
|
|
249
|
+
return Response.json({ success: true, sent: true });
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// src/logs.ts
|
|
254
|
+
var LOGS_PATH = "/v1/messaging/email/logs";
|
|
213
255
|
function buildLogsQuery(filters) {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
256
|
+
const params = new URLSearchParams();
|
|
257
|
+
if (filters.recipient)
|
|
258
|
+
params.set("recipient", filters.recipient);
|
|
259
|
+
if (filters.event_type)
|
|
260
|
+
params.set("event_type", filters.event_type);
|
|
261
|
+
if (filters.status)
|
|
262
|
+
params.set("status", filters.status);
|
|
263
|
+
if (filters.tag)
|
|
264
|
+
params.set("tag", filters.tag);
|
|
265
|
+
if (filters.since)
|
|
266
|
+
params.set("since", filters.since);
|
|
267
|
+
if (filters.until)
|
|
268
|
+
params.set("until", filters.until);
|
|
269
|
+
if (filters.limit !== void 0)
|
|
270
|
+
params.set("limit", String(filters.limit));
|
|
271
|
+
if (filters.cursor)
|
|
272
|
+
params.set("cursor", filters.cursor);
|
|
273
|
+
const query = params.toString();
|
|
274
|
+
return query ? `?${query}` : "";
|
|
225
275
|
}
|
|
226
276
|
async function listEmailLogs(filters, options) {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
//#endregion
|
|
234
|
-
//#region src/unsubscribe.ts
|
|
235
|
-
const UNSUBSCRIBES_PATH = "/v1/messaging/email/unsubscribes";
|
|
277
|
+
const body = await emailApiRequest(options, `${LOGS_PATH}${buildLogsQuery(filters)}`);
|
|
278
|
+
return { ...body, data: body.data ?? [] };
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// src/unsubscribe.ts
|
|
282
|
+
var UNSUBSCRIBES_PATH = "/v1/messaging/email/unsubscribes";
|
|
236
283
|
function buildUnsubscribePath(recipient, domain) {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
284
|
+
if (!recipient.includes("@")) {
|
|
285
|
+
throw new Error("Invalid recipient");
|
|
286
|
+
}
|
|
287
|
+
const query = new URLSearchParams({ domain }).toString();
|
|
288
|
+
return `${UNSUBSCRIBES_PATH}/${encodeURIComponent(recipient)}?${query}`;
|
|
240
289
|
}
|
|
241
290
|
async function getEmailUnsubscribe(request, options) {
|
|
242
|
-
|
|
291
|
+
return emailApiRequest(options, buildUnsubscribePath(request.recipient, request.domain));
|
|
243
292
|
}
|
|
244
293
|
async function setEmailUnsubscribe(request, options) {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
294
|
+
return emailApiRequest(options, buildUnsubscribePath(request.recipient, request.domain), {
|
|
295
|
+
method: "PUT",
|
|
296
|
+
body: { subscribed: request.subscribed }
|
|
297
|
+
});
|
|
249
298
|
}
|
|
250
|
-
|
|
251
|
-
|
|
299
|
+
export {
|
|
300
|
+
EmailAPIError,
|
|
301
|
+
createAuthEmailHandler,
|
|
302
|
+
createEmailWebhookHandler,
|
|
303
|
+
getEmailUnsubscribe,
|
|
304
|
+
listEmailLogs,
|
|
305
|
+
parseEmailWebhookPayload,
|
|
306
|
+
sendLovableEmail,
|
|
307
|
+
setEmailUnsubscribe
|
|
308
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovable.dev/email-js",
|
|
3
|
-
"version": "0.1.1-rc.
|
|
3
|
+
"version": "0.1.1-rc.8",
|
|
4
4
|
"description": "Lovable Email JS",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
"react": "^19.0.0",
|
|
47
47
|
"react-dom": "^19.0.0",
|
|
48
48
|
"rimraf": "^5.0.0",
|
|
49
|
-
"
|
|
49
|
+
"tsup": "^7.2.0",
|
|
50
50
|
"typescript": "^5",
|
|
51
51
|
"vitest": "^4.1.5",
|
|
52
52
|
"@lovable/api-utils": "1.0.0"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
|
-
"build": "
|
|
55
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --outDir dist",
|
|
56
56
|
"check:package": "tmp=$(mktemp -d) && pnpm pack --out \"$tmp/pkg.tgz\" && tar -xzf \"$tmp/pkg.tgz\" -C \"$tmp\" && publint \"$tmp/package\" --strict && attw \"$tmp/pkg.tgz\"",
|
|
57
|
-
"dev": "
|
|
57
|
+
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
58
58
|
"test": "vitest run",
|
|
59
59
|
"clean": "rimraf dist",
|
|
60
60
|
"typecheck": "tsgo --noEmit"
|