create-mikstack 0.1.8 → 0.1.10
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 +1 -1
- package/templates/base/package.json.partial +3 -2
- package/templates/base/src/lib/server/emails/magic-link.ts +27 -45
- package/templates/base/src/routes/+layout.ts +1 -0
- package/templates/base/src/routes/api/dev/emails/[id]/+server.ts +1 -1
- package/templates/i18n/vite.config.ts +2 -1
- package/templates/ui/vite.config.ts +2 -1
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"zero:start": "zero-cache-dev"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@mikstack/email": "^0.1.
|
|
22
|
+
"@mikstack/email": "^0.1.2",
|
|
23
23
|
"@mikstack/form": "^0.1.0",
|
|
24
24
|
"@mikstack/notifications": "^0.1.1",
|
|
25
25
|
"@rocicorp/zero": "^0.25.12",
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
"globals": "^17.3.0",
|
|
44
44
|
"prettier": "^3.8.1",
|
|
45
45
|
"prettier-plugin-svelte": "^3.4.1",
|
|
46
|
-
"typescript-eslint": "^8.54.0"
|
|
46
|
+
"typescript-eslint": "^8.54.0",
|
|
47
|
+
"vite-plugin-devtools-json": "^0.2.1"
|
|
47
48
|
},
|
|
48
49
|
"trustedDependencies": [
|
|
49
50
|
"@rocicorp/zero-sqlite3"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html, body, section, text, button,
|
|
1
|
+
import { html, body, section, text, button, link, divider, render } from "@mikstack/email";
|
|
2
2
|
|
|
3
3
|
export function magicLinkEmail(url: string) {
|
|
4
4
|
const email = html(
|
|
@@ -6,62 +6,44 @@ export function magicLinkEmail(url: string) {
|
|
|
6
6
|
[
|
|
7
7
|
section(
|
|
8
8
|
[
|
|
9
|
-
text("{{projectName}}", {
|
|
9
|
+
text("Sign in to {{projectName}}", {
|
|
10
10
|
fontSize: 24,
|
|
11
11
|
fontWeight: "bold",
|
|
12
|
-
textAlign: "center",
|
|
13
12
|
color: "#111827",
|
|
13
|
+
marginBottom: 40,
|
|
14
|
+
marginTop: 40,
|
|
14
15
|
}),
|
|
15
|
-
|
|
16
|
-
{ padding: [32, 24, 0, 24] },
|
|
17
|
-
),
|
|
18
|
-
section(
|
|
19
|
-
[
|
|
20
|
-
text("Sign in to your account", {
|
|
21
|
-
fontSize: 20,
|
|
22
|
-
fontWeight: "bold",
|
|
23
|
-
color: "#111827",
|
|
24
|
-
}),
|
|
25
|
-
spacer(8),
|
|
26
|
-
text("Click the button below to sign in. This link will expire in 10 minutes.", {
|
|
27
|
-
fontSize: 16,
|
|
28
|
-
lineHeight: 1.5,
|
|
29
|
-
color: "#4b5563",
|
|
30
|
-
}),
|
|
31
|
-
spacer(24),
|
|
32
|
-
button("Sign in", {
|
|
16
|
+
link("Click here to sign in with this magic link", {
|
|
33
17
|
href: url,
|
|
34
|
-
|
|
35
|
-
color: "#ffffff",
|
|
36
|
-
borderRadius: 6,
|
|
37
|
-
padding: [12, 32],
|
|
38
|
-
fontSize: 16,
|
|
39
|
-
fontWeight: "bold",
|
|
40
|
-
}),
|
|
41
|
-
spacer(24),
|
|
42
|
-
text("Or copy and paste this URL into your browser:", {
|
|
18
|
+
color: "#2563eb",
|
|
43
19
|
fontSize: 14,
|
|
44
|
-
|
|
20
|
+
textDecoration: "underline",
|
|
21
|
+
marginBottom: 16,
|
|
45
22
|
}),
|
|
46
|
-
|
|
47
|
-
text(url, {
|
|
23
|
+
text("Or, copy and paste this temporary login URL:", {
|
|
48
24
|
fontSize: 14,
|
|
49
|
-
|
|
50
|
-
|
|
25
|
+
lineHeight: 1.7,
|
|
26
|
+
color: "#111827",
|
|
27
|
+
marginTop: 24,
|
|
28
|
+
marginBottom: 14,
|
|
51
29
|
}),
|
|
52
|
-
|
|
53
|
-
{ padding: [24, 24] },
|
|
54
|
-
),
|
|
55
|
-
divider({ borderColor: "#e5e7eb" }),
|
|
56
|
-
section(
|
|
57
|
-
[
|
|
58
|
-
text("If you didn't request this email, you can safely ignore it.", {
|
|
30
|
+
text(url, {
|
|
59
31
|
fontSize: 13,
|
|
60
|
-
color: "#
|
|
61
|
-
|
|
32
|
+
color: "#111827",
|
|
33
|
+
backgroundColor: "#f4f4f4",
|
|
34
|
+
borderRadius: 6,
|
|
35
|
+
padding: [16, 24],
|
|
36
|
+
border: "1px solid #eee",
|
|
37
|
+
}),
|
|
38
|
+
text("If you didn't try to sign in, you can safely ignore this email.", {
|
|
39
|
+
fontSize: 14,
|
|
40
|
+
lineHeight: 1.7,
|
|
41
|
+
color: "#ababab",
|
|
42
|
+
marginTop: 14,
|
|
43
|
+
marginBottom: 38,
|
|
62
44
|
}),
|
|
63
45
|
],
|
|
64
|
-
{ padding: [
|
|
46
|
+
{ padding: [0, 24] },
|
|
65
47
|
),
|
|
66
48
|
],
|
|
67
49
|
{ maxWidth: 480, backgroundColor: "#ffffff" },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ssr = false;
|
|
@@ -23,7 +23,7 @@ export const GET: RequestHandler = async ({ params }) => {
|
|
|
23
23
|
|
|
24
24
|
const wrapper = `<!DOCTYPE html>
|
|
25
25
|
<html>
|
|
26
|
-
<head><meta charset="utf-8">${title}<style>*{margin:0;padding:0}html,body{height:100
|
|
26
|
+
<head><meta charset="utf-8">${title}<style>*{margin:0;padding:0}html,body{height:100%;background:#e5e7eb}iframe{display:block;max-width:600px;width:100%;height:100%;margin:0 auto;border:none;background:#fff}</style></head>
|
|
27
27
|
<body><iframe srcdoc="${escaped}"></iframe></body>
|
|
28
28
|
</html>`;
|
|
29
29
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import devtoolsJson from "vite-plugin-devtools-json";
|
|
1
2
|
import { sveltekit } from "@sveltejs/kit/vite";
|
|
2
3
|
import { linguiPo } from "@mikstack/svelte-lingui/vite";
|
|
3
4
|
import { defineConfig } from "vite";
|
|
4
5
|
|
|
5
6
|
export default defineConfig({
|
|
6
|
-
plugins: [linguiPo(), sveltekit()],
|
|
7
|
+
plugins: [devtoolsJson(), linguiPo(), sveltekit()],
|
|
7
8
|
});
|