Compare commits

...

2 Commits

Author SHA1 Message Date
Chris Wanstrath
33d228c9ac organize src/ 2026-01-15 12:54:33 -08:00
Chris Wanstrath
e938d15dc6 src/js/ => src/client/ 2026-01-15 12:54:28 -08:00
10 changed files with 11 additions and 6 deletions

5
CHANGELOG.md Normal file
View File

@ -0,0 +1,5 @@
## 2026-01-15
- All frontend code now lives in `src/client/`
- All backend code now lives in `src/server/`
- ^^ This is a change from `src/js/` being for frontend and just `src/` for backend

View File

@ -12,7 +12,7 @@
"hype": "file:..",
},
"scripts": {
"start": "bun run src/server.ts",
"dev": "bun run --hot src/server.ts"
"start": "bun run src/server/index.ts",
"dev": "bun run --hot src/server/index.ts"
}
}

View File

@ -9,8 +9,8 @@ import defaultLayout from './layout'
import { feFunctions, fnStorage } from './frontend'
const SHOW_HTTP_LOG = true
const CSS_RESET = await Bun.file(join(import.meta.dir, '/reset.css')).text()
const PICO_CSS = await Bun.file(join(import.meta.dir, '/pico.css')).text()
const CSS_RESET = await Bun.file(join(import.meta.dir, '/css/reset.css')).text()
const PICO_CSS = await Bun.file(join(import.meta.dir, '/css/pico.css')).text()
export * from './utils'
export { frontend } from './frontend'
@ -116,7 +116,7 @@ export class Hype<
this.get('/css/pico.css', async c => new Response(PICO_CSS, { headers: { 'Content-Type': 'text/css' } }))
// serve transpiled js
this.on('GET', ['/js/:path{.+}', '/shared/:path{.+}'], async c => {
this.on('GET', ['/client/:path{.+}', '/shared/:path{.+}'], async c => {
let path = './src/' + c.req.path.replace('..', '.')
// path must end in .js or .ts

View File

@ -11,7 +11,7 @@ const Layout: FC = ({ children, title, props }) =>
{props.reset && <link href="/css/reset.css" rel="stylesheet" />}
{props.pico && <link href="/css/pico.css" rel="stylesheet" />}
<link href="/css/main.css" rel="stylesheet" />
<script src="/js/main.ts" type="module"></script>
<script src="/client/main.ts" type="module"></script>
</head>
<body>
<main>