From bebf38c0cb539de04007f5e721bf459300b895a1 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Tue, 12 Dec 2023 11:19:15 +0100 Subject: [PATCH] fix: mention which feature is experimental/deprecated (#9414) --- .changeset/fifty-pets-hunt.md | 5 +++++ .../src/integrations/astroFeaturesValidation.ts | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 .changeset/fifty-pets-hunt.md diff --git a/.changeset/fifty-pets-hunt.md b/.changeset/fifty-pets-hunt.md new file mode 100644 index 000000000000..d9ec8d6d7cbf --- /dev/null +++ b/.changeset/fifty-pets-hunt.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Adds the feature name to logs about feature deprecation / experimental status. diff --git a/packages/astro/src/integrations/astroFeaturesValidation.ts b/packages/astro/src/integrations/astroFeaturesValidation.ts index 4c6b1131b328..a1036a21c3c9 100644 --- a/packages/astro/src/integrations/astroFeaturesValidation.ts +++ b/packages/astro/src/integrations/astroFeaturesValidation.ts @@ -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}).` ); }