1+ import { WaveKitResponse } from "@wavekit/kit" ;
2+ import { wave } from "@wavekit/wave" ;
13import type { BunRequest } from "bun" ;
4+ import dedent from "dedent" ;
5+ import { createHighlighter } from "shiki" ;
26import { Layout } from "../src/components/layout" ;
3- import { wave } from "@wavekit/wave" ;
4- import { WaveKitResponse } from "@wavekit/kit" ;
5- import dedent from 'dedent'
6- import { createHighlighter } from "shiki"
77
88const waveKitServerCode = dedent `
99 // src/index.ts
@@ -13,7 +13,7 @@ const waveKitServerCode = dedent`
1313 console.log("Serving on http://localhost:3000")
1414 Bun.serve({ port: 3000, routes })
1515 })
16- `
16+ ` ;
1717
1818const waveKitAppCode = dedent `
1919 // app/index.ts
@@ -30,38 +30,47 @@ const waveKitAppCode = dedent`
3030 })
3131 )
3232 }
33- `
33+ ` ;
3434
3535export async function GET ( req : BunRequest ) {
3636 const highlighter = await createHighlighter ( {
3737 themes : [ "github-dark" ] ,
3838 langs : [ "typescript" ] ,
39- } )
39+ } ) ;
4040 return WaveKitResponse . html (
4141 Layout (
42- wave
43- . div ( { style : "margin-top: 6rem;" } , ( div ) => {
44- div
45- . h1 ( "The minimalist Bun web framework." )
46- . p ( "WaveKit is a tiny framework built on top of Bun HTTP." )
47- . h2 ( "Features" )
48- . ul ( ( ul ) => {
49- ul
50- . li ( "Next.js style routing" )
51- . li ( "Zero extra dependencies" )
52- . li ( "Lightweight templating engine" )
53- . li ( "Works flawlessly with HTMX and Alpine.js" )
54- } )
55- . div ( { style : "margin-top: 6rem;" } , ( div ) => {
56- div
57- . h2 ( "Getting started" )
58- . p ( "The kit is a web server library. Use it like:" )
59- . h3 ( "Install" )
60- . code ( "bun add @wavekit/wave @wavekit/kit" )
61- . h3 ( "Usage" )
62- . div ( highlighter . codeToHtml ( waveKitServerCode , { lang : "typescript" , theme : "github-dark" } ) )
63- . div ( highlighter . codeToHtml ( waveKitAppCode , { lang : "typescript" , theme : "github-dark" } ) )
64- } )
65- } ) )
66- )
42+ wave . div ( { style : "margin-top: 6rem;" } , ( div ) => {
43+ div
44+ . h1 ( "The minimalist Bun web framework." )
45+ . p ( "WaveKit is a tiny framework built on top of Bun HTTP." )
46+ . h2 ( "Features" )
47+ . ul ( ( ul ) => {
48+ ul . li ( "Next.js style routing" )
49+ . li ( "Zero extra dependencies" )
50+ . li ( "Lightweight templating engine" )
51+ . li ( "Works flawlessly with HTMX and Alpine.js" ) ;
52+ } )
53+ . div ( { style : "margin-top: 6rem;" } , ( div ) => {
54+ div
55+ . h2 ( "Getting started" )
56+ . p ( "The kit is a web server library. Use it like:" )
57+ . h3 ( "Install" )
58+ . code ( "bun add @wavekit/wave @wavekit/kit" )
59+ . h3 ( "Usage" )
60+ . div (
61+ highlighter . codeToHtml ( waveKitServerCode , {
62+ lang : "typescript" ,
63+ theme : "github-dark" ,
64+ } ) ,
65+ )
66+ . div (
67+ highlighter . codeToHtml ( waveKitAppCode , {
68+ lang : "typescript" ,
69+ theme : "github-dark" ,
70+ } ) ,
71+ ) ;
72+ } ) ;
73+ } ) ,
74+ ) ,
75+ ) ;
6776}
0 commit comments