summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/wet-chefs-develop.md6
-rw-r--r--packages/integrations/node/src/index.ts1
-rw-r--r--packages/integrations/node/src/server.ts6
-rw-r--r--packages/integrations/vercel/src/serverless/adapter.ts1
-rw-r--r--packages/integrations/vercel/src/serverless/entrypoint.ts6
-rw-r--r--packages/integrations/vercel/src/static/adapter.ts1
6 files changed, 21 insertions, 0 deletions
diff --git a/.changeset/wet-chefs-develop.md b/.changeset/wet-chefs-develop.md
new file mode 100644
index 000000000..e2a29702b
--- /dev/null
+++ b/.changeset/wet-chefs-develop.md
@@ -0,0 +1,6 @@
+---
+'@astrojs/vercel': minor
+'@astrojs/node': minor
+---
+
+Adds support for experimental `astro:env` released in Astro 4.10
diff --git a/packages/integrations/node/src/index.ts b/packages/integrations/node/src/index.ts
index 2108ec5ca..5fec3850c 100644
--- a/packages/integrations/node/src/index.ts
+++ b/packages/integrations/node/src/index.ts
@@ -19,6 +19,7 @@ export function getAdapter(options: Options): AstroAdapter {
isSquooshCompatible: true,
},
i18nDomains: 'experimental',
+ envGetSecret: 'experimental',
},
};
}
diff --git a/packages/integrations/node/src/server.ts b/packages/integrations/node/src/server.ts
index 1fb9d93e5..e5b503292 100644
--- a/packages/integrations/node/src/server.ts
+++ b/packages/integrations/node/src/server.ts
@@ -5,6 +5,12 @@ import { createStandaloneHandler } from './standalone.js';
import startServer from './standalone.js';
import type { Options } from './types.js';
+// Won't throw if the virtual module is not available because it's not supported in
+// the users's astro version or if astro:env is not enabled in the project
+await import('astro/env/setup')
+ .then((mod) => mod.setGetEnv((key) => process.env[key]))
+ .catch(() => {});
+
applyPolyfills();
export function createExports(manifest: SSRManifest, options: Options) {
const app = new NodeApp(manifest);
diff --git a/packages/integrations/vercel/src/serverless/adapter.ts b/packages/integrations/vercel/src/serverless/adapter.ts
index 1090555cc..65f5fafd7 100644
--- a/packages/integrations/vercel/src/serverless/adapter.ts
+++ b/packages/integrations/vercel/src/serverless/adapter.ts
@@ -98,6 +98,7 @@ function getAdapter({
isSquooshCompatible: true,
},
i18nDomains: 'experimental',
+ envGetSecret: 'experimental',
},
};
}
diff --git a/packages/integrations/vercel/src/serverless/entrypoint.ts b/packages/integrations/vercel/src/serverless/entrypoint.ts
index a8e8ebc41..11d3c3a91 100644
--- a/packages/integrations/vercel/src/serverless/entrypoint.ts
+++ b/packages/integrations/vercel/src/serverless/entrypoint.ts
@@ -8,6 +8,12 @@ import {
ASTRO_PATH_PARAM,
} from './adapter.js';
+// Won't throw if the virtual module is not available because it's not supported in
+// the users's astro version or if astro:env is not enabled in the project
+await import('astro/env/setup')
+ .then((mod) => mod.setGetEnv((key) => process.env[key]))
+ .catch(() => {});
+
applyPolyfills();
export const createExports = (
diff --git a/packages/integrations/vercel/src/static/adapter.ts b/packages/integrations/vercel/src/static/adapter.ts
index d7fd57fd5..4a66c558e 100644
--- a/packages/integrations/vercel/src/static/adapter.ts
+++ b/packages/integrations/vercel/src/static/adapter.ts
@@ -32,6 +32,7 @@ function getAdapter(): AstroAdapter {
staticOutput: 'stable',
serverOutput: 'unsupported',
hybridOutput: 'unsupported',
+ envGetSecret: 'unsupported',
},
adapterFeatures: {
edgeMiddleware: false,