Skip to content

Commit 70298d2

Browse files
authored
Merge pull request #12 from nemanjam/feature/astro-v5
Update to Astro v5
2 parents 72dbae4 + e55fde1 commit 70298d2

File tree

8 files changed

+1534
-1592
lines changed

8 files changed

+1534
-1592
lines changed

.astro/types.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/// <reference types="astro/client" />
2-
/// <reference path="astro/content.d.ts" />
3-
/// <reference path="astro/env.d.ts" />
2+
/// <reference path="content.d.ts" />
3+
/// <reference path="env.d.ts" />

astro.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ const remarkPlugins = [remarkReadingTime];
1919

2020
export default defineConfig({
2121
site: SITE_URL,
22-
experimental: { env: envSchema },
2322
trailingSlash: 'ignore',
23+
env: envSchema,
24+
legacy: {
25+
collections: true,
26+
},
2427
// default
2528
compressHTML: true,
2629
server: { port: 3000 },

docker/Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ FROM base AS build
1414
COPY package.json yarn.lock ./
1515
RUN yarn install --frozen-lockfile
1616

17-
# override sharp 0.32.6 with 0.33.3, fails without this
18-
RUN yarn remove sharp
19-
RUN yarn add --ignore-engines [email protected]
20-
2117
COPY . .
2218

2319
ARG ARG_SITE_URL_ARM64

docs/working-notes/todo4.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,16 @@ breadcrumbs
1717

1818
gallery lazy load, blur, pagination on scroll
1919

20+
21+
git checkout -b feature/astro-v5
22+
23+
------------
24+
astro v5
25+
// these 2 fail with react 19, unrelated to astro 5, gallery page fails
26+
"react-grid-gallery": "^1.0.1",
27+
"react-image-lightbox": "^5.1.4",
28+
29+
migrate gallery to astro components
30+
migrate content collections to content layer, restructure folder with slug to contain images
31+
2032
```

package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
"dc:up": "docker compose up --build --force-recreate -d"
2929
},
3030
"dependencies": {
31-
"@astrojs/mdx": "^3.1.9",
31+
"@astrojs/mdx": "^4.0.3",
3232
"@astrojs/partytown": "^2.1.2",
33-
"@astrojs/react": "^3.6.3",
33+
"@astrojs/react": "^4.1.2",
3434
"@astrojs/sitemap": "^3.2.1",
3535
"@astrojs/tailwind": "^5.1.2",
3636
"@fontsource-variable/inter": "^5.1.0",
37-
"astro": "^4.16.16",
37+
"astro": "^5.1.1",
3838
"astro-embed": "^0.9.0",
3939
"astro-expressive-code": "^0.38.3",
4040
"astro-icon": "^1.1.4",
@@ -55,7 +55,7 @@
5555
"react-grid-gallery": "^1.0.1",
5656
"react-image-lightbox": "^5.1.4",
5757
"reading-time": "^1.5.0",
58-
"sharp": "0.32.6",
58+
"sharp": "0.33.5",
5959
"tailwind-clip-path": "^1.0.0",
6060
"tailwind-merge": "^2.5.5",
6161
"zod": "^3.23.4"
@@ -85,9 +85,6 @@
8585
"tailwindcss": "^3.4.15",
8686
"typescript": "^5.7.2"
8787
},
88-
"resolutions": {
89-
"sharp": "0.32.6"
90-
},
9188
"packageManager": "[email protected]",
9289
"engines": {
9390
"node": ">=v22.9.0"

src/components/BaseHead.astro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import '@fontsource-variable/inter/index.css';
33
import '@/styles/main.css';
44
5-
import { ViewTransitions } from 'astro:transitions';
5+
import { ClientRouter } from 'astro:transitions';
66
77
import ThemeScript from '@/components/ThemeScript.astro';
88
import { DEFAULT_METADATA } from '@/constants/metadata';
@@ -122,13 +122,13 @@ const ogImageUrl = new URL(image, url);
122122
{/* MUST be inside <head /> to avoid white flash, IMPORTANT */}
123123
<ThemeScript />
124124

125-
<ViewTransitions fallback="none" />
125+
<ClientRouter fallback="none" />
126126

127127
<!--
128128
<style>
129-
@view-transition {
130-
navigation: auto; /* enabled! */
131-
}
129+
@view-transition {
130+
navigation: auto; /* enabled! */
131+
}
132132
</style>
133133
-->
134134
</head>

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
"@/config/*": ["config/*"]
2727
}
2828
},
29-
"include": ["**/*.ts", "**/*.tsx", "**/*.astro"],
29+
"include": ["**/*.ts", "**/*.tsx", "**/*.astro", ".astro/types.d.ts"],
3030
"exclude": ["dist", "docs", "node_modules"]
3131
}

0 commit comments

Comments
 (0)