0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00

fix: adapter features messaging (#11773)

* fix: adapter features messaging

* Apply suggestions from code review

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/long-months-burn.md

Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
This commit is contained in:
Emanuele Stoppa 2024-08-20 07:45:59 +01:00 committed by GitHub
parent fc81b01bcd
commit 86a33915ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Changes messages logged when using unsupported, deprecated, or experimental adapter features for clarity

View file

@ -124,20 +124,20 @@ function validateSupportKind(
}
function featureIsUnsupported(adapterName: string, logger: Logger, featureName: string) {
logger.error('config', `The feature "${featureName}" is not supported (used by ${adapterName}).`);
logger.error('config', `The adapter ${adapterName} doesn't currently support the feature "${featureName}".`);
}
function featureIsExperimental(adapterName: string, logger: Logger, featureName: string) {
logger.warn(
'config',
`The feature "${featureName}" is experimental and subject to change (used by ${adapterName}).`,
`The adapter ${adapterName} provides experimental support for "${featureName}". You may experience issues or breaking changes until this feature is fully supported by the adapter.`,
);
}
function featureIsDeprecated(adapterName: string, logger: Logger, featureName: string) {
logger.warn(
'config',
`The feature "${featureName}" is deprecated and will be removed in the future (used by ${adapterName}).`,
`The adapter ${adapterName} has deprecated its support for "${featureName}", and future compatibility is not guaranteed. The adapter may completely remove support for this feature without warning.`,
);
}