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