Skip to content

Commit

Permalink
Merge branch 'main' into content-layer
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Jul 17, 2024
2 parents 456b1c3 + 17d2eed commit e70f252
Show file tree
Hide file tree
Showing 151 changed files with 2,374 additions and 1,869 deletions.
23 changes: 23 additions & 0 deletions .changeset/blue-colts-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'@astrojs/db': minor
---

Removes the `AstroDbIntegration` type

Astro integration hooks can now be extended and as such `@astrojs/db` no longer needs to declare it's own integration type. Using `AstroIntegration` will have the same type.

If you were using the `AstroDbIntegration` type, apply this change to your integration code:

```diff
- import { defineDbIntegration, type AstroDbIntegration } from '@astrojs/db/utils';
+ import { defineDbIntegration } from '@astrojs/db/utils';
import type { AstroIntegration } from 'astro';

- export default (): AstroDbIntegration => {
+ export default (): AstroIntegration => {
return defineDbIntegration({
name: 'your-integration',
hooks: {},
});
}
```
5 changes: 5 additions & 0 deletions .changeset/chilled-impalas-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes an issue where the development server was emitting a 404 status code when the user uses a rewrite that emits a 200 status code.
32 changes: 32 additions & 0 deletions .changeset/cold-crabs-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
'@astrojs/markdown-remark': minor
'astro': minor
---

