From 9d6bcdb88fcb9df0c5c70e2b591bcf962ce55f63 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Wed, 23 Oct 2024 10:44:49 +0200 Subject: [PATCH] fix: astro:env warning (#12286) --- .changeset/late-fireants-ring.md | 5 +++++ .../src/integrations/features-validation.ts | 16 +++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 .changeset/late-fireants-ring.md diff --git a/.changeset/late-fireants-ring.md b/.changeset/late-fireants-ring.md new file mode 100644 index 0000000000..8baceb6f2a --- /dev/null +++ b/.changeset/late-fireants-ring.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes a case where a warning for experimental `astro:env` support would be shown when using an adapter but not actually using `astro:env` diff --git a/packages/astro/src/integrations/features-validation.ts b/packages/astro/src/integrations/features-validation.ts index e0613c6e80..48ae6c2bca 100644 --- a/packages/astro/src/integrations/features-validation.ts +++ b/packages/astro/src/integrations/features-validation.ts @@ -89,13 +89,15 @@ export function validateSupportedFeatures( } } - validationResult.envGetSecret = validateSupportKind( - envGetSecret, - adapterName, - logger, - 'astro:env getSecret', - () => config?.experimental?.env !== undefined, - ); + if (config.experimental?.env) { + validationResult.envGetSecret = validateSupportKind( + envGetSecret, + adapterName, + logger, + 'astro:env getSecret', + () => true, + ); + } return validationResult; }