From 43fbe0ad1d0a8529dc05ae54afd8ee746b335554 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath <2+defunkt@users.noreply.github.com> Date: Tue, 16 Sep 2025 20:20:37 -0700 Subject: [PATCH] app -> www --- nose/{app => www}/dir/index.tsx | 0 nose/{app => www}/dir/other.ts | 0 nose/{app => www}/hello.ts | 0 nose/{app => www}/jsx.tsx | 0 nose/{app => www}/ping.ts | 0 nose/{app => www}/routes.tsx | 0 src/config.ts | 2 +- src/server.tsx | 4 ++-- src/webapp.ts | 12 ++++++------ 9 files changed, 9 insertions(+), 9 deletions(-) rename nose/{app => www}/dir/index.tsx (100%) rename nose/{app => www}/dir/other.ts (100%) rename nose/{app => www}/hello.ts (100%) rename nose/{app => www}/jsx.tsx (100%) rename nose/{app => www}/ping.ts (100%) rename nose/{app => www}/routes.tsx (100%) diff --git a/nose/app/dir/index.tsx b/nose/www/dir/index.tsx similarity index 100% rename from nose/app/dir/index.tsx rename to nose/www/dir/index.tsx diff --git a/nose/app/dir/other.ts b/nose/www/dir/other.ts similarity index 100% rename from nose/app/dir/other.ts rename to nose/www/dir/other.ts diff --git a/nose/app/hello.ts b/nose/www/hello.ts similarity index 100% rename from nose/app/hello.ts rename to nose/www/hello.ts diff --git a/nose/app/jsx.tsx b/nose/www/jsx.tsx similarity index 100% rename from nose/app/jsx.tsx rename to nose/www/jsx.tsx diff --git a/nose/app/ping.ts b/nose/www/ping.ts similarity index 100% rename from nose/app/ping.ts rename to nose/www/ping.ts diff --git a/nose/app/routes.tsx b/nose/www/routes.tsx similarity index 100% rename from nose/app/routes.tsx rename to nose/www/routes.tsx diff --git a/src/config.ts b/src/config.ts index 1ad059a..8224b03 100644 --- a/src/config.ts +++ b/src/config.ts @@ -3,4 +3,4 @@ import { resolve, join } from "node:path" export const NOSE_ICON = ` ͡° ͜ʖ ͡°` export const NOSE_DIR = resolve("./nose") export const NOSE_BIN = resolve(join(NOSE_DIR, "bin")) -export const NOSE_APP = resolve(join(NOSE_DIR, "app")) \ No newline at end of file +export const NOSE_WWW = resolve(join(NOSE_DIR, "www")) \ No newline at end of file diff --git a/src/server.tsx b/src/server.tsx index 25a7039..53e5dc2 100644 --- a/src/server.tsx +++ b/src/server.tsx @@ -3,7 +3,7 @@ import { serveStatic } from "hono/bun" import { prettyJSON } from "hono/pretty-json" import color from "kleur" -import { NOSE_ICON, NOSE_DIR, NOSE_BIN, NOSE_APP } from "./config" +import { NOSE_ICON, NOSE_DIR, NOSE_BIN, NOSE_WWW } from "./config" import { transpile, isFile } from "./utils" import { apps, serveApp } from "./webapp" @@ -104,7 +104,7 @@ if (process.env.BUN_HOT) { console.log(color.cyan(NOSE_ICON)) console.log(color.blue("NOSE_DIR:"), color.yellow(NOSE_DIR)) console.log(color.blue("NOSE_BIN:"), color.yellow(NOSE_BIN)) -console.log(color.blue("NOSE_APP:"), color.yellow(NOSE_APP)) +console.log(color.blue("NOSE_WWW:"), color.yellow(NOSE_WWW)) export default { port: process.env.PORT || 3000, diff --git a/src/webapp.ts b/src/webapp.ts index 20a2a44..3b6dc1b 100644 --- a/src/webapp.ts +++ b/src/webapp.ts @@ -3,7 +3,7 @@ import type { Child } from "hono/jsx" import { renderToString } from "hono/jsx/dom/server" import { join } from "node:path" import { readdirSync } from "node:fs" -import { NOSE_APP } from "./config" +import { NOSE_WWW } from "./config" import { isFile } from "./utils" export type Handler = (r: Context) => string | Child | Response | Promise @@ -23,26 +23,26 @@ export async function serveApp(c: Context, subdomain: string): Promise export function apps(): string[] { const apps: string[] = [] - for (const entry of readdirSync(NOSE_APP)) + for (const entry of readdirSync(NOSE_WWW)) apps.push(entry.replace(/\.tsx?/, "")) return apps } async function findApp(name: string): Promise { - let path = join(NOSE_APP, `${name}.ts`) + let path = join(NOSE_WWW, `${name}.ts`) let app = await loadApp(path) if (app) return app - path = join(NOSE_APP, `${name}.tsx`) + path = join(NOSE_WWW, `${name}.tsx`) app = await loadApp(path) if (app) return app - path = join(NOSE_APP, name, "index.ts") + path = join(NOSE_WWW, name, "index.ts") app = await loadApp(path) if (app) return app - path = join(NOSE_APP, name, "index.tsx") + path = join(NOSE_WWW, name, "index.tsx") app = await loadApp(path) if (app) return app