Adds support for [Shiki's `defaultColor` option](https://shiki.style/guide/dual-themes#without-default-color).

This option allows you to override the values of a theme's inline style, adding only CSS variables to give you more flexibility in applying multiple color themes.

Configure `defaultColor: false` in your Shiki config to apply throughout your site, or pass to Astro's built-in `<Code>` component to style an individual code block.

```js title="astro.config.mjs"
import { defineConfig } from 'astro/config';
export default defineConfig({
markdown: {
shikiConfig: {
themes: {
light: 'github-light',
dark: 'github-dark',
},
defaultColor: false,
},
},
});
```

```astro
---
import { Code } from 'astro:components';
---
<Code code={`const useMyColors = true`} lang="js" defaultColor={false} />
```
58 changes: 58 additions & 0 deletions .changeset/curvy-otters-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
'astro': minor
---

Refactors the type for integration hooks so that integration authors writing custom integration hooks can now allow runtime interactions between their integration and other integrations.

This internal change should not break existing code for integration authors.

To declare your own hooks for your integration, extend the `Astro.IntegrationHooks` interface:

```ts
// your-integration/types.ts
declare global {
namespace Astro {
interface IntegrationHooks {
'myLib:eventHappened': (your: string, parameters: number) => Promise<void>;
}
}
}
```

Call your hooks on all other integrations installed in a project at the appropriate time. For example, you can call your hook on initialization before either the Vite or Astro config have resolved:

```ts
// your-integration/index.ts
import './types.ts';

export default (): AstroIntegration => {
return {
name: 'your-integration',
hooks: {
'astro:config:setup': async ({ config }) => {
for (const integration of config.integrations) {
await integration.hooks['myLib:eventHappened'].?('your values', 123);
}
},
}
}
}
```
Other integrations can also now declare your hooks:
```ts
// other-integration/index.ts
import 'your-integration/types.ts';

export default (): AstroIntegration => {
return {
name: 'other-integration',
hooks: {
'myLib:eventHappened': async (your, values) => {
// ...
},
}
}
}
```
20 changes: 20 additions & 0 deletions .changeset/large-geese-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
"astro": minor
---

Adds a new `inferRemoteSize()` function that can be used to infer the dimensions of a remote image.

Previously, the ability to infer these values was only available by adding the [`inferSize`] attribute to the `<Image>` and `<Picture>` components or `getImage()`. Now, you can also access this data outside of these components.

This is useful for when you need to know the dimensions of an image for styling purposes or to calculate different densities for responsive images.

```astro
---
import { inferRemoteSize, Image } from 'astro:assets';
const imageUrl = 'https://...';
const { width, height } = await inferRemoteSize(imageUrl);
---
<Image src={imageUrl} width={width / 2} height={height} densities={[1.5, 2]} />
```
5 changes: 0 additions & 5 deletions .changeset/loud-socks-doubt.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/modern-buses-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Refactors how `sync` works and when it's called. Fixes an issue with `astro:env` types in dev not being generated
18 changes: 0 additions & 18 deletions .changeset/nasty-poems-juggle.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/plenty-socks-talk.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/seven-donuts-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Supports importing Astro components with Vite queries, like `?url`, `?raw`, and `?direct`
23 changes: 0 additions & 23 deletions .changeset/slow-roses-call.md

This file was deleted.

29 changes: 0 additions & 29 deletions .changeset/small-vans-own.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/swift-cows-walk.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/twenty-maps-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': minor
---

Adds two new values to the [pagination `page` prop](https://docs.astro.build/en/reference/api-reference/#the-pagination-page-prop): `page.first` and `page.last` for accessing the URLs of the first and last pages.
2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.11.5"
"astro": "^4.11.6"
}
}
2 changes: 1 addition & 1 deletion examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"@astrojs/mdx": "^3.1.2",
"@astrojs/rss": "^4.0.7",
"@astrojs/sitemap": "^3.1.6",
"astro": "^4.11.5"
"astro": "^4.11.6"
}
}
2 changes: 1 addition & 1 deletion examples/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^4.11.5"
"astro": "^4.11.6"
},
"peerDependencies": {
"astro": "^4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/container-with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"astro": "^4.11.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"vitest": "^1.6.0"
"vitest": "^2.0.3"
},
"devDependencies": {
"@types/react": "^18.3.3",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"@astrojs/alpinejs": "^0.4.0",
"@types/alpinejs": "^3.13.10",
"alpinejs": "^3.14.1",
"astro": "^4.11.5"
"astro": "^4.11.6"
}
}
2 changes: 1 addition & 1 deletion examples/framework-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/lit": "^4.3.0",
"@webcomponents/template-shadowroot": "^0.2.1",
"astro": "^4.11.5",
"astro": "^4.11.6",
"lit": "^3.1.4"
}
}
4 changes: 2 additions & 2 deletions examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/preact": "^3.5.0",
"@astrojs/preact": "^3.5.1",
"@astrojs/react": "^3.6.0",
"@astrojs/solid-js": "^4.4.0",
"@astrojs/svelte": "^5.6.0",
"@astrojs/vue": "^4.5.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"astro": "^4.11.5",
"astro": "^4.11.6",
"preact": "^10.22.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
6 changes: 3 additions & 3 deletions examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/preact": "^3.5.0",
"@preact/signals": "^1.2.3",
"astro": "^4.11.5",
"@astrojs/preact": "^3.5.1",
"@preact/signals": "^1.3.0",
"astro": "^4.11.6",
"preact": "^10.22.1"
}
}
2 changes: 1 addition & 1 deletion examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@astrojs/react": "^3.6.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"astro": "^4.11.5",
"astro": "^4.11.6",
"react": "^18.3.1",
"react-dom": "^18.3.1"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^4.4.0",
"astro": "^4.11.5",
"astro": "^4.11.6",
"solid-js": "^1.8.18"
}
}
2 changes: 1 addition & 1 deletion examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/svelte": "^5.6.0",
"astro": "^4.11.5",
"astro": "^4.11.6",
"svelte": "^4.2.18"
}
}
2 changes: 1 addition & 1 deletion examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/vue": "^4.5.0",
"astro": "^4.11.5",
"astro": "^4.11.6",
"vue": "^3.4.31"
}
}
2 changes: 1 addition & 1 deletion examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/node": "^8.3.2",
"astro": "^4.11.5"
"astro": "^4.11.6"
}
}
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^4.11.5"
"astro": "^4.11.6"
},
"peerDependencies": {
"astro": "^4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@astrojs/node": "^8.3.2",
"astro": "^4.11.5",
"astro": "^4.11.6",
"html-minifier": "^4.0.0"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit e70f252

Please sign in to comment.