From 465ed69fc35f38fac86e5d2e709acbcf573eb678 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath <2+defunkt@users.noreply.github.com> Date: Mon, 15 Sep 2025 14:27:15 -0700 Subject: [PATCH] great stuff --- nose/app/dir/index.ts | 4 ---- nose/app/dir/index.tsx | 36 ++++++++++++++++++++++++++++++++++++ package.json | 4 ++++ src/utils.tsx | 20 ++++++++++++++++++++ tsconfig.json | 9 ++++++++- 5 files changed, 68 insertions(+), 5 deletions(-) delete mode 100644 nose/app/dir/index.ts create mode 100644 nose/app/dir/index.tsx diff --git a/nose/app/dir/index.ts b/nose/app/dir/index.ts deleted file mode 100644 index b48fc6a..0000000 --- a/nose/app/dir/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { text } from "./other" - -export default (c: Context) => - c.text(text) \ No newline at end of file diff --git a/nose/app/dir/index.tsx b/nose/app/dir/index.tsx new file mode 100644 index 0000000..8f4cb9d --- /dev/null +++ b/nose/app/dir/index.tsx @@ -0,0 +1,36 @@ +import { text } from "./other" +import { css } from "@utils" + +export default (c: Context) => { + return <> + {css` + body { + background-color: cyan; + font-family: "Comic Sans MS", "Comic Sans", "Chalkboard", "Comic Neue", cursive; + } + + main { + width: 500px; + margin: 0 auto; + } + + h1 { + color: red; + border-bottom: 1px dashed red; + } + + p { + color: magenta; + font-size: 18px; + + } + `} + +
+

{text}

+

+ This is a really nice website. I'm glad you like it. +

+
+ +} \ No newline at end of file diff --git a/package.json b/package.json index 25b7495..d8c569e 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,10 @@ "start": "bun src/server.ts", "dev": "bun --hot src/server.ts" }, + "alias": { + "@utils": "./src/utils.tsx", + "@/*": "./src/*" + }, "devDependencies": { "@types/bun": "latest" }, diff --git a/src/utils.tsx b/src/utils.tsx index 844a5ea..84ac7f7 100644 --- a/src/utils.tsx +++ b/src/utils.tsx @@ -45,3 +45,23 @@ export async function transpile(path: string): Promise { return cached } + +// +// webapp utils (for writing webapps) +// + +export function css(strings: TemplateStringsArray, ...values: any[]) { + return