Skip to content

Commit dc1fb7d

Browse files
MiniDiggerDoc94mja00Strokkur424
authored
update to astro 6 (#221)
Co-authored-by: Pedro <3602279+Doc94@users.noreply.github.com> Co-authored-by: mja00 <me@mja00.dev> Co-authored-by: Strokkur24 <strokkur.24@gmail.com>
1 parent 1ee2910 commit dc1fb7d

24 files changed

+7541
-3399
lines changed

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Documentation: https://www.git-scm.com/docs/gitattributes
2+
3+
# Set default behavior to automatically normalize line endings.
4+
* text=auto eol=lf
5+
6+
# Enforce CRLF line endings in Windows batch scripts to avoid issues.
7+
*.cmd text eol=crlf
8+
*.bat text eol=crlf

.github/workflows/check.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@ on:
77

88
jobs:
99
lint:
10-
# Only run on PRs if the source branch is on someone else's repo
11-
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
1210
runs-on: ubuntu-latest
1311

1412
steps:
1513
- name: Checkout repository
1614
uses: actions/checkout@v5
1715

16+
- name: Setup Node
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 24
20+
1821
- name: Setup Bun
1922
uses: oven-sh/setup-bun@v2
20-
with:
21-
bun-version: latest
2223

2324
- name: Install dependencies
2425
run: bun install

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
README.md
1+
README.md

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# papermc.io [![Discord](https://img.shields.io/discord/289587909051416579.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/papermc) ![License](https://img.shields.io/github/license/PaperMC/website)
22

3-
The official [PaperMC](https://papermc.io) website — built with **Astro 5**, powered by **Bun**, and styled using **Tailwind CSS v4**. Content in this repository is published to [papermc.io](https://papermc.io) for viewing.
3+
The official [PaperMC](https://papermc.io) website — built with **Astro 6**, powered by **Bun**, and styled using **Tailwind CSS v4**. Content in this repository is published to [papermc.io](https://papermc.io) for viewing.
44

55
---
66

@@ -10,6 +10,7 @@ How to get the project running on your local machine for development.
1010

1111
### Prerequisites
1212

13+
- [Node 24](https://nodejs.org)
1314
- [Bun](https://bun.com/)
1415

1516
### Local Development
@@ -63,13 +64,13 @@ website/
6364
├─ public/ # Static assets (favicon, icons, etc.)
6465
├─ astro.config.mjs # Astro configuration
6566
├─ tailwind.config.ts
66-
├─ bun.lockb
67+
├─ bun.lock
6768
└─ package.json
6869
```
6970

7071
## 💡 Development Notes
7172

72-
This project uses Astro 5, which introduces faster rebuilds, partial hydration improvements, and first-class hybrid rendering.
73+
This project uses Astro 6, which introduces faster rebuilds, partial hydration improvements, and first-class hybrid rendering.
7374

7475
Svelte is used for dynamic islands and component interactivity.
7576

@@ -81,7 +82,7 @@ Pages are statically generated by default, with selective SSR where necessary.
8182

8283
## 📚 Learn More
8384

84-
🌌 [Astro 5 Documentation](https://docs.astro.build)
85+
🌌 [Astro 6 Documentation](https://docs.astro.build)
8586

8687
🎨 [Tailwind CSS v4 Docs](https://tailwindcss.com/docs)
8788

astro.config.mjs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ export default defineConfig({
4444
],
4545

4646
adapter: cloudflare({
47-
platformProxy: {
48-
enabled: true,
49-
persist: true,
50-
},
51-
workerEntryPoint: {
52-
path: "src/worker.ts",
53-
},
47+
prerenderEnvironment: "node",
48+
imageService: "compile",
5449
}),
5550
});

bun.lock

Lines changed: 425 additions & 767 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bunfig.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[run]
22
# equivalent to `bun --bun` for all `bun run` commands
3-
bun = true
3+
bun = false
44

55
[install]
66
# Only install package versions published at least 3 days ago

package.json

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,53 @@
77
"build": "astro build",
88
"preview": "astro preview",
99
"astro": "astro",
10-
"format": "prettier --write .",
10+
"format": "prettier --write --list-different .",
1111
"lint:eslint": "eslint . --cache",
1212
"lint:prettier": "prettier --check .",
13-
"check:types": "astro sync && tsgo --noEmit",
13+
"check:types": "wrangler types && astro sync && tsgo --noEmit",
1414
"lint": "bun run lint:eslint && bun run lint:prettier",
1515
"check": "bun run check:types",
16-
"check:all": "bun run check && bun run lint"
16+
"check:all": "bun run check && bun run lint",
17+
"postinstall": "wrangler types"
1718
},
1819
"dependencies": {
19-
"@astrojs/cloudflare": "^12.6.10",
20-
"@astrojs/rss": "^4.0.13",
21-
"@astrojs/sitemap": "^3.6.0",
22-
"@astrojs/svelte": "^7.2.1",
23-
"@fontsource/poppins": "^5.2.7",
24-
"@tailwindcss/vite": "^4.1.16",
25-
"astro": "5.15.1",
26-
"astro-icon": "^1.1.5",
27-
"clsx": "^2.1.1",
28-
"remove-markdown": "^0.6.2",
29-
"runed": "^0.35.1",
30-
"svelte": "^5.42.3",
31-
"tailwindcss": "^4.1.16",
32-
"typescript": "^5.9.3"
20+
"@astrojs/cloudflare": "13.1.7",
21+
"@astrojs/rss": "4.0.18",
22+
"@astrojs/sitemap": "3.7.2",
23+
"@astrojs/svelte": "8.0.4",
24+
"@fontsource/poppins": "5.2.7",
25+
"@tailwindcss/vite": "4.2.2",
26+
"astro": "6.1.3",
27+
"astro-icon": "1.1.5",
28+
"clsx": "2.1.1",
29+
"remove-markdown": "0.6.3",
30+
"runed": "0.37.1",
31+
"svelte": "5.55.1",
32+
"tailwindcss": "4.2.2",
33+
"typescript": "6.0.2"
3334
},
3435
"devDependencies": {
35-
"@astrojs/mdx": "^4.3.9",
36-
"@tailwindcss/typography": "^0.5.19",
37-
"@types/node": "^24.9.2",
38-
"@typescript-eslint/eslint-plugin": "^8.46.2",
39-
"@typescript-eslint/parser": "^8.46.2",
40-
"@typescript/native-preview": "^7.0.0-dev.20251027.1",
41-
"eslint": "^9.38.0",
42-
"eslint-config-prettier": "^10.1.8",
43-
"eslint-plugin-astro": "^1.4.0",
44-
"eslint-plugin-svelte": "^3.12.5",
45-
"prettier": "^3.6.2",
46-
"prettier-plugin-astro": "^0.14.1",
47-
"prettier-plugin-svelte": "^3.4.0",
48-
"prettier-plugin-tailwindcss": "^0.7.1",
49-
"svelte-eslint-parser": "^1.4.0",
50-
"wrangler": "^4.45.0"
36+
"@astrojs/mdx": "5.0.3",
37+
"@tailwindcss/typography": "0.5.19",
38+
"@types/node": "25.5.0",
39+
"@typescript-eslint/eslint-plugin": "8.58.0",
40+
"@typescript-eslint/parser": "8.58.0",
41+
"@typescript/native-preview": "7.0.0-dev.20260401.1",
42+
"eslint": "10.1.0",
43+
"eslint-config-prettier": "10.1.8",
44+
"eslint-plugin-astro": "1.6.0",
45+
"eslint-plugin-svelte": "3.16.0",
46+
"prettier": "3.8.1",
47+
"prettier-plugin-astro": "0.14.1",
48+
"prettier-plugin-svelte": "3.5.1",
49+
"prettier-plugin-tailwindcss": "0.7.2",
50+
"svelte-eslint-parser": "1.6.0",
51+
"wrangler": "4.80.0"
52+
},
53+
"devEngines": {
54+
"runtime": {
55+
"name": "node",
56+
"version": ">=22.x"
57+
}
5158
}
5259
}

src/components/data/RemoteImageWrapper.astro

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
11
---
22
import { getImage, imageConfig, type LocalImageProps, type RemoteImageProps } from "astro:assets";
3-
import type { UnresolvedImageTransform } from "node_modules/astro/dist/assets/types";
43
import type { HTMLAttributes } from "astro/types";
5-
import "node_modules/astro/components/image.css";
64
75
import fallbackImage from "@/assets/brand/paper.svg";
8-
import { AstroError } from "node_modules/astro/dist/core/errors/errors";
9-
import { AstroErrorData } from "node_modules/astro/dist/core/errors";
106
import { inferRemoteSize } from "astro/assets/utils";
117
128
type Props = LocalImageProps | RemoteImageProps;
139
1410
const props = Astro.props;
1511
1612
if (props.alt === undefined || props.alt === null) {
17-
throw new AstroError(AstroErrorData.ImageMissingAlt);
13+
throw new Error("Image is missing required 'alt' property.");
1814
}
1915
20-
if (typeof props.width === "string") {
21-
props.width = parseInt(props.width);
16+
function toOptionalNumber(value: number | `${number}` | undefined): number | undefined {
17+
if (value === undefined) return undefined;
18+
return typeof value === "string" ? Number.parseInt(value, 10) : value;
2219
}
2320
24-
if (typeof props.height === "string") {
25-
props.height = parseInt(props.height);
26-
}
21+
const width = toOptionalNumber(props.width);
22+
const height = toOptionalNumber(props.height);
23+
props.width = width;
24+
props.height = height;
2725
2826
const additionalAttributes: HTMLAttributes<"img"> = {};
2927
try {
@@ -41,7 +39,8 @@ if (layout !== "none") {
4139
props.position ??= imageConfig.objectPosition ?? "center";
4240
}
4341
44-
const image = await getImage(props as UnresolvedImageTransform);
42+
// getImage has a weird type signature, so this will cast it properly to the correct type
43+
const image = await getImage({ ...props, width, height });
4544
4645
if (image.srcSet.values.length > 0) {
4746
additionalAttributes.srcset = image.srcSet.attribute;

src/components/data/RemoteResponsiveImageWrapper.astro

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import RemoteImageWrapper from "@/components/data/RemoteImageWrapper.astro";
55
type Props = LocalImageProps | RemoteImageProps;
66
77
const { class: className, ...props } = Astro.props;
8-
9-
import "node_modules/astro/components/image.css";
108
---
119

1210
{/* Applying class outside of the spread prevents it from applying unnecessary astro-* classes */}

0 commit comments

Comments
 (0)