vinojs 0.1.0 → 0.1.2
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/client.mjs +1 -1
- package/dist/{compile-Lxl_tdxL.mjs → compile-glNMkyyx.mjs} +3 -47
- package/dist/compile-glNMkyyx.mjs.map +1 -0
- package/dist/{definePage-Ba4r-TFh.mjs → definePage--9Pz7rHs.mjs} +29 -7
- package/dist/definePage--9Pz7rHs.mjs.map +1 -0
- package/dist/defineServerFn-H-bz7xBX.mjs +47 -0
- package/dist/defineServerFn-H-bz7xBX.mjs.map +1 -0
- package/dist/factory-CVT0-OZw.d.mts +187 -0
- package/dist/factory-CVT0-OZw.d.mts.map +1 -0
- package/dist/factory.d.mts +2 -0
- package/dist/factory.mjs +153 -0
- package/dist/factory.mjs.map +1 -0
- package/dist/vino.d.mts +4 -103
- package/dist/vino.d.mts.map +1 -1
- package/dist/vino.mjs +8 -3
- package/dist/vino.mjs.map +1 -1
- package/dist/vite.mjs +3 -2
- package/dist/vite.mjs.map +1 -1
- package/package.json +5 -1
- package/dist/compile-Lxl_tdxL.mjs.map +0 -1
- package/dist/definePage-Ba4r-TFh.mjs.map +0 -1
- package/examples/basic/dist/client/.assetsignore +0 -2
- package/examples/basic/dist/client/about.html +0 -1
- package/examples/basic/dist/client/admin.html +0 -1
- package/examples/basic/dist/client/assets/Counter-BvqMZKON.js +0 -1
- package/examples/basic/dist/client/assets/_slug_-CYpOSbrn.js +0 -1
- package/examples/basic/dist/client/assets/about-BZXRzUyv.js +0 -1
- package/examples/basic/dist/client/assets/admin-DRE7uh2s.js +0 -1
- package/examples/basic/dist/client/assets/client-B6nFkut5.js +0 -1
- package/examples/basic/dist/client/assets/client-pages-Bc6cNZAm.js +0 -2
- package/examples/basic/dist/client/assets/components-DX9r6vHn.js +0 -1
- package/examples/basic/dist/client/assets/components-DsWJ6F73.js +0 -2
- package/examples/basic/dist/client/assets/counter-DBpvln_F.js +0 -1
- package/examples/basic/dist/client/assets/dom-B5sHIJ1E.js +0 -1
- package/examples/basic/dist/client/assets/honoto-9UtdLp4J.js +0 -33
- package/examples/basic/dist/client/assets/honoto-client-DEh86_WZ.css +0 -1
- package/examples/basic/dist/client/assets/honoto-client.js +0 -2
- package/examples/basic/dist/client/assets/hooks-Cz6AT21d.js +0 -1
- package/examples/basic/dist/client/assets/jsx-dev-runtime-92VDsVyo.js +0 -1
- package/examples/basic/dist/client/counter.html +0 -1
- package/examples/basic/dist/client/index.html +0 -1
- package/examples/basic/dist/client/jobs.html +0 -1
- package/examples/basic/dist/ssr/.vite/manifest.json +0 -140
- package/examples/basic/dist/ssr/assets/_slug_-CY3-kffX.js +0 -46
- package/examples/basic/dist/ssr/assets/about-CTDjNhkO.js +0 -15
- package/examples/basic/dist/ssr/assets/admin-DvS-UGJx.js +0 -26
- package/examples/basic/dist/ssr/assets/constants-UoriGYcX-CUecBFMT.js +0 -6
- package/examples/basic/dist/ssr/assets/counter-DfIbc9Sp.js +0 -30
- package/examples/basic/dist/ssr/assets/honoto-CA313cVy.js +0 -2129
- package/examples/basic/dist/ssr/assets/jobs-D9hh-UO9.js +0 -42
- package/examples/basic/dist/ssr/assets/jsx-CgYLQazd.js +0 -1080
- package/examples/basic/dist/ssr/assets/jsx-dev-runtime-BlUda7H8.js +0 -742
- package/examples/basic/dist/ssr/assets/jsx-renderer-CzZcZPnS.js +0 -65
- package/examples/basic/dist/ssr/assets/layout-DYvLwr2u.js +0 -53
- package/examples/basic/dist/ssr/assets/pages-DB6jeyrt.js +0 -53
- package/examples/basic/dist/ssr/assets/rolldown-runtime-D7D4PA-g.js +0 -13
- package/examples/basic/dist/ssr/assets/ssr-hooks-CBQr0cdH.js +0 -7
- package/examples/basic/dist/ssr/index.js +0 -22
- package/examples/basic/dist/ssr/wrangler.json +0 -1
- package/examples/full/dist/client/.assetsignore +0 -2
- package/examples/full/dist/client/assets/BookmarkButton-py0xGxgl.js +0 -1
- package/examples/full/dist/client/assets/_slug_-DZUFsE9O.js +0 -1
- package/examples/full/dist/client/assets/auth-client-D2Wtuobe.js +0 -1
- package/examples/full/dist/client/assets/bun-sqlite-dialect-C7ftEUSI-CsHdUKBY.js +0 -1
- package/examples/full/dist/client/assets/client-B6nFkut5.js +0 -1
- package/examples/full/dist/client/assets/client-pages-fshKs747.js +0 -2
- package/examples/full/dist/client/assets/components-DX9r6vHn.js +0 -1
- package/examples/full/dist/client/assets/components-S_-rWrKi.js +0 -2
- package/examples/full/dist/client/assets/d1-sqlite-dialect-BZmaVTp8-FPCaMZqX.js +0 -1
- package/examples/full/dist/client/assets/default-query-compiler-CUdqIu1h.js +0 -1
- package/examples/full/dist/client/assets/dist-BoGTNvkC.js +0 -1
- package/examples/full/dist/client/assets/dom-DCd3wYW7.js +0 -1
- package/examples/full/dist/client/assets/factory-Bgf4EtLx.js +0 -8
- package/examples/full/dist/client/assets/honoto-client-BSvNAnxN.css +0 -1
- package/examples/full/dist/client/assets/honoto-client.js +0 -2
- package/examples/full/dist/client/assets/hooks-Cz6AT21d.js +0 -1
- package/examples/full/dist/client/assets/jsx-dev-runtime-92VDsVyo.js +0 -1
- package/examples/full/dist/client/assets/kysely-adapter-BHhasAnc.js +0 -1
- package/examples/full/dist/client/assets/kysely-migration-tables-DFfmKhq--U5ujlMwE.js +0 -1
- package/examples/full/dist/client/assets/node-sqlite-dialect-DJDXH5Ot.js +0 -1
- package/examples/full/dist/client/assets/pages-CUQx6Eus.js +0 -1
- package/examples/full/dist/client/assets/saved-jIi74ncJ.js +0 -1
- package/examples/full/dist/client/assets/session-B-accyM3.js +0 -611
- package/examples/full/dist/client/assets/sign-in-BelI3gSs.js +0 -1
- package/examples/full/dist/client/assets/sign-up-pR94lfdu.js +0 -1
- package/examples/full/dist/client/index.html +0 -1
- package/examples/full/dist/client/saved.html +0 -1
- package/examples/full/dist/client/sign-in.html +0 -1
- package/examples/full/dist/client/sign-up.html +0 -1
- package/examples/full/dist/ssr/.dev.vars +0 -1
- package/examples/full/dist/ssr/.vite/manifest.json +0 -219
- package/examples/full/dist/ssr/assets/BookmarkButton-KS7z5_vi.js +0 -298
- package/examples/full/dist/ssr/assets/_slug_-rRStRaAN.js +0 -89
- package/examples/full/dist/ssr/assets/auth-DSFZ4iak.js +0 -31434
- package/examples/full/dist/ssr/assets/auth-client-BFSBVoML.js +0 -894
- package/examples/full/dist/ssr/assets/bun-sqlite-dialect-C7ftEUSI-BeXpIqKl.js +0 -162
- package/examples/full/dist/ssr/assets/compiled-query-DmoyCh28.js +0 -8410
- package/examples/full/dist/ssr/assets/d1-sqlite-dialect-BZmaVTp8-CjJdvL94.js +0 -114
- package/examples/full/dist/ssr/assets/default-query-compiler-D7xOzCCJ.js +0 -1727
- package/examples/full/dist/ssr/assets/dist-LmmDoNdk.js +0 -6832
- package/examples/full/dist/ssr/assets/dist-kFDN1l4Z.js +0 -342
- package/examples/full/dist/ssr/assets/factory-AD6s9SIW.js +0 -2079
- package/examples/full/dist/ssr/assets/jsx-renderer-mMLf5XLN.js +0 -1926
- package/examples/full/dist/ssr/assets/kysely-adapter-BCLenpM8.js +0 -2
- package/examples/full/dist/ssr/assets/kysely-migration-tables-DFfmKhq--BtVr6hRe.js +0 -17
- package/examples/full/dist/ssr/assets/layout-mVA7qP4j.js +0 -44
- package/examples/full/dist/ssr/assets/node-sqlite-dialect-D-wtYAD7.js +0 -162
- package/examples/full/dist/ssr/assets/pages-Do5kR_Ia.js +0 -147
- package/examples/full/dist/ssr/assets/saved-Dr4pP6B5.js +0 -111
- package/examples/full/dist/ssr/assets/session-BvIpX7tr.js +0 -13
- package/examples/full/dist/ssr/assets/sign-in-22pzTnJE.js +0 -115
- package/examples/full/dist/ssr/assets/sign-up-CN4j8Qg1.js +0 -117
- package/examples/full/dist/ssr/assets/sqlite-adapter-DVlms5wO.js +0 -79
- package/examples/full/dist/ssr/index.js +0 -97
- package/examples/full/dist/ssr/wrangler.json +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./hooks-Cz6AT21d.js";import{n as t}from"./honoto-client.js";import{t as n}from"./jsx-dev-runtime-92VDsVyo.js";import{t as r}from"./session-B-accyM3.js";import{t as i}from"./auth-client-D2Wtuobe.js";function a({data:t}){let[r,a]=e(``),[o,s]=e(``),[c,l]=e(null),[u,d]=e(!1);if(t.user)return n(`main`,{class:`max-w-md mx-auto px-4 py-12`,children:[n(`h1`,{class:`text-2xl font-semibold`,children:`You are signed in`}),n(`p`,{class:`mt-2 text-stone-600`,children:[`Welcome back, `,t.user.name,`.`]}),n(`a`,{href:`/`,class:`inline-block mt-6 text-stone-800 underline`,children:`Go to feed`})]});async function f(e){e.preventDefault(),d(!0),l(null);let t=await i.signIn.email({email:r,password:o});if(d(!1),t.error){l(t.error.message??`Sign in failed`);return}window.location.href=`/`}return n(`main`,{class:`max-w-md mx-auto px-4 py-12`,children:[n(`h1`,{class:`text-2xl font-semibold`,children:`Sign in`}),n(`p`,{class:`mt-2 text-stone-600 text-sm`,children:[`No account?`,` `,n(`a`,{href:`/sign-up`,class:`underline text-stone-800`,children:`Sign up`})]}),n(`form`,{class:`mt-8 flex flex-col gap-4`,onSubmit:f,children:[n(`label`,{class:`flex flex-col gap-1 text-sm`,children:[`Email`,n(`input`,{type:`email`,required:!0,value:r,onInput:e=>a(e.currentTarget.value),class:`border border-stone-300 rounded-md px-3 py-2 bg-white`})]}),n(`label`,{class:`flex flex-col gap-1 text-sm`,children:[`Password`,n(`input`,{type:`password`,required:!0,value:o,onInput:e=>s(e.currentTarget.value),class:`border border-stone-300 rounded-md px-3 py-2 bg-white`})]}),c?n(`p`,{class:`text-sm text-red-700`,children:c}):null,n(`button`,{type:`submit`,disabled:u,class:`bg-stone-900 text-stone-50 rounded-md px-4 py-2 disabled:opacity-50`,children:u?`Signing in…`:`Sign in`})]})]})}var o=t({async data(e){return{user:await r(e)}},render:a});export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./hooks-Cz6AT21d.js";import{n as t}from"./honoto-client.js";import{t as n}from"./jsx-dev-runtime-92VDsVyo.js";import{t as r}from"./session-B-accyM3.js";import{t as i}from"./auth-client-D2Wtuobe.js";function a({data:t}){let[r,a]=e(``),[o,s]=e(``),[c,l]=e(``),[u,d]=e(null),[f,p]=e(!1);if(t.user)return n(`main`,{class:`max-w-md mx-auto px-4 py-12`,children:[n(`h1`,{class:`text-2xl font-semibold`,children:`You are signed in`}),n(`a`,{href:`/`,class:`inline-block mt-6 text-stone-800 underline`,children:`Go to feed`})]});async function m(e){e.preventDefault(),p(!0),d(null);let t=await i.signUp.email({name:r,email:o,password:c});if(p(!1),t.error){d(t.error.message??`Sign up failed`);return}window.location.href=`/`}return n(`main`,{class:`max-w-md mx-auto px-4 py-12`,children:[n(`h1`,{class:`text-2xl font-semibold`,children:`Create account`}),n(`p`,{class:`mt-2 text-stone-600 text-sm`,children:[`Already have one?`,` `,n(`a`,{href:`/sign-in`,class:`underline text-stone-800`,children:`Sign in`})]}),n(`form`,{class:`mt-8 flex flex-col gap-4`,onSubmit:m,children:[n(`label`,{class:`flex flex-col gap-1 text-sm`,children:[`Name`,n(`input`,{type:`text`,required:!0,value:r,onInput:e=>a(e.currentTarget.value),class:`border border-stone-300 rounded-md px-3 py-2 bg-white`})]}),n(`label`,{class:`flex flex-col gap-1 text-sm`,children:[`Email`,n(`input`,{type:`email`,required:!0,value:o,onInput:e=>s(e.currentTarget.value),class:`border border-stone-300 rounded-md px-3 py-2 bg-white`})]}),n(`label`,{class:`flex flex-col gap-1 text-sm`,children:[`Password`,n(`input`,{type:`password`,required:!0,minLength:8,value:c,onInput:e=>l(e.currentTarget.value),class:`border border-stone-300 rounded-md px-3 py-2 bg-white`})]}),u?n(`p`,{class:`text-sm text-red-700`,children:u}):null,n(`button`,{type:`submit`,disabled:f,class:`bg-stone-900 text-stone-50 rounded-md px-4 py-2 disabled:opacity-50`,children:f?`Creating…`:`Sign up`})]})]})}var o=t({async data(e){return{user:await r(e)}},render:a});export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>Honoto Store</title></head><body class="bg-stone-100 text-stone-900 min-h-screen"><nav class="flex flex-wrap items-center gap-4 p-4 bg-stone-900"><a href="/" class="text-stone-100 font-semibold no-underline tracking-wide">Honoto Store</a><div class="flex flex-wrap gap-4 text-sm items-center"><a href="/" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current border-current">Feed</a><a href="/saved" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current ">Saved</a><a href="/sign-in" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current ">Sign in</a><a href="/sign-up" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current ">Sign up</a></div></nav><div id="honoto-page"></div><script id="__HONOTO__" type="application/json">{"path":"/","params":{},"clientRouting":true,"clientPage":"/","partial":true}</script><script type="module" src="/assets/honoto-client.js"></script></body></html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>Honoto Store</title></head><body class="bg-stone-100 text-stone-900 min-h-screen"><nav class="flex flex-wrap items-center gap-4 p-4 bg-stone-900"><a href="/" class="text-stone-100 font-semibold no-underline tracking-wide">Honoto Store</a><div class="flex flex-wrap gap-4 text-sm items-center"><a href="/" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current ">Feed</a><a href="/saved" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current border-current">Saved</a><a href="/sign-in" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current ">Sign in</a><a href="/sign-up" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current ">Sign up</a></div></nav><div id="honoto-page"></div><script id="__HONOTO__" type="application/json">{"path":"/saved","params":{},"clientRouting":true,"clientPage":"/saved","partial":true}</script><script type="module" src="/assets/honoto-client.js"></script></body></html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>Honoto Store</title></head><body class="bg-stone-100 text-stone-900 min-h-screen"><nav class="flex flex-wrap items-center gap-4 p-4 bg-stone-900"><a href="/" class="text-stone-100 font-semibold no-underline tracking-wide">Honoto Store</a><div class="flex flex-wrap gap-4 text-sm items-center"><a href="/" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current ">Feed</a><a href="/saved" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current ">Saved</a><a href="/sign-in" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current border-current">Sign in</a><a href="/sign-up" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current ">Sign up</a></div></nav><div id="honoto-page"></div><script id="__HONOTO__" type="application/json">{"path":"/sign-in","params":{},"clientRouting":true,"clientPage":"/sign-in","partial":true}</script><script type="module" src="/assets/honoto-client.js"></script></body></html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>Honoto Store</title></head><body class="bg-stone-100 text-stone-900 min-h-screen"><nav class="flex flex-wrap items-center gap-4 p-4 bg-stone-900"><a href="/" class="text-stone-100 font-semibold no-underline tracking-wide">Honoto Store</a><div class="flex flex-wrap gap-4 text-sm items-center"><a href="/" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current ">Feed</a><a href="/saved" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current ">Saved</a><a href="/sign-in" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current ">Sign in</a><a href="/sign-up" class="text-stone-100 no-underline border-transparent border-b-2 hover:border-current border-current">Sign up</a></div></nav><div id="honoto-page"></div><script id="__HONOTO__" type="application/json">{"path":"/sign-up","params":{},"clientRouting":true,"clientPage":"/sign-up","partial":true}</script><script type="module" src="/assets/honoto-client.js"></script></body></html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
BETTER_AUTH_SECRET='dev-secret-change-me-in-production-32chars'
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"../../node_modules/.pnpm/@better-auth+kysely-adapter@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@bet_5fd430926dca70baa91453aa7860f913/node_modules/@better-auth/kysely-adapter/dist/bun-sqlite-dialect-C7ftEUSI.mjs": {
|
|
3
|
-
"file": "assets/bun-sqlite-dialect-C7ftEUSI-BeXpIqKl.js",
|
|
4
|
-
"name": "bun-sqlite-dialect-C7ftEUSI",
|
|
5
|
-
"src": "../../node_modules/.pnpm/@better-auth+kysely-adapter@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@bet_5fd430926dca70baa91453aa7860f913/node_modules/@better-auth/kysely-adapter/dist/bun-sqlite-dialect-C7ftEUSI.mjs",
|
|
6
|
-
"isDynamicEntry": true,
|
|
7
|
-
"imports": [
|
|
8
|
-
"_default-query-compiler-D7xOzCCJ.js",
|
|
9
|
-
"_compiled-query-DmoyCh28.js",
|
|
10
|
-
"_kysely-migration-tables-DFfmKhq--BtVr6hRe.js"
|
|
11
|
-
]
|
|
12
|
-
},
|
|
13
|
-
"../../node_modules/.pnpm/@better-auth+kysely-adapter@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@bet_5fd430926dca70baa91453aa7860f913/node_modules/@better-auth/kysely-adapter/dist/d1-sqlite-dialect-BZmaVTp8.mjs": {
|
|
14
|
-
"file": "assets/d1-sqlite-dialect-BZmaVTp8-CjJdvL94.js",
|
|
15
|
-
"name": "d1-sqlite-dialect-BZmaVTp8",
|
|
16
|
-
"src": "../../node_modules/.pnpm/@better-auth+kysely-adapter@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@bet_5fd430926dca70baa91453aa7860f913/node_modules/@better-auth/kysely-adapter/dist/d1-sqlite-dialect-BZmaVTp8.mjs",
|
|
17
|
-
"isDynamicEntry": true,
|
|
18
|
-
"imports": [
|
|
19
|
-
"_sqlite-adapter-DVlms5wO.js",
|
|
20
|
-
"_kysely-migration-tables-DFfmKhq--BtVr6hRe.js"
|
|
21
|
-
]
|
|
22
|
-
},
|
|
23
|
-
"../../node_modules/.pnpm/@better-auth+kysely-adapter@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@bet_5fd430926dca70baa91453aa7860f913/node_modules/@better-auth/kysely-adapter/dist/node-sqlite-dialect.mjs": {
|
|
24
|
-
"file": "assets/node-sqlite-dialect-D-wtYAD7.js",
|
|
25
|
-
"name": "node-sqlite-dialect",
|
|
26
|
-
"src": "../../node_modules/.pnpm/@better-auth+kysely-adapter@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@bet_5fd430926dca70baa91453aa7860f913/node_modules/@better-auth/kysely-adapter/dist/node-sqlite-dialect.mjs",
|
|
27
|
-
"isDynamicEntry": true,
|
|
28
|
-
"imports": [
|
|
29
|
-
"_default-query-compiler-D7xOzCCJ.js",
|
|
30
|
-
"_compiled-query-DmoyCh28.js",
|
|
31
|
-
"_kysely-migration-tables-DFfmKhq--BtVr6hRe.js"
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
"../../node_modules/.pnpm/@better-auth+memory-adapter@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@bet_e2933db5834ce8852fe6fb6f83f04210/node_modules/@better-auth/memory-adapter/dist/index.mjs": {
|
|
35
|
-
"file": "assets/dist-kFDN1l4Z.js",
|
|
36
|
-
"name": "dist",
|
|
37
|
-
"src": "../../node_modules/.pnpm/@better-auth+memory-adapter@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@bet_e2933db5834ce8852fe6fb6f83f04210/node_modules/@better-auth/memory-adapter/dist/index.mjs",
|
|
38
|
-
"isDynamicEntry": true,
|
|
39
|
-
"imports": [
|
|
40
|
-
"_factory-AD6s9SIW.js"
|
|
41
|
-
]
|
|
42
|
-
},
|
|
43
|
-
"../../node_modules/.pnpm/better-auth@1.7.1_@cloudflare+workers-types@4.20260702.1_drizzle-kit@0.31.10_drizzle-or_50a74384dde6bad88008886f8a6ac592/node_modules/better-auth/dist/adapters/kysely-adapter/index.mjs": {
|
|
44
|
-
"file": "assets/kysely-adapter-BCLenpM8.js",
|
|
45
|
-
"name": "kysely-adapter",
|
|
46
|
-
"src": "../../node_modules/.pnpm/better-auth@1.7.1_@cloudflare+workers-types@4.20260702.1_drizzle-kit@0.31.10_drizzle-or_50a74384dde6bad88008886f8a6ac592/node_modules/better-auth/dist/adapters/kysely-adapter/index.mjs",
|
|
47
|
-
"isDynamicEntry": true,
|
|
48
|
-
"imports": [
|
|
49
|
-
"_dist-LmmDoNdk.js"
|
|
50
|
-
]
|
|
51
|
-
},
|
|
52
|
-
"_BookmarkButton-KS7z5_vi.js": {
|
|
53
|
-
"file": "assets/BookmarkButton-KS7z5_vi.js",
|
|
54
|
-
"name": "BookmarkButton",
|
|
55
|
-
"imports": [
|
|
56
|
-
"_jsx-renderer-mMLf5XLN.js",
|
|
57
|
-
"_auth-DSFZ4iak.js"
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
"_auth-DSFZ4iak.js": {
|
|
61
|
-
"file": "assets/auth-DSFZ4iak.js",
|
|
62
|
-
"name": "auth",
|
|
63
|
-
"imports": [
|
|
64
|
-
"_jsx-renderer-mMLf5XLN.js",
|
|
65
|
-
"_factory-AD6s9SIW.js",
|
|
66
|
-
"_dist-LmmDoNdk.js",
|
|
67
|
-
"_compiled-query-DmoyCh28.js"
|
|
68
|
-
],
|
|
69
|
-
"dynamicImports": [
|
|
70
|
-
"src/pages/sign-in.tsx",
|
|
71
|
-
"src/layout/index.tsx",
|
|
72
|
-
"src/pages/sign-up.tsx",
|
|
73
|
-
"src/pages/saved.tsx",
|
|
74
|
-
"src/pages/index.tsx",
|
|
75
|
-
"src/pages/articles/[slug].tsx",
|
|
76
|
-
"../../node_modules/.pnpm/@better-auth+memory-adapter@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@bet_e2933db5834ce8852fe6fb6f83f04210/node_modules/@better-auth/memory-adapter/dist/index.mjs",
|
|
77
|
-
"../../node_modules/.pnpm/better-auth@1.7.1_@cloudflare+workers-types@4.20260702.1_drizzle-kit@0.31.10_drizzle-or_50a74384dde6bad88008886f8a6ac592/node_modules/better-auth/dist/adapters/kysely-adapter/index.mjs"
|
|
78
|
-
]
|
|
79
|
-
},
|
|
80
|
-
"_auth-client-BFSBVoML.js": {
|
|
81
|
-
"file": "assets/auth-client-BFSBVoML.js",
|
|
82
|
-
"name": "auth-client",
|
|
83
|
-
"imports": [
|
|
84
|
-
"_auth-DSFZ4iak.js",
|
|
85
|
-
"_dist-LmmDoNdk.js"
|
|
86
|
-
]
|
|
87
|
-
},
|
|
88
|
-
"_compiled-query-DmoyCh28.js": {
|
|
89
|
-
"file": "assets/compiled-query-DmoyCh28.js",
|
|
90
|
-
"name": "compiled-query",
|
|
91
|
-
"imports": [
|
|
92
|
-
"_default-query-compiler-D7xOzCCJ.js"
|
|
93
|
-
]
|
|
94
|
-
},
|
|
95
|
-
"_default-query-compiler-D7xOzCCJ.js": {
|
|
96
|
-
"file": "assets/default-query-compiler-D7xOzCCJ.js",
|
|
97
|
-
"name": "default-query-compiler"
|
|
98
|
-
},
|
|
99
|
-
"_dist-LmmDoNdk.js": {
|
|
100
|
-
"file": "assets/dist-LmmDoNdk.js",
|
|
101
|
-
"name": "dist",
|
|
102
|
-
"imports": [
|
|
103
|
-
"_factory-AD6s9SIW.js",
|
|
104
|
-
"_default-query-compiler-D7xOzCCJ.js",
|
|
105
|
-
"_compiled-query-DmoyCh28.js",
|
|
106
|
-
"_sqlite-adapter-DVlms5wO.js"
|
|
107
|
-
],
|
|
108
|
-
"dynamicImports": [
|
|
109
|
-
"../../node_modules/.pnpm/@better-auth+kysely-adapter@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@bet_5fd430926dca70baa91453aa7860f913/node_modules/@better-auth/kysely-adapter/dist/bun-sqlite-dialect-C7ftEUSI.mjs",
|
|
110
|
-
"../../node_modules/.pnpm/@better-auth+kysely-adapter@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@bet_5fd430926dca70baa91453aa7860f913/node_modules/@better-auth/kysely-adapter/dist/node-sqlite-dialect.mjs",
|
|
111
|
-
"../../node_modules/.pnpm/@better-auth+kysely-adapter@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@bet_5fd430926dca70baa91453aa7860f913/node_modules/@better-auth/kysely-adapter/dist/d1-sqlite-dialect-BZmaVTp8.mjs"
|
|
112
|
-
]
|
|
113
|
-
},
|
|
114
|
-
"_factory-AD6s9SIW.js": {
|
|
115
|
-
"file": "assets/factory-AD6s9SIW.js",
|
|
116
|
-
"name": "factory"
|
|
117
|
-
},
|
|
118
|
-
"_jsx-renderer-mMLf5XLN.js": {
|
|
119
|
-
"file": "assets/jsx-renderer-mMLf5XLN.js",
|
|
120
|
-
"name": "jsx-renderer"
|
|
121
|
-
},
|
|
122
|
-
"_kysely-migration-tables-DFfmKhq--BtVr6hRe.js": {
|
|
123
|
-
"file": "assets/kysely-migration-tables-DFfmKhq--BtVr6hRe.js",
|
|
124
|
-
"name": "kysely-migration-tables-DFfmKhq-"
|
|
125
|
-
},
|
|
126
|
-
"_session-BvIpX7tr.js": {
|
|
127
|
-
"file": "assets/session-BvIpX7tr.js",
|
|
128
|
-
"name": "session",
|
|
129
|
-
"imports": [
|
|
130
|
-
"_auth-DSFZ4iak.js"
|
|
131
|
-
]
|
|
132
|
-
},
|
|
133
|
-
"_sqlite-adapter-DVlms5wO.js": {
|
|
134
|
-
"file": "assets/sqlite-adapter-DVlms5wO.js",
|
|
135
|
-
"name": "sqlite-adapter",
|
|
136
|
-
"imports": [
|
|
137
|
-
"_default-query-compiler-D7xOzCCJ.js"
|
|
138
|
-
]
|
|
139
|
-
},
|
|
140
|
-
"src/layout/index.tsx": {
|
|
141
|
-
"file": "assets/layout-mVA7qP4j.js",
|
|
142
|
-
"name": "layout",
|
|
143
|
-
"src": "src/layout/index.tsx",
|
|
144
|
-
"isDynamicEntry": true,
|
|
145
|
-
"imports": [
|
|
146
|
-
"_jsx-renderer-mMLf5XLN.js"
|
|
147
|
-
]
|
|
148
|
-
},
|
|
149
|
-
"src/pages/articles/[slug].tsx": {
|
|
150
|
-
"file": "assets/_slug_-rRStRaAN.js",
|
|
151
|
-
"name": "_slug_",
|
|
152
|
-
"src": "src/pages/articles/[slug].tsx",
|
|
153
|
-
"isDynamicEntry": true,
|
|
154
|
-
"imports": [
|
|
155
|
-
"_jsx-renderer-mMLf5XLN.js",
|
|
156
|
-
"_auth-DSFZ4iak.js",
|
|
157
|
-
"_BookmarkButton-KS7z5_vi.js",
|
|
158
|
-
"_session-BvIpX7tr.js"
|
|
159
|
-
]
|
|
160
|
-
},
|
|
161
|
-
"src/pages/index.tsx": {
|
|
162
|
-
"file": "assets/pages-Do5kR_Ia.js",
|
|
163
|
-
"name": "pages",
|
|
164
|
-
"src": "src/pages/index.tsx",
|
|
165
|
-
"isDynamicEntry": true,
|
|
166
|
-
"imports": [
|
|
167
|
-
"_jsx-renderer-mMLf5XLN.js",
|
|
168
|
-
"_auth-DSFZ4iak.js",
|
|
169
|
-
"_BookmarkButton-KS7z5_vi.js",
|
|
170
|
-
"_session-BvIpX7tr.js"
|
|
171
|
-
]
|
|
172
|
-
},
|
|
173
|
-
"src/pages/saved.tsx": {
|
|
174
|
-
"file": "assets/saved-Dr4pP6B5.js",
|
|
175
|
-
"name": "saved",
|
|
176
|
-
"src": "src/pages/saved.tsx",
|
|
177
|
-
"isDynamicEntry": true,
|
|
178
|
-
"imports": [
|
|
179
|
-
"_jsx-renderer-mMLf5XLN.js",
|
|
180
|
-
"_auth-DSFZ4iak.js",
|
|
181
|
-
"_BookmarkButton-KS7z5_vi.js",
|
|
182
|
-
"_session-BvIpX7tr.js",
|
|
183
|
-
"_auth-client-BFSBVoML.js"
|
|
184
|
-
]
|
|
185
|
-
},
|
|
186
|
-
"src/pages/sign-in.tsx": {
|
|
187
|
-
"file": "assets/sign-in-22pzTnJE.js",
|
|
188
|
-
"name": "sign-in",
|
|
189
|
-
"src": "src/pages/sign-in.tsx",
|
|
190
|
-
"isDynamicEntry": true,
|
|
191
|
-
"imports": [
|
|
192
|
-
"_jsx-renderer-mMLf5XLN.js",
|
|
193
|
-
"_auth-DSFZ4iak.js",
|
|
194
|
-
"_session-BvIpX7tr.js",
|
|
195
|
-
"_auth-client-BFSBVoML.js"
|
|
196
|
-
]
|
|
197
|
-
},
|
|
198
|
-
"src/pages/sign-up.tsx": {
|
|
199
|
-
"file": "assets/sign-up-CN4j8Qg1.js",
|
|
200
|
-
"name": "sign-up",
|
|
201
|
-
"src": "src/pages/sign-up.tsx",
|
|
202
|
-
"isDynamicEntry": true,
|
|
203
|
-
"imports": [
|
|
204
|
-
"_jsx-renderer-mMLf5XLN.js",
|
|
205
|
-
"_auth-DSFZ4iak.js",
|
|
206
|
-
"_session-BvIpX7tr.js",
|
|
207
|
-
"_auth-client-BFSBVoML.js"
|
|
208
|
-
]
|
|
209
|
-
},
|
|
210
|
-
"virtual:cloudflare/worker-entry": {
|
|
211
|
-
"file": "index.js",
|
|
212
|
-
"name": "index",
|
|
213
|
-
"src": "virtual:cloudflare/worker-entry",
|
|
214
|
-
"isEntry": true,
|
|
215
|
-
"imports": [
|
|
216
|
-
"_auth-DSFZ4iak.js"
|
|
217
|
-
]
|
|
218
|
-
}
|
|
219
|
-
}
|
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
import { o as jsxDEV } from "./jsx-renderer-mMLf5XLN.js";
|
|
2
|
-
import { v as COMPONENT_TAG } from "./auth-DSFZ4iak.js";
|
|
3
|
-
//#region ../../dist/component-wrap.mjs
|
|
4
|
-
function serializeProps(props) {
|
|
5
|
-
const rest = {};
|
|
6
|
-
for (const [key, value] of Object.entries(props)) {
|
|
7
|
-
if (key === "children") continue;
|
|
8
|
-
if (typeof value === "function" || typeof value === "symbol") continue;
|
|
9
|
-
rest[key] = value;
|
|
10
|
-
}
|
|
11
|
-
return JSON.stringify(rest);
|
|
12
|
-
}
|
|
13
|
-
function wrapComponent(Component, componentId, exportName) {
|
|
14
|
-
function Wrapped(props = {}) {
|
|
15
|
-
return jsxDEV(COMPONENT_TAG, {
|
|
16
|
-
"data-component": componentId,
|
|
17
|
-
"data-export": exportName,
|
|
18
|
-
"data-props": serializeProps(props),
|
|
19
|
-
children: jsxDEV(Component, props)
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
Wrapped.displayName = `Honoto(${exportName})`;
|
|
23
|
-
return Wrapped;
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region \0virtual:honoto/ssr-hooks
|
|
27
|
-
function useState(initial) {
|
|
28
|
-
return [typeof initial === "function" ? initial() : initial, () => {}];
|
|
29
|
-
}
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region ../../node_modules/.pnpm/hono@4.13.3/node_modules/hono/dist/utils/cookie.js
|
|
32
|
-
var validCookieNameRegEx = /^[\w!#$%&'*.^`|~+-]+$/;
|
|
33
|
-
var _serialize = (name, value, opt = {}) => {
|
|
34
|
-
if (!validCookieNameRegEx.test(name)) throw new Error("Invalid cookie name");
|
|
35
|
-
let cookie = `${name}=${value}`;
|
|
36
|
-
if (name.startsWith("__Secure-") && !opt.secure) throw new Error("__Secure- Cookie must have Secure attributes");
|
|
37
|
-
if (name.startsWith("__Host-")) {
|
|
38
|
-
if (!opt.secure) throw new Error("__Host- Cookie must have Secure attributes");
|
|
39
|
-
if (opt.path !== "/") throw new Error("__Host- Cookie must have Path attributes with \"/\"");
|
|
40
|
-
if (opt.domain) throw new Error("__Host- Cookie must not have Domain attributes");
|
|
41
|
-
}
|
|
42
|
-
for (const key of [
|
|
43
|
-
"domain",
|
|
44
|
-
"path",
|
|
45
|
-
"sameSite",
|
|
46
|
-
"priority"
|
|
47
|
-
]) if (opt[key] && /[;\r\n]/.test(opt[key])) throw new Error(`${key} must not contain ";", "\\r", or "\\n"`);
|
|
48
|
-
if (opt && typeof opt.maxAge === "number" && opt.maxAge >= 0) {
|
|
49
|
-
if (opt.maxAge > 3456e4) throw new Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");
|
|
50
|
-
cookie += `; Max-Age=${opt.maxAge | 0}`;
|
|
51
|
-
}
|
|
52
|
-
if (opt.domain && opt.prefix !== "host") cookie += `; Domain=${opt.domain}`;
|
|
53
|
-
if (opt.path) cookie += `; Path=${opt.path}`;
|
|
54
|
-
if (opt.expires) {
|
|
55
|
-
if (opt.expires.getTime() - Date.now() > 3456e7) throw new Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");
|
|
56
|
-
cookie += `; Expires=${opt.expires.toUTCString()}`;
|
|
57
|
-
}
|
|
58
|
-
if (opt.httpOnly) cookie += "; HttpOnly";
|
|
59
|
-
if (opt.secure) cookie += "; Secure";
|
|
60
|
-
if (opt.sameSite) cookie += `; SameSite=${opt.sameSite.charAt(0).toUpperCase() + opt.sameSite.slice(1)}`;
|
|
61
|
-
if (opt.priority) cookie += `; Priority=${opt.priority.charAt(0).toUpperCase() + opt.priority.slice(1)}`;
|
|
62
|
-
if (opt.partitioned) {
|
|
63
|
-
if (!opt.secure) throw new Error("Partitioned Cookie must have Secure attributes");
|
|
64
|
-
cookie += "; Partitioned";
|
|
65
|
-
}
|
|
66
|
-
return cookie;
|
|
67
|
-
};
|
|
68
|
-
var serialize = (name, value, opt) => {
|
|
69
|
-
value = encodeURIComponent(value);
|
|
70
|
-
return _serialize(name, value, opt);
|
|
71
|
-
};
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region ../../node_modules/.pnpm/hono@4.13.3/node_modules/hono/dist/client/utils.js
|
|
74
|
-
var mergePath = (base, path) => {
|
|
75
|
-
base = base.replace(/\/+$/, "");
|
|
76
|
-
base = base + "/";
|
|
77
|
-
path = path.replace(/^\/+/, "");
|
|
78
|
-
return base + path;
|
|
79
|
-
};
|
|
80
|
-
var replaceUrlParam = (urlString, params) => {
|
|
81
|
-
for (const [k, v] of Object.entries(params)) {
|
|
82
|
-
const reg = new RegExp("/:" + k + "(?:{[^/]+})?\\??(?=/|$)");
|
|
83
|
-
urlString = urlString.replace(reg, () => v ? `/${v}` : "");
|
|
84
|
-
}
|
|
85
|
-
return urlString;
|
|
86
|
-
};
|
|
87
|
-
var buildSearchParams = (query) => {
|
|
88
|
-
const searchParams = new URLSearchParams();
|
|
89
|
-
for (const [k, v] of Object.entries(query)) {
|
|
90
|
-
if (v === void 0) continue;
|
|
91
|
-
if (Array.isArray(v)) for (const v2 of v) searchParams.append(k, v2);
|
|
92
|
-
else searchParams.set(k, v);
|
|
93
|
-
}
|
|
94
|
-
return searchParams;
|
|
95
|
-
};
|
|
96
|
-
var replaceUrlProtocol = (urlString, protocol) => {
|
|
97
|
-
switch (protocol) {
|
|
98
|
-
case "ws": return urlString.replace(/^http/, "ws");
|
|
99
|
-
case "http": return urlString.replace(/^ws/, "http");
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
var removeIndexString = (urlString) => {
|
|
103
|
-
if (/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(urlString)) return urlString.replace(/\/index(?=\?|$)/, "/");
|
|
104
|
-
return urlString.replace(/\/index(?=\?|$)/, "");
|
|
105
|
-
};
|
|
106
|
-
function isObject(item) {
|
|
107
|
-
return typeof item === "object" && item !== null && !Array.isArray(item);
|
|
108
|
-
}
|
|
109
|
-
function deepMerge(target, source) {
|
|
110
|
-
if (!isObject(target) && !isObject(source)) return source;
|
|
111
|
-
const merged = { ...target };
|
|
112
|
-
for (const key in source) {
|
|
113
|
-
const value = source[key];
|
|
114
|
-
if (isObject(merged[key]) && isObject(value)) merged[key] = deepMerge(merged[key], value);
|
|
115
|
-
else merged[key] = value;
|
|
116
|
-
}
|
|
117
|
-
return merged;
|
|
118
|
-
}
|
|
119
|
-
//#endregion
|
|
120
|
-
//#region ../../node_modules/.pnpm/hono@4.13.3/node_modules/hono/dist/client/client.js
|
|
121
|
-
var createProxy = (callback, path) => {
|
|
122
|
-
return new Proxy(() => {}, {
|
|
123
|
-
get(_obj, key) {
|
|
124
|
-
if (typeof key !== "string" || key === "then") return;
|
|
125
|
-
return createProxy(callback, [...path, key]);
|
|
126
|
-
},
|
|
127
|
-
apply(_1, _2, args) {
|
|
128
|
-
return callback({
|
|
129
|
-
path,
|
|
130
|
-
args
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
var ClientRequestImpl = class {
|
|
136
|
-
url;
|
|
137
|
-
method;
|
|
138
|
-
buildSearchParams;
|
|
139
|
-
queryParams = void 0;
|
|
140
|
-
pathParams = {};
|
|
141
|
-
rBody;
|
|
142
|
-
cType = void 0;
|
|
143
|
-
constructor(url, method, options) {
|
|
144
|
-
this.url = url;
|
|
145
|
-
this.method = method;
|
|
146
|
-
this.buildSearchParams = options.buildSearchParams;
|
|
147
|
-
}
|
|
148
|
-
fetch = async (args, opt) => {
|
|
149
|
-
if (args) {
|
|
150
|
-
if (args.query) this.queryParams = this.buildSearchParams(args.query);
|
|
151
|
-
if (args.form) {
|
|
152
|
-
const form = new FormData();
|
|
153
|
-
for (const [k, v] of Object.entries(args.form)) {
|
|
154
|
-
if (v === void 0) continue;
|
|
155
|
-
if (Array.isArray(v)) for (const v2 of v) form.append(k, v2);
|
|
156
|
-
else form.append(k, v);
|
|
157
|
-
}
|
|
158
|
-
this.rBody = form;
|
|
159
|
-
}
|
|
160
|
-
if (args.json !== void 0) {
|
|
161
|
-
this.rBody = JSON.stringify(args.json);
|
|
162
|
-
this.cType = "application/json";
|
|
163
|
-
}
|
|
164
|
-
if (args.param) this.pathParams = args.param;
|
|
165
|
-
}
|
|
166
|
-
let methodUpperCase = this.method.toUpperCase();
|
|
167
|
-
const headerValues = {
|
|
168
|
-
...args?.header,
|
|
169
|
-
...typeof opt?.headers === "function" ? await opt.headers() : opt?.headers
|
|
170
|
-
};
|
|
171
|
-
if (args?.cookie) {
|
|
172
|
-
const cookies = [];
|
|
173
|
-
for (const [key, value] of Object.entries(args.cookie)) cookies.push(serialize(key, value));
|
|
174
|
-
headerValues["Cookie"] = cookies.join("; ");
|
|
175
|
-
}
|
|
176
|
-
if (this.cType) headerValues["Content-Type"] = this.cType;
|
|
177
|
-
const headers = new Headers(headerValues ?? void 0);
|
|
178
|
-
let url = this.url;
|
|
179
|
-
url = removeIndexString(url);
|
|
180
|
-
url = replaceUrlParam(url, this.pathParams);
|
|
181
|
-
if (this.queryParams) url = url + "?" + this.queryParams.toString();
|
|
182
|
-
methodUpperCase = this.method.toUpperCase();
|
|
183
|
-
const setBody = !(methodUpperCase === "GET" || methodUpperCase === "HEAD");
|
|
184
|
-
return (opt?.fetch || fetch)(url, {
|
|
185
|
-
body: setBody ? this.rBody : void 0,
|
|
186
|
-
method: methodUpperCase,
|
|
187
|
-
headers,
|
|
188
|
-
...opt?.init
|
|
189
|
-
});
|
|
190
|
-
};
|
|
191
|
-
};
|
|
192
|
-
var hc = (baseUrl, options) => createProxy(function proxyCallback(opts) {
|
|
193
|
-
const buildSearchParamsOption = options?.buildSearchParams ?? buildSearchParams;
|
|
194
|
-
const parts = [...opts.path];
|
|
195
|
-
const lastParts = parts.slice(-3).reverse();
|
|
196
|
-
if (lastParts[0] === "toString") {
|
|
197
|
-
if (lastParts[1] === "name") return lastParts[2] || "";
|
|
198
|
-
return proxyCallback.toString();
|
|
199
|
-
}
|
|
200
|
-
if (lastParts[0] === "valueOf") {
|
|
201
|
-
if (lastParts[1] === "name") return lastParts[2] || "";
|
|
202
|
-
return proxyCallback;
|
|
203
|
-
}
|
|
204
|
-
let method = "";
|
|
205
|
-
if (/^\$/.test(lastParts[0])) {
|
|
206
|
-
const last = parts.pop();
|
|
207
|
-
if (last) method = last.replace(/^\$/, "");
|
|
208
|
-
}
|
|
209
|
-
const url = mergePath(baseUrl, parts.join("/"));
|
|
210
|
-
if (method === "url" || method === "path") {
|
|
211
|
-
let result = url;
|
|
212
|
-
if (opts.args[0]) {
|
|
213
|
-
if (opts.args[0].param) result = replaceUrlParam(url, opts.args[0].param);
|
|
214
|
-
if (opts.args[0].query) result = result + "?" + buildSearchParamsOption(opts.args[0].query).toString();
|
|
215
|
-
}
|
|
216
|
-
result = removeIndexString(result);
|
|
217
|
-
if (method === "url") return new URL(result);
|
|
218
|
-
return result.slice(baseUrl.replace(/\/+$/, "").length).replace(/^\/?/, "/");
|
|
219
|
-
}
|
|
220
|
-
if (method === "ws") {
|
|
221
|
-
const webSocketUrl = replaceUrlProtocol(opts.args[0] && opts.args[0].param ? replaceUrlParam(url, opts.args[0].param) : url, "ws");
|
|
222
|
-
const targetUrl = new URL(webSocketUrl);
|
|
223
|
-
const queryParams = opts.args[0]?.query;
|
|
224
|
-
if (queryParams) Object.entries(queryParams).forEach(([key, value]) => {
|
|
225
|
-
if (Array.isArray(value)) value.forEach((item) => targetUrl.searchParams.append(key, item));
|
|
226
|
-
else targetUrl.searchParams.set(key, value);
|
|
227
|
-
});
|
|
228
|
-
const establishWebSocket = (...args) => {
|
|
229
|
-
if (options?.webSocket !== void 0 && typeof options.webSocket === "function") return options.webSocket(...args);
|
|
230
|
-
return new WebSocket(...args);
|
|
231
|
-
};
|
|
232
|
-
return establishWebSocket(targetUrl.toString());
|
|
233
|
-
}
|
|
234
|
-
const req = new ClientRequestImpl(url, method, { buildSearchParams: buildSearchParamsOption });
|
|
235
|
-
if (method) {
|
|
236
|
-
options ??= {};
|
|
237
|
-
const reqOptions = { ...opts.args[1] };
|
|
238
|
-
const baseHeaders = options.headers;
|
|
239
|
-
const reqHeaders = reqOptions.headers;
|
|
240
|
-
if (baseHeaders && reqHeaders) reqOptions.headers = async () => ({
|
|
241
|
-
...typeof baseHeaders === "function" ? await baseHeaders() : baseHeaders,
|
|
242
|
-
...typeof reqHeaders === "function" ? await reqHeaders() : reqHeaders
|
|
243
|
-
});
|
|
244
|
-
const args = deepMerge(options, reqOptions);
|
|
245
|
-
return req.fetch(opts.args[0], args);
|
|
246
|
-
}
|
|
247
|
-
return req;
|
|
248
|
-
}, []);
|
|
249
|
-
//#endregion
|
|
250
|
-
//#region src/lib/api-client.ts
|
|
251
|
-
var api = hc("/");
|
|
252
|
-
//#endregion
|
|
253
|
-
//#region src/components/BookmarkButton.tsx
|
|
254
|
-
function BookmarkButton(props) {
|
|
255
|
-
const [bookmarked, setBookmarked] = useState(props.initialBookmarked ?? false);
|
|
256
|
-
const [pending, setPending] = useState(false);
|
|
257
|
-
const [error, setError] = useState(null);
|
|
258
|
-
async function toggle() {
|
|
259
|
-
if (!props.signedIn) {
|
|
260
|
-
window.location.href = "/sign-in";
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
if (pending) return;
|
|
264
|
-
setPending(true);
|
|
265
|
-
setError(null);
|
|
266
|
-
try {
|
|
267
|
-
if (bookmarked) {
|
|
268
|
-
if (!(await api.api.bookmarks[":articleId"].$delete({ param: { articleId: props.articleId } })).ok) throw new Error("Failed to remove bookmark");
|
|
269
|
-
setBookmarked(false);
|
|
270
|
-
} else {
|
|
271
|
-
if (!(await api.api.bookmarks.$post({ json: { articleId: props.articleId } })).ok) throw new Error("Failed to save bookmark");
|
|
272
|
-
setBookmarked(true);
|
|
273
|
-
}
|
|
274
|
-
} catch (e) {
|
|
275
|
-
setError(e instanceof Error ? e.message : "Something went wrong");
|
|
276
|
-
} finally {
|
|
277
|
-
setPending(false);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
return /* @__PURE__ */ jsxDEV("span", {
|
|
281
|
-
class: "inline-flex flex-col items-start gap-1",
|
|
282
|
-
children: [/* @__PURE__ */ jsxDEV("button", {
|
|
283
|
-
type: "button",
|
|
284
|
-
onClick: toggle,
|
|
285
|
-
disabled: pending,
|
|
286
|
-
class: `text-sm px-3 py-1.5 rounded-md border ${bookmarked ? "bg-stone-900 text-stone-50 border-stone-900" : "bg-white text-stone-800 border-stone-300 hover:border-stone-500"} disabled:opacity-50`,
|
|
287
|
-
children: bookmarked ? "Saved" : "Save"
|
|
288
|
-
}), error ? /* @__PURE__ */ jsxDEV("span", {
|
|
289
|
-
class: "text-xs text-red-700",
|
|
290
|
-
children: error
|
|
291
|
-
}) : null]
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
//#endregion
|
|
295
|
-
//#region src/components/BookmarkButton.tsx?honoto-wrap
|
|
296
|
-
var BookmarkButton_default = wrapComponent(BookmarkButton, "/src/components/BookmarkButton.tsx", "default");
|
|
297
|
-
//#endregion
|
|
298
|
-
export { api as n, BookmarkButton_default as t };
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { o as jsxDEV } from "./jsx-renderer-mMLf5XLN.js";
|
|
2
|
-
import { _ as defineServerPage, d as eq, i as bookmarks, n as createDb, r as articles, u as and } from "./auth-DSFZ4iak.js";
|
|
3
|
-
import { t as BookmarkButton_default } from "./BookmarkButton-KS7z5_vi.js";
|
|
4
|
-
import { t as getSessionUser } from "./session-BvIpX7tr.js";
|
|
5
|
-
//#region src/pages/articles/[slug].tsx
|
|
6
|
-
var _slug__default = defineServerPage({
|
|
7
|
-
async data(c) {
|
|
8
|
-
const env = c.env;
|
|
9
|
-
const db = createDb(env.DB);
|
|
10
|
-
const user = await getSessionUser(c);
|
|
11
|
-
const slug = c.req.param("slug");
|
|
12
|
-
const row = await db.select().from(articles).where(eq(articles.slug, slug)).get();
|
|
13
|
-
if (!row) return {
|
|
14
|
-
user,
|
|
15
|
-
article: null,
|
|
16
|
-
bookmarked: false
|
|
17
|
-
};
|
|
18
|
-
let bookmarked = false;
|
|
19
|
-
if (user) {
|
|
20
|
-
const saved = await db.select().from(bookmarks).where(and(eq(bookmarks.userId, user.id), eq(bookmarks.articleId, row.id))).get();
|
|
21
|
-
bookmarked = Boolean(saved);
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
user,
|
|
25
|
-
bookmarked,
|
|
26
|
-
article: {
|
|
27
|
-
id: row.id,
|
|
28
|
-
slug: row.slug,
|
|
29
|
-
title: row.title,
|
|
30
|
-
excerpt: row.excerpt,
|
|
31
|
-
body: row.body,
|
|
32
|
-
author: row.author,
|
|
33
|
-
publishedAt: row.publishedAt instanceof Date ? row.publishedAt.toISOString() : String(row.publishedAt)
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
render({ data }) {
|
|
38
|
-
if (!data.article) return /* @__PURE__ */ jsxDEV("main", {
|
|
39
|
-
class: "max-w-2xl mx-auto px-4 py-8",
|
|
40
|
-
children: [/* @__PURE__ */ jsxDEV("h1", {
|
|
41
|
-
class: "text-2xl font-semibold",
|
|
42
|
-
children: "Article not found"
|
|
43
|
-
}), /* @__PURE__ */ jsxDEV("a", {
|
|
44
|
-
href: "/",
|
|
45
|
-
class: "text-stone-600 underline mt-4 inline-block",
|
|
46
|
-
children: "Back to feed"
|
|
47
|
-
})]
|
|
48
|
-
});
|
|
49
|
-
const { article } = data;
|
|
50
|
-
return /* @__PURE__ */ jsxDEV("main", {
|
|
51
|
-
class: "max-w-2xl mx-auto px-4 py-8",
|
|
52
|
-
children: [
|
|
53
|
-
/* @__PURE__ */ jsxDEV("a", {
|
|
54
|
-
href: "/",
|
|
55
|
-
class: "text-sm text-stone-500 no-underline hover:underline",
|
|
56
|
-
children: "← Feed"
|
|
57
|
-
}),
|
|
58
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
59
|
-
class: "flex items-start justify-between gap-4 mt-4",
|
|
60
|
-
children: [/* @__PURE__ */ jsxDEV("div", { children: [/* @__PURE__ */ jsxDEV("h1", {
|
|
61
|
-
class: "text-3xl font-semibold tracking-tight",
|
|
62
|
-
children: article.title
|
|
63
|
-
}), /* @__PURE__ */ jsxDEV("p", {
|
|
64
|
-
class: "text-sm text-stone-500 mt-2",
|
|
65
|
-
children: [
|
|
66
|
-
article.author,
|
|
67
|
-
" · ",
|
|
68
|
-
new Date(article.publishedAt).toLocaleDateString()
|
|
69
|
-
]
|
|
70
|
-
})] }), /* @__PURE__ */ jsxDEV(BookmarkButton_default, {
|
|
71
|
-
articleId: article.id,
|
|
72
|
-
initialBookmarked: data.bookmarked,
|
|
73
|
-
signedIn: Boolean(data.user)
|
|
74
|
-
})]
|
|
75
|
-
}),
|
|
76
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
77
|
-
class: "mt-6 text-lg text-stone-600 leading-relaxed",
|
|
78
|
-
children: article.excerpt
|
|
79
|
-
}),
|
|
80
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
81
|
-
class: "mt-8 text-stone-800 leading-7 whitespace-pre-wrap",
|
|
82
|
-
children: article.body
|
|
83
|
-
})
|
|
84
|
-
]
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
//#endregion
|
|
89
|
-
export { _slug__default as default };
|