Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions src/content/docs/en/reference/adapter-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export type AdapterSupportsKind = 'unsupported' | 'stable' | 'experimental' | 'd
export type AdapterSupportWithMessage = {
support: Exclude<AdapterSupportsKind, 'stable'>;
message: string;
suppress?: 'default' | 'all';
};

export type AdapterSupport = AdapterSupportsKind | AdapterSupportWithMessage;
Expand Down Expand Up @@ -428,6 +429,56 @@ export default function createIntegration() {
}
```

If the default log message sent along with your custom message can cause confusion, you can use `suppress: "default"` to suppress the default message:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking of a structure like this (tell me what you think)

Up around line 375 at the beginning of this section, we have:

When using these properties, Astro will:

  • run specific validation;
  • emit contextual to the logs;

(Aside: should that be "emit contextual INFORMATION to the logs" ??)

These operations are run based on the features supported or not supported, their level of support, the desired amount of logging, and the user's own configuration.

Then here, we can actually have a proper heading for this option:

Suggested change
If the default log message sent along with your custom message can cause confusion, you can use `suppress: "default"` to suppress the default message:
### `suppress`
<p>
**Type:** `default | all`<br />
<Since v="5.9.0" />
</p>
An option to prevent showing some or all logged messages.
If Astro's default log message is confusing to the user in combination with your custom `message`, you can use `suppress: "default"` to suppress the default message and only log your message:

Copy link
Member Author

@yanthomasdev yanthomasdev Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Aside: should that be "emit contextual INFORMATION to the logs" ??)

probably, yeah. We found a typo!


```js title="my-adapter.mjs" ins={13}
export default function createIntegration() {
return {
name: '@matthewp/my-adapter',
hooks: {
'astro:config:done': ({ setAdapter }) => {
setAdapter({
name: '@matthewp/my-adapter',
serverEntrypoint: '@matthewp/my-adapter/server.js',
supportedAstroFeatures: {
sharpImageService: {
support: 'limited',
message: 'This adapter has limited support for Sharp, certain features may not work as expected.',
suppress: 'default'
}
}
});
},
},
};
}
```

You can also use `suppress: "all"` to suppress all messages for a specific feature, useful if it doesn't impact users in a specific context:

```js title="my-adapter.mjs" ins={13}
export default function createIntegration() {
return {
name: '@matthewp/my-adapter',
hooks: {
'astro:config:done': ({ setAdapter }) => {
setAdapter({
name: '@matthewp/my-adapter',
serverEntrypoint: '@matthewp/my-adapter/server.js',
supportedAstroFeatures: {
sharpImageService: {
support: 'limited',
message: 'This adapter has limited support for Sharp, certain features may not work as expected.',
suppress: 'all'
}
}
});
},
},
};
}
```

## Adapter features

A set of features that changes the output of the emitted files. When an adapter opts in to these features, they will get additional information inside specific hooks.
Expand Down