-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Document suppress in supportedAstroFeatures
#11825
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
Changes from 1 commit
3f89f80
e4cf427
20179bc
a76346c
f7436a8
9bdb63f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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; | ||||||||||||||||||||||||||
|
|
@@ -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: | ||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
(Aside: should that be "emit contextual INFORMATION to the logs" ??)
Then here, we can actually have a proper heading for this option:
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
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' | ||||||||||||||||||||||||||
|
sarah11918 marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| 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: | ||||||||||||||||||||||||||
|
sarah11918 marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ```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. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.