Skip to content

Commit

Permalink
feat(astro)!: Add Astro v5 support (#4721)
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano authored Dec 9, 2024
1 parent 3e1edf8 commit 6b1d8df
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 14 deletions.
9 changes: 9 additions & 0 deletions .changeset/famous-rings-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@clerk/astro": major
---

Recently Astro released its v5. Read their [migration guide](https://docs.astro.build/en/guides/upgrade-to/v5/) to learn more.

`@clerk/[email protected]` supports Astro v4.15.0 and above, including v5. If you're using Astro v3, you'll need to upgrade your Astro version as v3 support has been removed. If you need to stay on Astro v3, stick with your current version.

The `@clerk/[email protected]` upgrade itself doesn't have any required code changes as only internal dependencies and requirements were updated.
16 changes: 8 additions & 8 deletions integration/templates/astro-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
},
"dependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/node": "^8.3.4",
"@astrojs/react": "^3.6.2",
"@astrojs/tailwind": "^5.1.1",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"astro": "^4.15.11",
"@astrojs/node": "^9.0.0",
"@astrojs/react": "^4.0.0",
"@astrojs/tailwind": "^5.1.3",
"@types/react": "18.3.7",
"@types/react-dom": "18.3.0",
"astro": "^5.0.3",
"react": "18.3.1",
"react-dom": "18.3.1",
"tailwindcss": "^3.4.4",
"typescript": "^5.6.3"
"tailwindcss": "^3.4.12",
"typescript": "^5.7.2"
}
}
1 change: 0 additions & 1 deletion integration/templates/astro-node/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
/// <reference types="@clerk/astro/env" />
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { ViewTransitions } from 'astro:transitions';
import { ClientRouter } from 'astro:transitions';
interface Props {
title: string;
Expand All @@ -17,7 +17,7 @@ const { title } = Astro.props;
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
<ViewTransitions />
<ClientRouter />
</head>
<body>
<main>
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

### Prerequisites

- Astro 3.2 or later
- Astro 4.15.0 or later
- Node.js `>=18.17.0` or later
- An existing Clerk application. [Create your account for free](https://dashboard.clerk.com/sign-up?utm_source=github&utm_medium=clerk_astro).

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"typescript": "catalog:repo"
},
"peerDependencies": {
"astro": "^3.2.0 || ^4.0.0"
"astro": "^4.15.0 || ^5.0.0"
},
"engines": {
"node": ">=18.17.0"
Expand Down
6 changes: 6 additions & 0 deletions packages/astro/src/integration/create-integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ function createIntegration<Params extends HotloadAstroClerkIntegrationParams>()
}`,
);
},
'astro:config:done': ({ injectTypes }) => {
injectTypes({
filename: 'types.d.ts',
content: `/// <reference types="@clerk/astro/env" />`,
});
},
},
};
};
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

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

0 comments on commit 6b1d8df

Please sign in to comment.