Skip to content

Commit

Permalink
Merge branch 'main' into feat/astro-env-adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-lefebvre authored Jun 8, 2024
2 parents c830445 + 2da877b commit 03bcb27
Show file tree
Hide file tree
Showing 44 changed files with 134 additions and 86 deletions.
2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.10.0"
"astro": "^4.10.1"
}
}
2 changes: 1 addition & 1 deletion examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"@astrojs/mdx": "^3.1.0",
"@astrojs/rss": "^4.0.6",
"@astrojs/sitemap": "^3.1.5",
"astro": "^4.10.0"
"astro": "^4.10.1"
}
}
2 changes: 1 addition & 1 deletion examples/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^4.10.0"
"astro": "^4.10.1"
},
"peerDependencies": {
"astro": "^4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/container-with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test": "vitest run"
},
"dependencies": {
"astro": "^4.10.0",
"astro": "^4.10.1",
"@astrojs/react": "^3.5.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"@astrojs/alpinejs": "^0.4.0",
"@types/alpinejs": "^3.13.10",
"alpinejs": "^3.14.0",
"astro": "^4.10.0"
"astro": "^4.10.1"
}
}
2 changes: 1 addition & 1 deletion examples/framework-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/lit": "^4.2.0",
"@webcomponents/template-shadowroot": "^0.2.1",
"astro": "^4.10.0",
"astro": "^4.10.1",
"lit": "^3.1.3"
}
}
2 changes: 1 addition & 1 deletion examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@astrojs/vue": "^4.4.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"astro": "^4.10.0",
"astro": "^4.10.1",
"preact": "^10.22.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/preact": "^3.4.0",
"@preact/signals": "^1.2.3",
"astro": "^4.10.0",
"astro": "^4.10.1",
"preact": "^10.22.0"
}
}
2 changes: 1 addition & 1 deletion examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@astrojs/react": "^3.5.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"astro": "^4.10.0",
"astro": "^4.10.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^4.3.0",
"astro": "^4.10.0",
"astro": "^4.10.1",
"solid-js": "^1.8.17"
}
}
2 changes: 1 addition & 1 deletion examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/svelte": "^5.5.0",
"astro": "^4.10.0",
"astro": "^4.10.1",
"svelte": "^4.2.17"
}
}
2 changes: 1 addition & 1 deletion examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/vue": "^4.4.0",
"astro": "^4.10.0",
"astro": "^4.10.1",
"vue": "^3.4.27"
}
}
4 changes: 2 additions & 2 deletions examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/node": "^8.2.5",
"astro": "^4.10.0"
"@astrojs/node": "^8.2.6",
"astro": "^4.10.1"
}
}
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^4.10.0"
"astro": "^4.10.1"
},
"peerDependencies": {
"astro": "^4.0.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"server": "node dist/server/entry.mjs"
},
"dependencies": {
"@astrojs/node": "^8.2.5",
"astro": "^4.10.0",
"@astrojs/node": "^8.2.6",
"astro": "^4.10.1",
"html-minifier": "^4.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.10.0"
"astro": "^4.10.1"
}
}
2 changes: 1 addition & 1 deletion examples/non-html-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.10.0"
"astro": "^4.10.1"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.10.0"
"astro": "^4.10.1"
}
}
4 changes: 2 additions & 2 deletions examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"server": "node dist/server/entry.mjs"
},
"dependencies": {
"@astrojs/node": "^8.2.5",
"@astrojs/node": "^8.2.6",
"@astrojs/svelte": "^5.5.0",
"astro": "^4.10.0",
"astro": "^4.10.1",
"svelte": "^4.2.17"
}
}
2 changes: 1 addition & 1 deletion examples/starlog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.10.0",
"astro": "^4.10.1",
"sass": "^1.77.3",
"sharp": "^0.33.3"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/toolbar-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"./app": "./dist/app.js"
},
"devDependencies": {
"astro": "^4.10.0"
"astro": "^4.10.1"
}
}
4 changes: 2 additions & 2 deletions examples/view-transitions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"devDependencies": {
"@astrojs/tailwind": "^5.1.0",
"@astrojs/node": "^8.2.5",
"astro": "^4.10.0"
"@astrojs/node": "^8.2.6",
"astro": "^4.10.1"
}
}
2 changes: 1 addition & 1 deletion examples/with-markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^0.11.0",
"astro": "^4.10.0"
"astro": "^4.10.1"
}
}
2 changes: 1 addition & 1 deletion examples/with-markdown-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/markdown-remark": "^5.1.0",
"astro": "^4.10.0",
"astro": "^4.10.1",
"hast-util-select": "^6.0.2",
"rehype-autolink-headings": "^7.1.0",
"rehype-slug": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-markdown-shiki/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.10.0"
"astro": "^4.10.1"
}
}
2 changes: 1 addition & 1 deletion examples/with-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/mdx": "^3.1.0",
"@astrojs/preact": "^3.4.0",
"astro": "^4.10.0",
"astro": "^4.10.1",
"preact": "^10.22.0"
}
}
2 changes: 1 addition & 1 deletion examples/with-nanostores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/preact": "^3.4.0",
"@nanostores/preact": "^0.5.1",
"astro": "^4.10.0",
"astro": "^4.10.1",
"nanostores": "^0.10.3",
"preact": "^10.22.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@astrojs/mdx": "^3.1.0",
"@astrojs/tailwind": "^5.1.0",
"@types/canvas-confetti": "^1.6.4",
"astro": "^4.10.0",
"astro": "^4.10.1",
"autoprefixer": "^10.4.19",
"canvas-confetti": "^1.9.3",
"postcss": "^8.4.38",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test": "vitest"
},
"dependencies": {
"astro": "^4.10.0",
"astro": "^4.10.1",
"vitest": "^1.6.0"
}
}
12 changes: 12 additions & 0 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# astro

