Skip to content

Commit 1c7eef3

Browse files
nemo0natemoo-re
andauthored
Updated according to new configuration (#5478)
* Updated according to new configuration Astro imports the `defineConfig` function from `astro/config`. The `integrations` key needs to be passed into the `defineConfig` function, but it is not shown in the README. Updated the README according to the CLI example. * update alpine * update image * update lit * update mdx * update preact * update prefetch * update react * update sitemap * update solid * update svelte * update tailwind * update turbolinks * update vue * chore: add changeset * update image * update svelte readme Co-authored-by: Nate Moore <nate@astro.build> Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
1 parent 607f0ac commit 1c7eef3

14 files changed

Lines changed: 399 additions & 103 deletions

File tree

.changeset/cuddly-donkeys-warn.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@astrojs/alpinejs': patch
3+
'@astrojs/image': patch
4+
'@astrojs/lit': patch
5+
'@astrojs/mdx': patch
6+
'@astrojs/preact': patch
7+
'@astrojs/prefetch': patch
8+
'@astrojs/react': patch
9+
'@astrojs/sitemap': patch
10+
'@astrojs/solid-js': patch
11+
'@astrojs/svelte': patch
12+
'@astrojs/tailwind': patch
13+
'@astrojs/turbolinks': patch
14+
'@astrojs/vue': patch
15+
---
16+
17+
Update READMEs for consistency

packages/integrations/alpinejs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ npm install alpinejs @types/alpinejs
4343

4444
Then, apply this integration to your `astro.config.*` file using the `integrations` property:
4545

46+
__`astro.config.mjs`__
4647

47-
```js ins={3} "alpine()"
48-
// astro.config.mjs
48+
```js ins={2} "alpine()"
4949
import { defineConfig } from 'astro/config';
5050
import alpine from '@astrojs/alpinejs';
5151

packages/integrations/image/README.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,14 @@ Then, apply this integration to your `astro.config.*` file using the `integratio
6363

6464
__`astro.config.mjs`__
6565

66-
```js
66+
```js ins={2} "image()"
67+
import { defineConfig } from 'astro/config';
6768
import image from '@astrojs/image';
6869

69-
export default {
70+
export default defineConfig({
7071
// ...
7172
integrations: [image()],
72-
}
73+
});
7374
```
7475

7576
### Installing `sharp` (optional)
@@ -82,16 +83,18 @@ npm install sharp
8283

8384
Then, update the integration in your `astro.config.*` file to use the built-in `sharp` image transformer.
8485

85-
```js ins={2,7}
86-
// astro.config.mjs
86+
__`astro.config.mjs`__
87+
88+
```js ins={3,8}
89+
import { defineConfig } from 'astro/config';
8790
import image from '@astrojs/image';
8891

89-
export default {
92+
export default defineConfig({
9093
// ...
9194
integrations: [image({
9295
serviceEntryPoint: '@astrojs/image/sharp'
9396
})],
94-
}
97+
})
9598
```
9699

97100
### Update `env.d.ts`
@@ -446,33 +449,37 @@ The integration can be configured to run with a different image service, either
446449

447450
The `serviceEntryPoint` should resolve to the image service installed from NPM. The default entry point is `@astrojs/image/squoosh`, which resolves to the entry point exported from this integration's `package.json`.
448451

452+
__`astro.config.mjs`__
453+
449454
```js
450-
// astro.config.mjs
455+
import { defineConfig } from 'astro/config';
451456
import image from '@astrojs/image';
452457

453-
export default {
458+
export default defineConfig({
454459
integrations: [image({
455460
// Example: The entrypoint for a third-party image service installed from NPM
456461
serviceEntryPoint: 'my-image-service/astro.js'
457462
})],
458-
}
463+
});
459464
```
460465

461466
### config.logLevel
462467

463468
The `logLevel` controls can be used to control how much detail is logged by the integration during builds. This may be useful to track down a specific image or transformation that is taking a long time to build.
464469

470+
__`astro.config.mjs`__
471+
465472
```js
466-
// astro.config.mjs
473+
import { defineConfig } from 'astro/config';
467474
import image from '@astrojs/image';
468475

469-
export default {
476+
export default defineConfig({
470477
integrations: [image({
471478
// supported levels: 'debug' | 'info' | 'warn' | 'error' | 'silent'
472479
// default: 'info'
473480
logLevel: 'debug'
474481
})],
475-
}
482+
});
476483
```
477484

478485
### config.cacheDir
@@ -483,7 +490,12 @@ Local images will be cached for 1 year and invalidated when the original image f
483490

484491
By default, transformed images will be cached to `./node_modules/.astro/image`. This can be configured in the integration's config options.
485492

493+
__`astro.config.mjs`__
494+
486495
```js
496+
import { defineConfig } from 'astro/config';
497+
import image from '@astrojs/image';
498+
487499
export default defineConfig({
488500
integrations: [image({
489501
// may be useful if your hosting provider allows caching between CI builds

packages/integrations/lit/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ Now, apply this integration to your `astro.config.*` file using the `integration
4343

4444
__`astro.config.mjs`__
4545

46-
```js
46+
```js ins={2} "lit()"
47+
import { defineConfig } from 'astro/config';
4748
import lit from '@astrojs/lit';
4849

49-
export default {
50+
export default defineConfig({
5051
// ...
5152
integrations: [lit()],
52-
}
53+
});
5354
```
5455

5556
## Getting started

0 commit comments

Comments
 (0)