@seip/bluebird-js 0.1.6 → 0.1.7

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.
@@ -1,123 +1,123 @@
1
- export const route = "/";
2
- export const cache = 300;
3
- export const layout = "main";
4
- export const seo = true;
5
-
6
- export const head = () => ({
7
- title: "Blue Bird Framework — High Performance Web Framework",
8
- description: "Fast, structured, and opinionated Express.js framework with React JSX SSR and multi-tier caching.",
9
- });
10
-
11
- /**
12
- * Home page React JSX view module.
13
- */
14
- export default function IndexView() {
15
- return (
16
- <>
17
- <section className="py-10 md:py-14 border-b border-slate-800/80">
18
- <h1 className="mt-3 text-3xl md:text-5xl font-extrabold tracking-tight bg-gradient-to-r from-sky-400 via-blue-500 to-indigo-400 bg-clip-text text-transparent">
19
- Hello, Developer!
20
- </h1>
21
- <p className="mt-4 text-base md:text-lg text-slate-300 max-w-2xl leading-relaxed">
22
- Blue Bird is a fast, structured, and opinionated Express.js framework for developers who want
23
- visual elegance and performance with native React JSX SSR, Partial Rendering, and modern JavaScript.
24
- </p>
25
- <div className="flex items-center gap-4 mt-6">
26
- <a
27
- href="/about"
28
- className="px-4 py-2.5 rounded-xl bg-sky-500 hover:bg-sky-400 text-slate-950 font-semibold text-sm transition-colors shadow-lg shadow-sky-500/20"
29
- >
30
- About Us &rarr;
31
- </a>
32
- <a
33
- href="https://github.com/seip25/bluebird-js"
34
- target="_blank"
35
- className="px-4 py-2.5 rounded-xl border border-slate-700 bg-slate-900/60 hover:bg-slate-800 text-slate-200 text-sm font-semibold transition-colors"
36
- >
37
- GitHub
38
- </a>
39
- </div>
40
- </section>
41
-
42
- <div className="mt-8">
43
- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5">
44
- <article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
45
- <header>
46
- <span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
47
- Rendering
48
- </span>
49
- <h3 className="text-lg font-bold text-slate-100">Zero-Build React JSX SSR</h3>
50
- </header>
51
- <p className="text-sm text-slate-400 mt-2 leading-relaxed">
52
- Native <code>.jsx</code> views compiled in memory with automatic XSS escaping, shared layouts,{" "}
53
- <code>&lt;Client /&gt;</code> islands with anti-CLS skeletons, and partial SPA transitions.
54
- </p>
55
- </article>
56
-
57
- <article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
58
- <header>
59
- <span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
60
- Performance
61
- </span>
62
- <h3 className="text-lg font-bold text-slate-100">Declarative Auto-Routes &amp; Cache</h3>
63
- </header>
64
- <p className="text-sm text-slate-400 mt-2 leading-relaxed">
65
- Export <code>const cache = 300</code> and <code>const middlewares = [...]</code> directly from your{" "}
66
- <code>app/views/*.jsx</code> files for instant route mounting and L1 RAM / Redis caching.
67
- </p>
68
- </article>
69
-
70
- <article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
71
- <header>
72
- <span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
73
- Security
74
- </span>
75
- <h3 className="text-lg font-bold text-slate-100">JWT &amp; Route Security</h3>
76
- </header>
77
- <p className="text-sm text-slate-400 mt-2 leading-relaxed">
78
- Secure cookie management, GCM-encrypted JWT tokens, custom security headers, and route rate limiting built-in.
79
- </p>
80
- </article>
81
-
82
- <article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
83
- <header>
84
- <span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
85
- Database
86
- </span>
87
- <h3 className="text-lg font-bold text-slate-100">Unified DB Layer</h3>
88
- </header>
89
- <p className="text-sm text-slate-400 mt-2 leading-relaxed">
90
- Built-in support for SQLite (native node:sqlite with WAL), MySQL, and PostgreSQL with connection pooling and caching.
91
- </p>
92
- </article>
93
-
94
- <article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
95
- <header>
96
- <span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
97
- DevOps
98
- </span>
99
- <h3 className="text-lg font-bold text-slate-100">Production Ready</h3>
100
- </header>
101
- <p className="text-sm text-slate-400 mt-2 leading-relaxed">
102
- Production cluster orchestration with PM2, native health checks, and smooth View Transitions SPA navigation.
103
- </p>
104
- </article>
105
-
106
- <article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
107
- <header>
108
- <span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
109
- Design
110
- </span>
111
- <h3 className="text-lg font-bold text-slate-100">Tailwind CSS Built-In</h3>
112
- </header>
113
- <p className="text-sm text-slate-400 mt-2 leading-relaxed">
114
- Modern utility classes styled by <strong>Tailwind CSS v4</strong> (
115
- <code className="text-sky-400 font-mono text-xs">/js/tailwind.js</code>) and Google Fonts Inter with zero build steps.
116
- </p>
117
- </article>
118
- </div>
119
- </div>
120
- </>
121
- );
122
- }
123
-
1
+ export const route = "/";
2
+ export const cache = 300;
3
+ export const layout = "main";
4
+ export const seo = true;
5
+
6
+ export const head = () => ({
7
+ title: "Blue Bird Framework — High Performance Web Framework",
8
+ description: "Fast, structured, and opinionated Express.js framework with React JSX SSR and multi-tier caching.",
9
+ });
10
+
11
+ /**
12
+ * Home page React JSX view module.
13
+ */
14
+ export default function IndexView() {
15
+ return (
16
+ <>
17
+ <section className="py-10 md:py-14 border-b border-slate-800/80">
18
+ <h1 className="mt-3 text-3xl md:text-5xl font-extrabold tracking-tight bg-gradient-to-r from-sky-400 via-blue-500 to-indigo-400 bg-clip-text text-transparent">
19
+ Hello, Developer!
20
+ </h1>
21
+ <p className="mt-4 text-base md:text-lg text-slate-300 max-w-2xl leading-relaxed">
22
+ Blue Bird is a fast, structured, and opinionated Express.js framework for developers who want
23
+ visual elegance and performance with native React JSX SSR, Partial Rendering, and modern JavaScript.
24
+ </p>
25
+ <div className="flex items-center gap-4 mt-6">
26
+ <a
27
+ href="/about"
28
+ className="px-4 py-2.5 rounded-xl bg-sky-500 hover:bg-sky-400 text-slate-950 font-semibold text-sm transition-colors shadow-lg shadow-sky-500/20"
29
+ >
30
+ About Us &rarr;
31
+ </a>
32
+ <a
33
+ href="https://github.com/seip25/bluebird-js"
34
+ target="_blank"
35
+ className="px-4 py-2.5 rounded-xl border border-slate-700 bg-slate-900/60 hover:bg-slate-800 text-slate-200 text-sm font-semibold transition-colors"
36
+ >
37
+ GitHub
38
+ </a>
39
+ </div>
40
+ </section>
41
+
42
+ <div className="mt-8">
43
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5">
44
+ <article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
45
+ <header>
46
+ <span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
47
+ Rendering
48
+ </span>
49
+ <h3 className="text-lg font-bold text-slate-100">Zero-Build React JSX SSR</h3>
50
+ </header>
51
+ <p className="text-sm text-slate-400 mt-2 leading-relaxed">
52
+ Native <code>.jsx</code> views compiled in memory with automatic XSS escaping, shared layouts,{" "}
53
+ <code>&lt;Client /&gt;</code> islands with anti-CLS skeletons, and partial SPA transitions.
54
+ </p>
55
+ </article>
56
+
57
+ <article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
58
+ <header>
59
+ <span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
60
+ Performance
61
+ </span>
62
+ <h3 className="text-lg font-bold text-slate-100">Declarative Auto-Routes &amp; Cache</h3>
63
+ </header>
64
+ <p className="text-sm text-slate-400 mt-2 leading-relaxed">
65
+ Export <code>const cache = 300</code> and <code>const middlewares = [...]</code> directly from your{" "}
66
+ <code>app/views/*.jsx</code> files for instant route mounting and L1 RAM / Redis caching.
67
+ </p>
68
+ </article>
69
+
70
+ <article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
71
+ <header>
72
+ <span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
73
+ Security
74
+ </span>
75
+ <h3 className="text-lg font-bold text-slate-100">JWT &amp; Route Security</h3>
76
+ </header>
77
+ <p className="text-sm text-slate-400 mt-2 leading-relaxed">
78
+ Secure cookie management, GCM-encrypted JWT tokens, custom security headers, and route rate limiting built-in.
79
+ </p>
80
+ </article>
81
+
82
+ <article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
83
+ <header>
84
+ <span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
85
+ Database
86
+ </span>
87
+ <h3 className="text-lg font-bold text-slate-100">Unified DB Layer</h3>
88
+ </header>
89
+ <p className="text-sm text-slate-400 mt-2 leading-relaxed">
90
+ Built-in support for SQLite (native node:sqlite with WAL), MySQL, and PostgreSQL with connection pooling and caching.
91
+ </p>
92
+ </article>
93
+
94
+ <article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
95
+ <header>
96
+ <span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
97
+ DevOps
98
+ </span>
99
+ <h3 className="text-lg font-bold text-slate-100">Production Ready</h3>
100
+ </header>
101
+ <p className="text-sm text-slate-400 mt-2 leading-relaxed">
102
+ Production cluster orchestration with PM2, native health checks, and smooth View Transitions SPA navigation.
103
+ </p>
104
+ </article>
105
+
106
+ <article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
107
+ <header>
108
+ <span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
109
+ Design
110
+ </span>
111
+ <h3 className="text-lg font-bold text-slate-100">Tailwind CSS Built-In</h3>
112
+ </header>
113
+ <p className="text-sm text-slate-400 mt-2 leading-relaxed">
114
+ Modern utility classes styled by <strong>Tailwind CSS v4</strong> (
115
+ <code className="text-sky-400 font-mono text-xs">/js/tailwind.js</code>) and Google Fonts Inter with zero build steps.
116
+ </p>
117
+ </article>
118
+ </div>
119
+ </div>
120
+ </>
121
+ );
122
+ }
123
+
@@ -1,141 +1,141 @@
1
- import { script } from "@seip/bluebird-js/core/html.js";
2
-
3
- export const route = "/login";
4
- export const layout = "main";
5
- export const seo = true;
6
-
7
- export const head = () => ({
8
- title: "Sign In — Blue Bird Framework",
9
- description: "Test native JWT authentication, encrypted cookies, and protected routes.",
10
- });
11
-
12
- /**
13
- * Login page React JSX view module.
14
- */
15
- export default function LoginView() {
16
- return (
17
- <>
18
- <section className="py-10 md:py-14 border-b border-slate-800/80">
19
- <h1 className="mt-3 text-3xl md:text-5xl font-extrabold tracking-tight bg-gradient-to-r from-sky-400 via-blue-500 to-indigo-400 bg-clip-text text-transparent">
20
- Authentication Demo
21
- </h1>
22
- <p className="mt-4 text-base md:text-lg text-slate-300 max-w-2xl leading-relaxed">
23
- Test native AES-256-GCM JWT auth cookies, Auth.protect middleware, and seamless View Transitions.
24
- </p>
25
- </section>
26
-
27
- <div className="mt-8 max-w-2xl">
28
- <div className="rounded-xl border border-sky-500/30 bg-sky-500/10 p-4 text-sky-200 mb-6">
29
- <strong className="font-semibold block text-sky-400 mb-1">Interactive Auth Testing</strong>
30
- <p className="text-sm leading-relaxed text-slate-300">
31
- Submit credentials below to generate an encrypted JWT session cookie with{" "}
32
- <code className="text-sky-300 font-mono text-xs px-1.5 py-0.5 rounded bg-slate-900 border border-slate-800">
33
- Auth.login(res, user)
34
- </code>
35
- . Try visiting <strong className="text-white">/dashboard</strong> directly before and after logging in to verify the{" "}
36
- <code className="text-sky-300 font-mono text-xs px-1.5 py-0.5 rounded bg-slate-900 border border-slate-800">
37
- Auth.protect({'{'} redirect: "/login" {'}'})
38
- </code>{" "}
39
- middleware!
40
- </p>
41
- </div>
42
-
43
- <article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 md:p-8">
44
- <header className="mb-6">
45
- <h3 className="text-xl font-bold text-slate-100">Sign In</h3>
46
- <p className="text-sm text-slate-400 mt-1">
47
- Enter your test credentials below to start a secure session.
48
- </p>
49
- </header>
50
-
51
- <form action="/login" method="POST" id="loginForm" className="space-y-4">
52
- <div>
53
- <label
54
- htmlFor="email"
55
- className="block text-xs font-semibold uppercase tracking-wider text-slate-400 mb-1.5"
56
- >
57
- Email Address
58
- </label>
59
- <input
60
- type="email"
61
- id="email"
62
- name="email"
63
- value="alex@example.com"
64
- placeholder="alex@example.com"
65
- required
66
- className="w-full rounded-lg border border-slate-700 bg-slate-950 px-3.5 py-2.5 text-sm text-slate-100 placeholder-slate-500 focus:border-sky-500 focus:outline-none focus:ring-2 focus:ring-sky-500/20"
67
- />
68
- </div>
69
-
70
- <div>
71
- <label
72
- htmlFor="password"
73
- className="block text-xs font-semibold uppercase tracking-wider text-slate-400 mb-1.5"
74
- >
75
- Password
76
- </label>
77
- <input
78
- type="password"
79
- id="password"
80
- name="password"
81
- value="password123"
82
- placeholder="••••••••"
83
- required
84
- className="w-full rounded-lg border border-slate-700 bg-slate-950 px-3.5 py-2.5 text-sm text-slate-100 placeholder-slate-500 focus:border-sky-500 focus:outline-none focus:ring-2 focus:ring-sky-500/20"
85
- />
86
- </div>
87
-
88
- <div className="flex items-center justify-between gap-4 pt-4">
89
- <button
90
- type="submit"
91
- id="submitBtn"
92
- className="bg-sky-500 hover:bg-sky-400 text-slate-950 font-semibold px-5 py-2.5 rounded-lg text-sm transition-colors shadow-lg shadow-sky-500/20"
93
- >
94
- Sign In &rarr;
95
- </button>
96
- <a
97
- href="/dashboard"
98
- className="px-4 py-2.5 rounded-lg border border-slate-700 bg-slate-900/80 hover:bg-slate-800 text-slate-300 text-sm font-medium transition-colors"
99
- >
100
- Try /dashboard (Protected)
101
- </a>
102
- </div>
103
- </form>
104
- </article>
105
-
106
- <article className="mt-8 rounded-2xl border border-slate-800 bg-slate-900/40 p-6">
107
- <header>
108
- <h4 className="font-bold text-slate-200">What is being tested here?</h4>
109
- </header>
110
- <div className="grid grid-cols-1 md:grid-cols-2 gap-4 mt-4">
111
- <div className="rounded-xl border border-slate-800/80 bg-slate-950/60 p-4">
112
- <h5 className="font-bold text-sm text-slate-200 mb-1">1. Auth.protect Middleware</h5>
113
- <p className="text-xs text-slate-400 leading-relaxed">
114
- When an unauthenticated client requests <code className="text-sky-300 font-mono">/dashboard</code>, the server issues a 302 redirect to{" "}
115
- <code className="text-sky-300 font-mono">/login</code>. The client router automatically follows the transition smoothly.
116
- </p>
117
- </div>
118
- <div className="rounded-xl border border-slate-800/80 bg-slate-950/60 p-4">
119
- <h5 className="font-bold text-sm text-slate-200 mb-1">2. Encrypted JWT Cookies</h5>
120
- <p className="text-xs text-slate-400 leading-relaxed">
121
- Session cookies are encrypted with AES-256-GCM and marked HttpOnly and SameSite=Lax to protect against token exfiltration.
122
- </p>
123
- </div>
124
- </div>
125
- </article>
126
- </div>
127
-
128
- {script(() => {
129
- const form = document.getElementById("loginForm");
130
- const btn = document.getElementById("submitBtn");
131
- form?.addEventListener("submit", () => {
132
- if (btn) {
133
- btn.textContent = "Signing In...";
134
- btn.setAttribute("disabled", "true");
135
- }
136
- });
137
- })}
138
- </>
139
- );
140
- }
141
-
1
+ import { script } from "@seip/bluebird-js/core/html.js";
2
+
3
+ export const route = "/login";
4
+ export const layout = "main";
5
+ export const seo = true;
6
+
7
+ export const head = () => ({
8
+ title: "Sign In — Blue Bird Framework",
9
+ description: "Test native JWT authentication, encrypted cookies, and protected routes.",
10
+ });
11
+
12
+ /**
13
+ * Login page React JSX view module.
14
+ */
15
+ export default function LoginView() {
16
+ return (
17
+ <>
18
+ <section className="py-10 md:py-14 border-b border-slate-800/80">
19
+ <h1 className="mt-3 text-3xl md:text-5xl font-extrabold tracking-tight bg-gradient-to-r from-sky-400 via-blue-500 to-indigo-400 bg-clip-text text-transparent">
20
+ Authentication Demo
21
+ </h1>
22
+ <p className="mt-4 text-base md:text-lg text-slate-300 max-w-2xl leading-relaxed">
23
+ Test native AES-256-GCM JWT auth cookies, Auth.protect middleware, and seamless View Transitions.
24
+ </p>
25
+ </section>
26
+
27
+ <div className="mt-8 max-w-2xl">
28
+ <div className="rounded-xl border border-sky-500/30 bg-sky-500/10 p-4 text-sky-200 mb-6">
29
+ <strong className="font-semibold block text-sky-400 mb-1">Interactive Auth Testing</strong>
30
+ <p className="text-sm leading-relaxed text-slate-300">
31
+ Submit credentials below to generate an encrypted JWT session cookie with{" "}
32
+ <code className="text-sky-300 font-mono text-xs px-1.5 py-0.5 rounded bg-slate-900 border border-slate-800">
33
+ Auth.login(res, user)
34
+ </code>
35
+ . Try visiting <strong className="text-white">/dashboard</strong> directly before and after logging in to verify the{" "}
36
+ <code className="text-sky-300 font-mono text-xs px-1.5 py-0.5 rounded bg-slate-900 border border-slate-800">
37
+ Auth.protect({'{'} redirect: "/login" {'}'})
38
+ </code>{" "}
39
+ middleware!
40
+ </p>
41
+ </div>
42
+
43
+ <article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 md:p-8">
44
+ <header className="mb-6">
45
+ <h3 className="text-xl font-bold text-slate-100">Sign In</h3>
46
+ <p className="text-sm text-slate-400 mt-1">
47
+ Enter your test credentials below to start a secure session.
48
+ </p>
49
+ </header>
50
+
51
+ <form action="/login" method="POST" id="loginForm" className="space-y-4">
52
+ <div>
53
+ <label
54
+ htmlFor="email"
55
+ className="block text-xs font-semibold uppercase tracking-wider text-slate-400 mb-1.5"
56
+ >
57
+ Email Address
58
+ </label>
59
+ <input
60
+ type="email"
61
+ id="email"
62
+ name="email"
63
+ value="alex@example.com"
64
+ placeholder="alex@example.com"
65
+ required
66
+ className="w-full rounded-lg border border-slate-700 bg-slate-950 px-3.5 py-2.5 text-sm text-slate-100 placeholder-slate-500 focus:border-sky-500 focus:outline-none focus:ring-2 focus:ring-sky-500/20"
67
+ />
68
+ </div>
69
+
70
+ <div>
71
+ <label
72
+ htmlFor="password"
73
+ className="block text-xs font-semibold uppercase tracking-wider text-slate-400 mb-1.5"
74
+ >
75
+ Password
76
+ </label>
77
+ <input
78
+ type="password"
79
+ id="password"
80
+ name="password"
81
+ value="password123"
82
+ placeholder="••••••••"
83
+ required
84
+ className="w-full rounded-lg border border-slate-700 bg-slate-950 px-3.5 py-2.5 text-sm text-slate-100 placeholder-slate-500 focus:border-sky-500 focus:outline-none focus:ring-2 focus:ring-sky-500/20"
85
+ />
86
+ </div>
87
+
88
+ <div className="flex items-center justify-between gap-4 pt-4">
89
+ <button
90
+ type="submit"
91
+ id="submitBtn"
92
+ className="bg-sky-500 hover:bg-sky-400 text-slate-950 font-semibold px-5 py-2.5 rounded-lg text-sm transition-colors shadow-lg shadow-sky-500/20"
93
+ >
94
+ Sign In &rarr;
95
+ </button>
96
+ <a
97
+ href="/dashboard"
98
+ className="px-4 py-2.5 rounded-lg border border-slate-700 bg-slate-900/80 hover:bg-slate-800 text-slate-300 text-sm font-medium transition-colors"
99
+ >
100
+ Try /dashboard (Protected)
101
+ </a>
102
+ </div>
103
+ </form>
104
+ </article>
105
+
106
+ <article className="mt-8 rounded-2xl border border-slate-800 bg-slate-900/40 p-6">
107
+ <header>
108
+ <h4 className="font-bold text-slate-200">What is being tested here?</h4>
109
+ </header>
110
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4 mt-4">
111
+ <div className="rounded-xl border border-slate-800/80 bg-slate-950/60 p-4">
112
+ <h5 className="font-bold text-sm text-slate-200 mb-1">1. Auth.protect Middleware</h5>
113
+ <p className="text-xs text-slate-400 leading-relaxed">
114
+ When an unauthenticated client requests <code className="text-sky-300 font-mono">/dashboard</code>, the server issues a 302 redirect to{" "}
115
+ <code className="text-sky-300 font-mono">/login</code>. The client router automatically follows the transition smoothly.
116
+ </p>
117
+ </div>
118
+ <div className="rounded-xl border border-slate-800/80 bg-slate-950/60 p-4">
119
+ <h5 className="font-bold text-sm text-slate-200 mb-1">2. Encrypted JWT Cookies</h5>
120
+ <p className="text-xs text-slate-400 leading-relaxed">
121
+ Session cookies are encrypted with AES-256-GCM and marked HttpOnly and SameSite=Lax to protect against token exfiltration.
122
+ </p>
123
+ </div>
124
+ </div>
125
+ </article>
126
+ </div>
127
+
128
+ {script(() => {
129
+ const form = document.getElementById("loginForm");
130
+ const btn = document.getElementById("submitBtn");
131
+ form?.addEventListener("submit", () => {
132
+ if (btn) {
133
+ btn.textContent = "Signing In...";
134
+ btn.setAttribute("disabled", "true");
135
+ }
136
+ });
137
+ })}
138
+ </>
139
+ );
140
+ }
141
+
package/core/actions.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { Actions, ActionDefinitionOptions, ActionContext } from "./index.js";
2
2
  export default Actions;
3
3
  export { Actions, ActionDefinitionOptions, ActionContext };
4
-
4
+