## 4.10.1

### Patch Changes

- [#11198](https://github.com/withastro/astro/pull/11198) [`8b9a499`](https://github.com/withastro/astro/commit/8b9a499d3733e9d0fc6a0bd067ece19bd36f4726) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where `astro:env` `getSecret` would not retrieve environment variables properly in dev and build modes

- [#11206](https://github.com/withastro/astro/pull/11206) [`734b98f`](https://github.com/withastro/astro/commit/734b98fecf0212cd76be3c935a49f84a9a7dab34) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the experimental `astro:env` feature only**

Updates the adapter `astro:env` entrypoint from `astro:env/setup` to `astro/env/setup`

- [#11205](https://github.com/withastro/astro/pull/11205) [`8c45391`](https://github.com/withastro/astro/commit/8c4539145f0b6a735b65852b2f2b1a7e9f5a9c3f) Thanks [@Nin3lee](https://github.com/Nin3lee)! - Fixes a typo in the config reference

## 4.10.0

### Minor Changes
Expand Down
4 changes: 0 additions & 4 deletions packages/astro/client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
3 changes: 2 additions & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astro",
"version": "4.10.0",
"version": "4.10.1",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/@types/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2106,7 +2106,7 @@ export interface AstroUserConfig {
*
* There are currently three data types supported: strings, numbers and booleans.
*
* There are three kinds of environment variables, determined by the combination of `context` (client or server) and `access` (private or public) settings defined in your [`env.schema`](#experimentalenvschema):
* There are three kinds of environment variables, determined by the combination of `context` (client or server) and `access` (secret or public) settings defined in your [`env.schema`](#experimentalenvschema):
*
* - **Public client variables**: These variables end up in both your final client and server bundles, and can be accessed from both client and server through the `astro:env/client` module:
*
Expand Down
1 change: 0 additions & 1 deletion packages/astro/src/env/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
1 change: 1 addition & 0 deletions packages/astro/src/env/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { setGetEnv, type GetEnv } from './runtime.js';
10 changes: 6 additions & 4 deletions packages/astro/src/env/vite-plugin-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -47,6 +46,12 @@ export function astroEnv({
fileURLToPath(settings.config.root),
''
);
for (const [key, value] of Object.entries(loadedEnv)) {
if (value !== undefined) {
process.env[key] = value;
}
}

const validatedVariables = validatePublicVariables({ schema, loadedEnv });

const clientTemplates = getClientTemplates({ validatedVariables });
Expand Down Expand Up @@ -75,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)) {
Expand Down
1 change: 0 additions & 1 deletion packages/astro/src/virtual-modules/env-setup.ts

This file was deleted.

Loading

0 comments on commit 03bcb27

Please sign in to comment.