Skip to content

Commit 00a0cc6

Browse files
committed
feat: adds route support for remix and astro, fixes others
1 parent bb04523 commit 00a0cc6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+4561
-4929
lines changed

apps/astro/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# build output
2+
dist/
3+
# generated types
4+
.astro/
5+
6+
# dependencies
7+
node_modules/
8+
9+
# logs
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
pnpm-debug.log*
14+
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store
22+
23+
# jetbrains setting folder
24+
.idea/

apps/astro/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Astro Demo application for Vercel Speed-insights
2+
3+
## Setup
4+
5+
This application was created with the following commands:
6+
7+
- `cd apps`
8+
- `pnpm create astro@latest astro` (answers: empty, no to all)
9+
- `cd astro`
10+
- manually edit package.json to add `"@vercel/analytics": "workspace:*"` dependency
11+
- `pnpm i`
12+
13+
Then we've added:
14+
15+
1. a simple collection of Markdown blog posts in `src/contents/blog` folder
16+
2. a blog post page in `src/pages/blog/[...slug].astro`
17+
3. an index page in `src/pages/index.astro` which list all available blog posts
18+
4. a layout in `src/components/Base.astro`, used in both page, which includes our Analytics.astro component:
19+
20+
```astro
21+
---
22+
import Analytics from '@vercel/analytics/astro';
23+
---
24+
<html lang="en">
25+
<head>
26+
<!-- ...-->
27+
<Analytics />
28+
</head>
29+
<body>
30+
<slot />
31+
</body>
32+
</html>
33+
```
34+
35+
## Usage
36+
37+
Start it with `pnpm -F nuxt dev` and browse to [http://localhost:4321](http://localhost:4321)

apps/astro/astro.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { defineConfig } from 'astro/config';
2+
3+
// https://astro.build/config
4+
export default defineConfig({});

apps/astro/package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "astro",
3+
"version": "0.0.1",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"astro": "astro",
8+
"build": "astro build",
9+
"dev": "astro dev",
10+
"preview": "astro preview",
11+
"start": "astro dev"
12+
},
13+
"dependencies": {
14+
"@vercel/analytics": "workspace:*",
15+
"astro": "latest"
16+
},
17+
"devDependencies": {
18+
"@astrojs/check": "^0.5.4",
19+
"@vercel/analytics": "workspace:*",
20+
"typescript": "^5.3.3"
21+
}
22+
}

apps/astro/public/favicon.svg

Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
import Analytics from '@vercel/analytics/astro';
3+
---
4+
<Analytics />
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: About Bruno
3+
slug: bruno
4+
---
5+
6+
We don't talk about Bruno
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: About Henry
3+
slug: henry
4+
---
5+
6+
Henry is a gentleman

apps/astro/src/env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference path="../.astro/types.d.ts" />

apps/astro/src/layouts/Base.astro

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
import Analytics from '@vercel/analytics/astro';
3+
4+
const { title } = Astro.props;
5+
---
6+
<html lang="en">
7+
<head>
8+
<meta charset="utf-8" />
9+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
10+
<meta name="viewport" content="width=device-width" />
11+
<meta name="generator" content={Astro.generator} />
12+
<title>{title}</title>
13+
<Analytics />
14+
</head>
15+
<body>
16+
<slot />
17+
</body>
18+
</html>

0 commit comments

Comments
 (0)