summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/silly-beds-hammer.md7
-rw-r--r--packages/astro/client.d.ts4
-rw-r--r--packages/astro/package.json1
-rw-r--r--packages/astro/src/env/constants.ts1
-rw-r--r--packages/astro/src/env/setup.ts1
-rw-r--r--packages/astro/src/env/vite-plugin-env.ts4
-rw-r--r--packages/astro/src/virtual-modules/env-setup.ts1
-rw-r--r--packages/astro/test/test-adapter.js2
8 files changed, 10 insertions, 11 deletions
diff --git a/.changeset/silly-beds-hammer.md b/.changeset/silly-beds-hammer.md
new file mode 100644
index 000000000..a8d44aaf7
--- /dev/null
+++ b/.changeset/silly-beds-hammer.md
@@ -0,0 +1,7 @@
+---
+'astro': patch
+---
+
+**BREAKING CHANGE to the experimental `astro:env` feature only**
+
+Updates the adapter `astro:env` entrypoint from `astro:env/setup` to `astro/env/setup`
diff --git a/packages/astro/client.d.ts b/packages/astro/client.d.ts
index 8a277f5aa..0870d3dcc 100644
--- a/packages/astro/client.d.ts
+++ b/packages/astro/client.d.ts
@@ -164,10 +164,6 @@ declare module 'astro:components' {
export * from 'astro/components';
}
-declare module 'astro:env/setup' {
- export * from 'astro/virtual-modules/env-setup.js';
-}
-
type MD = import('./dist/@types/astro.js').MarkdownInstance<Record<string, any>>;
interface ExportedMarkdownModuleEntities {
frontmatter: MD['frontmatter'];
diff --git a/packages/astro/package.json b/packages/astro/package.json
index fca84cc51..a167fc1bc 100644
--- a/packages/astro/package.json
+++ b/packages/astro/package.json
@@ -33,6 +33,7 @@
},
"./env": "./env.d.ts",
"./env/runtime": "./dist/env/runtime.js",
+ "./env/setup": "./dist/env/setup.js",
"./types": "./types.d.ts",
"./client": "./client.d.ts",
"./astro-jsx": "./astro-jsx.d.ts",
diff --git a/packages/astro/src/env/constants.ts b/packages/astro/src/env/constants.ts
index 7a1e65155..19ea17c64 100644
--- a/packages/astro/src/env/constants.ts
+++ b/packages/astro/src/env/constants.ts
@@ -4,7 +4,6 @@ export const VIRTUAL_MODULES_IDS = {
internal: 'virtual:astro:env/internal',
};
export const VIRTUAL_MODULES_IDS_VALUES = new Set(Object.values(VIRTUAL_MODULES_IDS));
-export const VIRTUAL_MODULE_SETUP_ID = 'astro:env/setup';
export const PUBLIC_PREFIX = 'PUBLIC_';
export const ENV_TYPES_FILE = 'env.d.ts';
diff --git a/packages/astro/src/env/setup.ts b/packages/astro/src/env/setup.ts
new file mode 100644
index 000000000..179067b10
--- /dev/null
+++ b/packages/astro/src/env/setup.ts
@@ -0,0 +1 @@
+export { setGetEnv, type GetEnv } from './runtime.js';
diff --git a/packages/astro/src/env/vite-plugin-env.ts b/packages/astro/src/env/vite-plugin-env.ts
index 0a53ecd2f..2f6a0708f 100644
--- a/packages/astro/src/env/vite-plugin-env.ts
+++ b/packages/astro/src/env/vite-plugin-env.ts
@@ -9,7 +9,6 @@ import {
TYPES_TEMPLATE_URL,
VIRTUAL_MODULES_IDS,
VIRTUAL_MODULES_IDS_VALUES,
- VIRTUAL_MODULE_SETUP_ID,
} from './constants.js';
import type { EnvSchema } from './schema.js';
import { getEnvFieldType, validateEnvVariable } from './validators.js';
@@ -81,9 +80,6 @@ export function astroEnv({
if (VIRTUAL_MODULES_IDS_VALUES.has(id)) {
return resolveVirtualModuleId(id);
}
- if (id === VIRTUAL_MODULE_SETUP_ID) {
- return this.resolve('astro/virtual-modules/env-setup.js');
- }
},
load(id, options) {
if (id === resolveVirtualModuleId(VIRTUAL_MODULES_IDS.client)) {
diff --git a/packages/astro/src/virtual-modules/env-setup.ts b/packages/astro/src/virtual-modules/env-setup.ts
deleted file mode 100644
index c86452975..000000000
--- a/packages/astro/src/virtual-modules/env-setup.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { setGetEnv, type GetEnv } from '../env/runtime.js';
diff --git a/packages/astro/test/test-adapter.js b/packages/astro/test/test-adapter.js
index ab05d8811..880b5fe64 100644
--- a/packages/astro/test/test-adapter.js
+++ b/packages/astro/test/test-adapter.js
@@ -53,7 +53,7 @@ export default function ({
${
env
? `
- await import('astro:env/setup')
+ await import('astro/env/setup')
.then(mod => mod.setGetEnv((key) => {
const data = ${JSON.stringify(env)};
return data[key];