Skip to content

Commit 7f0bd25

Browse files
authored
feat(astro): Add Astro 5 support (#14613)
Adds support for Astro 5 and an E2E test app for Astro 5 with the new [server islands](https://docs.astro.build/en/guides/server-islands/) feature. For server islands, we emit a new `http.server` transaction for the island-specific additional http requests. Which is generally good IMO, given that server island requests are routed to the automatically generated `/_server-island/[name]` Astro endpoint.
1 parent 08b7e49 commit 7f0bd25

30 files changed

+1050
-11
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# build output
2+
dist/
3+
4+
# generated types
5+
.astro/
6+
7+
# dependencies
8+
node_modules/
9+
10+
# logs
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
pnpm-debug.log*
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store
22+
23+
# jetbrains setting folder
24+
.idea/
25+
26+
test-results
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@sentry:registry=http://127.0.0.1:4873
2+
@sentry-internal:registry=http://127.0.0.1:4873
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Astro Starter Kit: Basics
2+
3+
```sh
4+
npm create astro@latest -- --template basics
5+
```
6+
7+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
8+
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
9+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json)
10+
11+
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
12+
13+
![just-the-basics](https://github.com/withastro/astro/assets/2244813/a0a5533c-a856-4198-8470-2d67b1d7c554)
14+
15+
## 🚀 Project Structure
16+
17+
Inside of your Astro project, you'll see the following folders and files:
18+
19+
```text
20+
/
21+
├── public/
22+
│ └── favicon.svg
23+
├── src/
24+
│ ├── layouts/
25+
│ │ └── Layout.astro
26+
│ └── pages/
27+
│ └── index.astro
28+
└── package.json
29+
```
30+
31+
To learn more about the folder structure of an Astro project, refer to [our guide on project structure](https://docs.astro.build/en/basics/project-structure/).
32+
33+
## 🧞 Commands
34+
35+
All commands are run from the root of the project, from a terminal:
36+
37+
| Command | Action |
38+
| :------------------------ | :----------------------------------------------- |
39+
| `npm install` | Installs dependencies |
40+
| `npm run dev` | Starts local dev server at `localhost:4321` |
41+
| `npm run build` | Build your production site to `./dist/` |
42+
| `npm run preview` | Preview your build locally, before deploying |
43+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
44+
| `npm run astro -- --help` | Get help using the Astro CLI |
45+
46+
## 👀 Want to learn more?
47+
48+
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import sentry from '@sentry/astro';
2+
// @ts-check
3+
import { defineConfig } from 'astro/config';
4+
5+
import node from '@astrojs/node';
6+
7+
// https://astro.build/config
8+
export default defineConfig({
9+
integrations: [
10+
sentry({
11+
debug: true,
12+
sourceMapsUploadOptions: {
13+
enabled: false,
14+
},
15+
}),
16+
],
17+
output: 'server',
18+
adapter: node({
19+
mode: 'standalone',
20+
}),
21+
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "astro-5",
3+
"type": "module",
4+
"version": "0.0.1",
5+
"scripts": {
6+
"dev": "astro dev",
7+
"build": "astro build",
8+
"preview": "astro preview",
9+
"astro": "astro",
10+
"test:build": "pnpm install && npx playwright install && pnpm build",
11+
"test:assert": "TEST_ENV=production playwright test"
12+
},
13+
"dependencies": {
14+
"@astrojs/internal-helpers": "^0.4.2",
15+
"@astrojs/node": "^9.0.0",
16+
"@playwright/test": "^1.46.0",
17+
"@sentry-internal/test-utils": "link:../../../test-utils",
18+
"@sentry/astro": "^8.42.0",
19+
"astro": "^5.0.3"
20+
}
21+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { getPlaywrightConfig } from '@sentry-internal/test-utils';
2+
3+
const testEnv = process.env.TEST_ENV;
4+
5+
if (!testEnv) {
6+
throw new Error('No test env defined');
7+
}
8+
9+
const config = getPlaywrightConfig({
10+
startCommand: 'node ./dist/server/entry.mjs',
11+
});
12+
13+
export default config;
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as Sentry from '@sentry/astro';
2+
3+
Sentry.init({
4+
dsn: import.meta.env.PUBLIC_E2E_TEST_DSN,
5+
environment: 'qa',
6+
tracesSampleRate: 1.0,
7+
tunnel: 'http://localhost:3031/', // proxy server
8+
integrations: [Sentry.browserTracingIntegration()],
9+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as Sentry from '@sentry/astro';
2+
3+
Sentry.init({
4+
dsn: import.meta.env.PUBLIC_E2E_TEST_DSN,
5+
environment: 'qa',
6+
tracesSampleRate: 1.0,
7+
tunnel: 'http://localhost:3031/', // proxy server
8+
});
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)