create-mikstack 0.1.7 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-mikstack",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,7 +19,7 @@
19
19
  "zero:start": "zero-cache-dev"
20
20
  },
21
21
  "dependencies": {
22
- "@mikstack/email": "^0.1.0",
22
+ "@mikstack/email": "^0.1.1",
23
23
  "@mikstack/form": "^0.1.0",
24
24
  "@mikstack/notifications": "^0.1.1",
25
25
  "@rocicorp/zero": "^0.25.12",
@@ -5,7 +5,7 @@ export const user = pgTable("user", {
5
5
  id: text("id").primaryKey(),
6
6
  name: text("name").notNull(),
7
7
  email: text("email").notNull().unique(),
8
- emailVerified: timestamp("email_verified"),
8
+ emailVerified: boolean("email_verified").notNull().default(false),
9
9
  image: text("image"),
10
10
  createdAt: timestamp("created_at").notNull().defaultNow(),
11
11
  updatedAt: timestamp("updated_at").notNull().defaultNow(),
@@ -47,8 +47,8 @@ export const verification = pgTable("verification", {
47
47
  identifier: text("identifier").notNull(),
48
48
  value: text("value").notNull(),
49
49
  expiresAt: timestamp("expires_at").notNull(),
50
- createdAt: timestamp("created_at"),
51
- updatedAt: timestamp("updated_at"),
50
+ createdAt: timestamp("created_at").notNull().defaultNow(),
51
+ updatedAt: timestamp("updated_at").notNull().defaultNow(),
52
52
  });
53
53
 
54
54
  // Notification tables (managed by @mikstack/notifications)
@@ -15,10 +15,19 @@ export const GET: RequestHandler = async ({ params }) => {
15
15
 
16
16
  if (!delivery?.content) error(404);
17
17
 
18
- const content = delivery.content as { html?: string };
18
+ const content = delivery.content as { html?: string; subject?: string };
19
19
  if (!content.html) error(404, "No HTML content for this delivery");
20
20
 
21
- return new Response(content.html, {
21
+ const escaped = content.html.replaceAll("&", "&").replaceAll('"', """);
22
+ const title = content.subject ? `<title>${content.subject}</title>` : "";
23
+
24
+ const wrapper = `<!DOCTYPE html>
25
+ <html>
26
+ <head><meta charset="utf-8">${title}<style>*{margin:0;padding:0}html,body{height:100%}iframe{width:100%;height:100%;border:none}</style></head>
27
+ <body><iframe srcdoc="${escaped}"></iframe></body>
28
+ </html>`;
29
+
30
+ return new Response(wrapper, {
22
31
  headers: { "content-type": "text/html; charset=utf-8" },
23
32
  });
24
33
  };