From bebf38c0cb539de04007f5e721bf459300b895a1 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Tue, 12 Dec 2023 11:19:15 +0100 Subject: [PATCH 1/2] 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}).` ); } From 63b3cd19ee5d3f9616d6d748a6438e314b25b660 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Tue, 12 Dec 2023 10:20:17 +0000 Subject: [PATCH 2/2] [ci] format --- packages/astro/src/integrations/astroFeaturesValidation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro/src/integrations/astroFeaturesValidation.ts b/packages/astro/src/integrations/astroFeaturesValidation.ts index a1036a21c3c9..8bae77846c29 100644 --- a/packages/astro/src/integrations/astroFeaturesValidation.ts +++ b/packages/astro/src/integrations/astroFeaturesValidation.ts @@ -104,7 +104,7 @@ function featureIsExperimental(adapterName: string, logger: Logger, featureName: ); } -function featureIsDeprecated(adapterName: string , logger: Logger, featureName: string,) { +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}).`