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

fix: mention which feature is experimental/deprecated (#9414)

This commit is contained in:
Simon Knott 2023-12-12 11:19:15 +01:00 committed by GitHub
parent 8aeb0b5797
commit bebf38c0cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 7 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Adds the feature name to logs about feature deprecation / experimental status.

View file

@ -80,9 +80,9 @@ function validateSupportKind(
if (supportKind === STABLE) {
return true;
} else if (supportKind === DEPRECATED) {
featureIsDeprecated(adapterName, logger);
featureIsDeprecated(adapterName, logger, featureName);
} else if (supportKind === EXPERIMENTAL) {
featureIsExperimental(adapterName, logger);
featureIsExperimental(adapterName, logger, featureName);
}
if (hasCorrectConfig() && supportKind === UNSUPPORTED) {
@ -94,20 +94,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 feature "${featureName}" is not supported (used by ${adapterName}).`);
}
function featureIsExperimental(adapterName: string, logger: Logger) {
function featureIsExperimental(adapterName: string, logger: Logger, featureName: string) {
logger.warn(
'config',
`The feature is experimental and subject to change (used by ${adapterName}).`
`The feature "${featureName}" is experimental and subject to change (used by ${adapterName}).`
);
}
function featureIsDeprecated(adapterName: string, logger: Logger) {
function featureIsDeprecated(adapterName: string , logger: Logger, featureName: string,) {
logger.warn(
'config',
`The feature is deprecated and will be removed in the future (used by ${adapterName}).`
`The feature "${featureName}" is deprecated and will be removed in the future (used by ${adapterName}).`
);
}