Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated according to new configuration #5478

Merged
merged 18 commits into from
Jan 26, 2023
17 changes: 17 additions & 0 deletions .changeset/cuddly-donkeys-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'@astrojs/alpinejs': patch
'@astrojs/image': patch
'@astrojs/lit': patch
'@astrojs/mdx': patch
'@astrojs/preact': patch
'@astrojs/prefetch': patch
'@astrojs/react': patch
'@astrojs/sitemap': patch
'@astrojs/solid-js': patch
'@astrojs/svelte': patch
'@astrojs/tailwind': patch
'@astrojs/turbolinks': patch
'@astrojs/vue': patch
---

Update READMEs for consistency
4 changes: 2 additions & 2 deletions packages/integrations/alpinejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ npm install alpinejs @types/alpinejs

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

__`astro.config.mjs`__

```js ins={3} "alpine()"
// astro.config.mjs
```js ins={2} "alpine()"
import { defineConfig } from 'astro/config';
import alpine from '@astrojs/alpinejs';

Expand Down
38 changes: 25 additions & 13 deletions packages/integrations/image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ Then, apply this integration to your `astro.config.*` file using the `integratio

__`astro.config.mjs`__

```js
```js ins={2} "image()"
import { defineConfig } from 'astro/config';
import image from '@astrojs/image';

export default {
export default defineConfig({
// ...
integrations: [image()],
}
});
```

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

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

```js ins={2,7}
// astro.config.mjs
__`astro.config.mjs`__

```js ins={3,8}
import { defineConfig } from 'astro/config';
import image from '@astrojs/image';

export default {
export default defineConfig({
// ...
integrations: [image({
serviceEntryPoint: '@astrojs/image/sharp'
})],
}
})
```

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

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`.

__`astro.config.mjs`__

```js
// astro.config.mjs
import { defineConfig } from 'astro/config';
import image from '@astrojs/image';

export default {
export default defineConfig({
integrations: [image({
// Example: The entrypoint for a third-party image service installed from NPM
serviceEntryPoint: 'my-image-service/astro.js'
})],
}
});
```

### config.logLevel

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.

__`astro.config.mjs`__

```js
// astro.config.mjs
import { defineConfig } from 'astro/config';
import image from '@astrojs/image';

export default {
export default defineConfig({
integrations: [image({
// supported levels: 'debug' | 'info' | 'warn' | 'error' | 'silent'
// default: 'info'
logLevel: 'debug'
})],
}
});
```

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

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

__`astro.config.mjs`__

```js
import { defineConfig } from 'astro/config';
import image from '@astrojs/image';

export default defineConfig({
integrations: [image({
// may be useful if your hosting provider allows caching between CI builds
Expand Down
7 changes: 4 additions & 3 deletions packages/integrations/lit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ Now, apply this integration to your `astro.config.*` file using the `integration

__`astro.config.mjs`__

```js
```js ins={2} "lit()"
import { defineConfig } from 'astro/config';
import lit from '@astrojs/lit';

export default {
export default defineConfig({
// ...
integrations: [lit()],
}
});
```

## Getting started
Expand Down
Loading