Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/app-mastro/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
node_modules/
/generated/
/generatedAssets.json
20 changes: 20 additions & 0 deletions packages/app-mastro/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
We're using the Mastro web framework.

- Use web search with `site:mastrojs.github.io` to look up Mastro docs.
- Use web search with `site:developer.mozilla.org` to look up web platform
features (or the [modern-web-guidance](https://developer.chrome.com/docs/modern-web-guidance) skills).
Use web APIs if they are "Baseline Widely available".
- Write semantic HTML.
- CSS
- Never add inline CSS
- Avoid adding classes if you can use HTML element selectors
- Use a [two-layer approach](https://theadminbar.com/semantics-and-primitives-color-system/)
for CSS variables (primitives like `--blue: #0000ff`,
and semantics like `--link-color: var(--blue)`).
- Ask the user whether they want to only have a single global
[styles.css](routes/styles.css) file (good for smaller projects),
or whether they want to colocate CSS files with their HTML
in [components](components/) and if so
[which approach they prefer](https://mastrojs.github.io/blog/2026-05-26-component-scoped-css-without-build-step/)
- Only use [client-side JavaScript](https://mastrojs.github.io/guide/interactivity-with-javascript-in-the-browser/)
if absolutely necessary. If so, use `<script type="module">`.
15 changes: 15 additions & 0 deletions packages/app-mastro/components/Layout.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { html, type Html } from '@mastrojs/mastro'

export function Layout({ title, children }: { title: string; children: Html }) {
return html`<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>${title}</title>
</head>
<body>
${children}
</body>
</html>`
}
17 changes: 17 additions & 0 deletions packages/app-mastro/components/Table.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { html } from '@mastrojs/mastro'
import type { TableEntry } from '../../testdata/src/ssr.ts'

export function Table(entries: TableEntry[], links: boolean) {
return html`<table>
<tbody>
${entries.map(
(entry) =>
html`<tr>
<td>${entry.id}</td>
<td>${entry.name}</td>
${links ? html`<td><a href="/server-side-rendered/${entry.id}">View →</a></td>` : html``}
</tr>`,
)}
</tbody>
</table>`
}
23 changes: 23 additions & 0 deletions packages/app-mastro/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "app-mastro",
"type": "module",
"private": true,
"version": "0.0.1",
"scripts": {
"dev": "node --watch server.ts",
"prod": "node server.ts",
"build": "echo 'No build step needed'",
"type-check": "tsc"
},
"dependencies": {
"@mastrojs/mastro": "0.9.2",
"srvx": "^1"
},
"devDependencies": {
"@types/node": "^24",
"typescript": "^7"
},
"engines": {
"node": ">=24"
}
}
261 changes: 261 additions & 0 deletions packages/app-mastro/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/app-mastro/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packages:
- .
minimumReleaseAgeExclude:
- '@mastrojs/mastro@0.9.1 || 0.9.2'
1 change: 1 addition & 0 deletions packages/app-mastro/routes/initial-load.css
Loading
Loading