Merge branch 'withastro:main' into main

This commit is contained in:
Chris 2023-08-29 11:13:46 +02:00 committed by GitHub
commit 2e11ca5ea9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
77 changed files with 439 additions and 238 deletions

View file

@ -0,0 +1,6 @@
---
'@astrojs/telemetry': patch
'astro': patch
---
Update telemetry notice

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fix, lazily initialize ResponseWithEncoding

View file

@ -34,6 +34,7 @@
"angry-dogs-shake", "angry-dogs-shake",
"big-tips-whisper", "big-tips-whisper",
"brave-cheetahs-float", "brave-cheetahs-float",
"chatty-ways-hunt",
"chilled-ducks-grin", "chilled-ducks-grin",
"clever-bats-breathe", "clever-bats-breathe",
"cool-feet-rest", "cool-feet-rest",
@ -52,6 +53,7 @@
"giant-plants-sip", "giant-plants-sip",
"gorgeous-kiwis-stare", "gorgeous-kiwis-stare",
"grumpy-pens-melt", "grumpy-pens-melt",
"grumpy-years-remember",
"happy-penguins-hug", "happy-penguins-hug",
"heavy-walls-arrive", "heavy-walls-arrive",
"honest-houses-deny", "honest-houses-deny",
@ -67,6 +69,7 @@
"neat-owls-run", "neat-owls-run",
"neat-suns-search", "neat-suns-search",
"odd-books-live", "odd-books-live",
"olive-moles-tan",
"perfect-horses-tell", "perfect-horses-tell",
"plenty-keys-add", "plenty-keys-add",
"popular-carrots-sneeze", "popular-carrots-sneeze",
@ -75,7 +78,9 @@
"quick-boats-bow", "quick-boats-bow",
"rude-ears-play", "rude-ears-play",
"serious-waves-fry", "serious-waves-fry",
"shiny-dryers-swim",
"silent-bikes-crash", "silent-bikes-crash",
"silly-dolphins-try",
"six-grapes-look", "six-grapes-look",
"slimy-carrots-sell", "slimy-carrots-sell",
"small-nails-try", "small-nails-try",
@ -83,6 +88,7 @@
"spicy-eels-rush", "spicy-eels-rush",
"spicy-icons-live", "spicy-icons-live",
"spicy-stingrays-cheer", "spicy-stingrays-cheer",
"strange-peas-agree",
"strong-papayas-chew", "strong-papayas-chew",
"tame-files-glow", "tame-files-glow",
"tasty-camels-speak", "tasty-camels-speak",

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Paginate will now return exact types instead of a naive Record

View file

@ -0,0 +1,9 @@
---
'@astrojs/vercel': major
---
Vercel adapter now defaults to `functionPerRoute`.
With this change, `@astrojs/vercel/serverless` now splits each route into its own function. By doing this, the size of each function is reduced and startup time is faster.
You can disable this option, which will cause the code to be bundled into a single function, by setting `functionPerRoute` to `false`.

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Allow fallback animations on html element

View file

@ -11,6 +11,6 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^3.0.0-rc.7" "astro": "^3.0.0-rc.8"
} }
} }

View file

@ -14,6 +14,6 @@
"@astrojs/mdx": "^1.0.0-rc.2", "@astrojs/mdx": "^1.0.0-rc.2",
"@astrojs/rss": "^3.0.0-rc.2", "@astrojs/rss": "^3.0.0-rc.2",
"@astrojs/sitemap": "^3.0.0-rc.1", "@astrojs/sitemap": "^3.0.0-rc.1",
"astro": "^3.0.0-rc.7" "astro": "^3.0.0-rc.8"
} }
} }

View file

@ -15,7 +15,7 @@
], ],
"scripts": {}, "scripts": {},
"devDependencies": { "devDependencies": {
"astro": "^3.0.0-rc.7" "astro": "^3.0.0-rc.8"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "^2.0.0-beta.0" "astro": "^2.0.0-beta.0"

View file

@ -10,9 +10,9 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^3.0.0-rc.7" "astro": "^3.0.0-rc.8"
}, },
"devDependencies": { "devDependencies": {
"@astrojs/deno": "^5.0.0-rc.1" "@astrojs/deno": "^5.0.0-rc.2"
} }
} }

View file

@ -14,6 +14,6 @@
"@astrojs/alpinejs": "^0.3.0-rc.1", "@astrojs/alpinejs": "^0.3.0-rc.1",
"@types/alpinejs": "^3.7.2", "@types/alpinejs": "^3.7.2",
"alpinejs": "^3.12.3", "alpinejs": "^3.12.3",
"astro": "^3.0.0-rc.7" "astro": "^3.0.0-rc.8"
} }
} }

View file

@ -13,7 +13,7 @@
"dependencies": { "dependencies": {
"@astrojs/lit": "^3.0.0-rc.1", "@astrojs/lit": "^3.0.0-rc.1",
"@webcomponents/template-shadowroot": "^0.2.1", "@webcomponents/template-shadowroot": "^0.2.1",
"astro": "^3.0.0-rc.7", "astro": "^3.0.0-rc.8",
"lit": "^2.8.0" "lit": "^2.8.0"
} }
} }

View file

@ -16,7 +16,7 @@
"@astrojs/solid-js": "^3.0.0-rc.3", "@astrojs/solid-js": "^3.0.0-rc.3",
"@astrojs/svelte": "^4.0.0-rc.2", "@astrojs/svelte": "^4.0.0-rc.2",
"@astrojs/vue": "^3.0.0-rc.1", "@astrojs/vue": "^3.0.0-rc.1",
"astro": "^3.0.0-rc.7", "astro": "^3.0.0-rc.8",
"preact": "^10.17.1", "preact": "^10.17.1",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",

View file

@ -13,7 +13,7 @@
"dependencies": { "dependencies": {
"@astrojs/preact": "^3.0.0-rc.2", "@astrojs/preact": "^3.0.0-rc.2",
"@preact/signals": "^1.2.1", "@preact/signals": "^1.2.1",
"astro": "^3.0.0-rc.7", "astro": "^3.0.0-rc.8",
"preact": "^10.17.1" "preact": "^10.17.1"
} }
} }

View file

@ -14,7 +14,7 @@
"@astrojs/react": "^3.0.0-rc.5", "@astrojs/react": "^3.0.0-rc.5",
"@types/react": "^18.2.21", "@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7", "@types/react-dom": "^18.2.7",
"astro": "^3.0.0-rc.7", "astro": "^3.0.0-rc.8",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0" "react-dom": "^18.2.0"
} }

View file

@ -12,7 +12,7 @@
}, },
"dependencies": { "dependencies": {
"@astrojs/solid-js": "^3.0.0-rc.3", "@astrojs/solid-js": "^3.0.0-rc.3",
"astro": "^3.0.0-rc.7", "astro": "^3.0.0-rc.8",
"solid-js": "^1.7.11" "solid-js": "^1.7.11"
} }
} }

View file

@ -12,7 +12,7 @@
}, },
"dependencies": { "dependencies": {
"@astrojs/svelte": "^4.0.0-rc.2", "@astrojs/svelte": "^4.0.0-rc.2",
"astro": "^3.0.0-rc.7", "astro": "^3.0.0-rc.8",
"svelte": "^4.2.0" "svelte": "^4.2.0"
} }
} }

View file

@ -12,7 +12,7 @@
}, },
"dependencies": { "dependencies": {
"@astrojs/vue": "^3.0.0-rc.1", "@astrojs/vue": "^3.0.0-rc.1",
"astro": "^3.0.0-rc.7", "astro": "^3.0.0-rc.8",
"vue": "^3.3.4" "vue": "^3.3.4"
} }
} }

View file

@ -12,6 +12,6 @@
}, },
"dependencies": { "dependencies": {
"@astrojs/node": "^6.0.0-rc.1", "@astrojs/node": "^6.0.0-rc.1",
"astro": "^3.0.0-rc.7" "astro": "^3.0.0-rc.8"
} }
} }

View file

@ -15,7 +15,7 @@
], ],
"scripts": {}, "scripts": {},
"devDependencies": { "devDependencies": {
"astro": "^3.0.0-rc.7" "astro": "^3.0.0-rc.8"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "^2.0.0-beta.0" "astro": "^2.0.0-beta.0"

View file

@ -13,7 +13,7 @@
}, },
"dependencies": { "dependencies": {
"@astrojs/node": "^6.0.0-rc.1", "@astrojs/node": "^6.0.0-rc.1",
"astro": "^3.0.0-rc.7", "astro": "^3.0.0-rc.8",
"html-minifier": "^4.0.0" "html-minifier": "^4.0.0"
} }
} }

View file

@ -11,6 +11,6 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^3.0.0-rc.7" "astro": "^3.0.0-rc.8"
} }
} }

View file

@ -11,6 +11,6 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^3.0.0-rc.7" "astro": "^3.0.0-rc.8"
} }
} }

View file

@ -11,6 +11,6 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^3.0.0-rc.7" "astro": "^3.0.0-rc.8"
} }
} }

View file

@ -14,7 +14,7 @@
"dependencies": { "dependencies": {
"@astrojs/node": "^6.0.0-rc.1", "@astrojs/node": "^6.0.0-rc.1",
"@astrojs/svelte": "^4.0.0-rc.2", "@astrojs/svelte": "^4.0.0-rc.2",
"astro": "^3.0.0-rc.7", "astro": "^3.0.0-rc.8",
"svelte": "^4.2.0" "svelte": "^4.2.0"
} }
} }

View file

@ -12,6 +12,6 @@
}, },
"dependencies": { "dependencies": {
"@astrojs/markdoc": "^0.5.0-rc.1", "@astrojs/markdoc": "^0.5.0-rc.1",
"astro": "^3.0.0-rc.7" "astro": "^3.0.0-rc.8"
} }
} }

View file

@ -12,7 +12,7 @@
}, },
"dependencies": { "dependencies": {
"@astrojs/markdown-remark": "^3.0.0-rc.1", "@astrojs/markdown-remark": "^3.0.0-rc.1",
"astro": "^3.0.0-rc.7", "astro": "^3.0.0-rc.8",
"hast-util-select": "^5.0.5", "hast-util-select": "^5.0.5",
"rehype-autolink-headings": "^6.1.1", "rehype-autolink-headings": "^6.1.1",
"rehype-slug": "^5.1.0", "rehype-slug": "^5.1.0",

View file

@ -11,6 +11,6 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^3.0.0-rc.7" "astro": "^3.0.0-rc.8"
} }
} }

View file

@ -13,7 +13,7 @@
"dependencies": { "dependencies": {
"@astrojs/mdx": "^1.0.0-rc.2", "@astrojs/mdx": "^1.0.0-rc.2",
"@astrojs/preact": "^3.0.0-rc.2", "@astrojs/preact": "^3.0.0-rc.2",
"astro": "^3.0.0-rc.7", "astro": "^3.0.0-rc.8",
"preact": "^10.17.1" "preact": "^10.17.1"
} }
} }

View file

@ -13,7 +13,7 @@
"dependencies": { "dependencies": {
"@astrojs/preact": "^3.0.0-rc.2", "@astrojs/preact": "^3.0.0-rc.2",
"@nanostores/preact": "^0.5.0", "@nanostores/preact": "^0.5.0",
"astro": "^3.0.0-rc.7", "astro": "^3.0.0-rc.8",
"nanostores": "^0.9.3", "nanostores": "^0.9.3",
"preact": "^10.17.1" "preact": "^10.17.1"
} }

View file

@ -14,7 +14,7 @@
"@astrojs/mdx": "^1.0.0-rc.2", "@astrojs/mdx": "^1.0.0-rc.2",
"@astrojs/tailwind": "^5.0.0-rc.1", "@astrojs/tailwind": "^5.0.0-rc.1",
"@types/canvas-confetti": "^1.6.0", "@types/canvas-confetti": "^1.6.0",
"astro": "^3.0.0-rc.7", "astro": "^3.0.0-rc.8",
"autoprefixer": "^10.4.15", "autoprefixer": "^10.4.15",
"canvas-confetti": "^1.6.0", "canvas-confetti": "^1.6.0",
"postcss": "^8.4.28", "postcss": "^8.4.28",

View file

@ -11,7 +11,7 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^3.0.0-rc.7", "astro": "^3.0.0-rc.8",
"vite-plugin-pwa": "0.16.4", "vite-plugin-pwa": "0.16.4",
"workbox-window": "^7.0.0" "workbox-window": "^7.0.0"
} }

View file

@ -12,7 +12,7 @@
"test": "vitest" "test": "vitest"
}, },
"dependencies": { "dependencies": {
"astro": "^3.0.0-rc.7", "astro": "^3.0.0-rc.8",
"vitest": "^0.34.2" "vitest": "^0.34.2"
} }
} }

View file

@ -1,5 +1,17 @@
# astro # astro
## 3.0.0-rc.8
### Patch Changes
- [#8251](https://github.com/withastro/astro/pull/8251) [`46c4c0e05`](https://github.com/withastro/astro/commit/46c4c0e053f830585b9ef229ce1c259df00a80f8) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds a link to the error reference in the CLI when an error occurs
- [#8253](https://github.com/withastro/astro/pull/8253) [`1048aca55`](https://github.com/withastro/astro/commit/1048aca550769415e528016e42b358ffbfd44b61) Thanks [@matthewp](https://github.com/matthewp)! - Fix, lazily initialize ResponseWithEncoding
- [#8229](https://github.com/withastro/astro/pull/8229) [`ffc9e2d3d`](https://github.com/withastro/astro/commit/ffc9e2d3de46049bf3d82140ef018f524fb03187) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Paginate will now return exact types instead of a naive Record
- [#8237](https://github.com/withastro/astro/pull/8237) [`3674584e0`](https://github.com/withastro/astro/commit/3674584e02b161a698b429ceb66723918fdc56ac) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fix `astro check` not finding the `@astrojs/check` package
## 3.0.0-rc.7 ## 3.0.0-rc.7
### Patch Changes ### Patch Changes

View file

@ -57,7 +57,7 @@ declare module 'astro:assets' {
}; };
type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] }; type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] }; type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
type ImgAttributes = WithRequired< type ImgAttributes = WithRequired<
Omit<import('./types').HTMLAttributes<'img'>, 'src' | 'width' | 'height'>, Omit<import('./types').HTMLAttributes<'img'>, 'src' | 'width' | 'height'>,
'alt' 'alt'

View file

@ -220,23 +220,15 @@ const { fallback = 'animate' } = Astro.props as Props;
links.length && (await Promise.all(links)); links.length && (await Promise.all(links));
if (fallback === 'animate') { if (fallback === 'animate') {
let isAnimating = false;
addEventListener('animationstart', () => (isAnimating = true), { once: true });
// Trigger the animations // Trigger the animations
document.documentElement.dataset.astroTransitionFallback = 'old'; document.documentElement.dataset.astroTransitionFallback = 'old';
const finished = Promise.all(document.getAnimations().map(a => a.finished));
const fallbackSwap = () => { const fallbackSwap = () => {
removeEventListener('animationend', fallbackSwap);
clearTimeout(timeout);
swap(); swap();
document.documentElement.dataset.astroTransitionFallback = 'new'; document.documentElement.dataset.astroTransitionFallback = 'new';
}; };
// If there are any animations, want for the animationend event. await finished;
addEventListener('animationend', fallbackSwap, { once: true }); fallbackSwap();
// If there are no animations, go ahead and swap on next tick
// This is necessary because we do not know if there are animations.
// The setTimeout is a fallback in case there are none.
let timeout = setTimeout(() => !isAnimating && fallbackSwap());
} else { } else {
swap(); swap();
} }

View file

@ -1,3 +1,3 @@
<video controls="" autoplay="" name="media" transition:persist transition:name="video"> <video controls="" autoplay="" name="media" transition:persist transition:name="video" autoplay>
<source src="https://ia804502.us.archive.org/33/items/GoldenGa1939_3/GoldenGa1939_3_512kb.mp4" type="video/mp4"> <source src="https://ia804502.us.archive.org/33/items/GoldenGa1939_3/GoldenGa1939_3_512kb.mp4" type="video/mp4">
</video> </video>

View file

@ -6,12 +6,4 @@ import Video from '../components/Video.astro';
<p id="video-one">Page 1</p> <p id="video-one">Page 1</p>
<a id="click-two" href="/video-two">go to 2</a> <a id="click-two" href="/video-two">go to 2</a>
<Video /> <Video />
<script>
const vid = document.querySelector('video');
vid.addEventListener('canplay', () => {
// Jump to the 1 minute mark
vid.currentTime = 60;
vid.dataset.ready = '';
}, { once: true });
</script>
</Layout> </Layout>

View file

@ -302,7 +302,7 @@ test.describe('View Transitions', () => {
// Go to page 1 // Go to page 1
await page.goto(astro.resolveUrl('/video-one')); await page.goto(astro.resolveUrl('/video-one'));
const vid = page.locator('video[data-ready]'); const vid = page.locator('video');
await expect(vid).toBeVisible(); await expect(vid).toBeVisible();
const firstTime = await page.evaluate(getTime); const firstTime = await page.evaluate(getTime);

View file

@ -1,6 +1,6 @@
{ {
"name": "astro", "name": "astro",
"version": "3.0.0-rc.7", "version": "3.0.0-rc.8",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.", "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module", "type": "module",
"author": "withastro", "author": "withastro",

View file

@ -24,6 +24,8 @@ import type { AstroIntegrationLogger, Logger, LoggerLevel } from '../core/logger
import type { AstroComponentFactory, AstroComponentInstance } from '../runtime/server'; import type { AstroComponentFactory, AstroComponentInstance } from '../runtime/server';
import type { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './../core/constants.js'; import type { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './../core/constants.js';
export { type AstroIntegrationLogger };
export type { export type {
MarkdownHeading, MarkdownHeading,
MarkdownMetadata, MarkdownMetadata,
@ -1600,7 +1602,9 @@ export type GetStaticPaths = (
* const { slug } = Astro.params as Params; * const { slug } = Astro.params as Params;
* ``` * ```
*/ */
export type InferGetStaticParamsType<T> = T extends () => infer R | Promise<infer R> export type InferGetStaticParamsType<T> = T extends (
opts?: GetStaticPathsOptions
) => infer R | Promise<infer R>
? R extends Array<infer U> ? R extends Array<infer U>
? U extends { params: infer P } ? U extends { params: infer P }
? P ? P
@ -1631,7 +1635,9 @@ export type InferGetStaticParamsType<T> = T extends () => infer R | Promise<infe
* const { propA, propB } = Astro.props; * const { propA, propB } = Astro.props;
* ``` * ```
*/ */
export type InferGetStaticPropsType<T> = T extends () => infer R | Promise<infer R> export type InferGetStaticPropsType<T> = T extends (
opts: GetStaticPathsOptions
) => infer R | Promise<infer R>
? R extends Array<infer U> ? R extends Array<infer U>
? U extends { props: infer P } ? U extends { props: infer P }
? P ? P
@ -1678,13 +1684,13 @@ export type MarkdownContent<T extends Record<string, any> = Record<string, any>>
* *
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#paginate) * [Astro reference](https://docs.astro.build/en/reference/api-reference/#paginate)
*/ */
export interface PaginateOptions { export interface PaginateOptions<PaginateProps extends Props, PaginateParams extends Params> {
/** the number of items per-page (default: `10`) */ /** the number of items per-page (default: `10`) */
pageSize?: number; pageSize?: number;
/** key: value object of page params (ex: `{ tag: 'javascript' }`) */ /** key: value object of page params (ex: `{ tag: 'javascript' }`) */
params?: Params; params?: PaginateParams;
/** object of props to forward to `page` result */ /** object of props to forward to `page` result */
props?: Props; props?: PaginateProps;
} }
/** /**
@ -1718,7 +1724,33 @@ export interface Page<T = any> {
}; };
} }
export type PaginateFunction = (data: any[], args?: PaginateOptions) => GetStaticPathsResult; type OmitIndexSignature<ObjectType> = {
// eslint-disable-next-line @typescript-eslint/ban-types
[KeyType in keyof ObjectType as {} extends Record<KeyType, unknown>
? never
: KeyType]: ObjectType[KeyType];
};
// eslint-disable-next-line @typescript-eslint/ban-types
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
export type PaginateFunction = <
PaginateData,
AdditionalPaginateProps extends Props,
AdditionalPaginateParams extends Params,
>(
data: PaginateData[],
args?: PaginateOptions<AdditionalPaginateProps, AdditionalPaginateParams>
) => {
params: Simplify<
{
page: string | undefined;
} & OmitIndexSignature<AdditionalPaginateParams>
>;
props: Simplify<
{
page: Page<PaginateData>;
} & OmitIndexSignature<AdditionalPaginateProps>
>;
}[];
export type Params = Record<string, string | undefined>; export type Params = Record<string, string | undefined>;
@ -2173,6 +2205,7 @@ export interface PreviewServerParams {
host: string | undefined; host: string | undefined;
port: number; port: number;
base: string; base: string;
logger: AstroIntegrationLogger;
} }
export type CreatePreviewServer = ( export type CreatePreviewServer = (

View file

@ -109,6 +109,11 @@ async function runCommand(cmd: string, flags: yargs.Arguments) {
await update(subcommand, { flags }); await update(subcommand, { flags });
return; return;
} }
case 'sync': {
const { sync } = await import('./sync/index.js');
const exitCode = await sync({ flags });
return process.exit(exitCode);
}
} }
// In verbose/debug mode, we log the debug logs asap before any potential errors could appear // In verbose/debug mode, we log the debug logs asap before any potential errors could appear
@ -122,6 +127,9 @@ async function runCommand(cmd: string, flags: yargs.Arguments) {
process.env.NODE_ENV = cmd === 'dev' ? 'development' : 'production'; process.env.NODE_ENV = cmd === 'dev' ? 'development' : 'production';
} }
const { notify } = await import('./telemetry/index.js');
await notify();
// These commands uses the logging and user config. All commands are assumed to have been handled // These commands uses the logging and user config. All commands are assumed to have been handled
// by the end of this switch statement. // by the end of this switch statement.
switch (cmd) { switch (cmd) {
@ -161,11 +169,6 @@ async function runCommand(cmd: string, flags: yargs.Arguments) {
return process.exit(checkServer ? 1 : 0); return process.exit(checkServer ? 1 : 0);
} }
} }
case 'sync': {
const { sync } = await import('./sync/index.js');
const exitCode = await sync({ flags });
return process.exit(exitCode);
}
} }
// No command handler matched! This is unexpected. // No command handler matched! This is unexpected.

View file

@ -7,6 +7,13 @@ interface TelemetryOptions {
flags: yargs.Arguments; flags: yargs.Arguments;
} }
export async function notify() {
await telemetry.notify(() => {
console.log(msg.telemetryNotice() + '\n');
return true;
});
}
export async function update(subcommand: string, { flags }: TelemetryOptions) { export async function update(subcommand: string, { flags }: TelemetryOptions) {
const isValid = ['enable', 'disable', 'reset'].includes(subcommand); const isValid = ['enable', 'disable', 'reset'].includes(subcommand);

View file

@ -9,7 +9,7 @@ import type {
import type { SinglePageBuiltModule } from '../build/types'; import type { SinglePageBuiltModule } from '../build/types';
import { getSetCookiesFromResponse } from '../cookies/index.js'; import { getSetCookiesFromResponse } from '../cookies/index.js';
import { consoleLogDestination } from '../logger/console.js'; import { consoleLogDestination } from '../logger/console.js';
import { Logger } from '../logger/core.js'; import { AstroIntegrationLogger, Logger } from '../logger/core.js';
import { import {
collapseDuplicateSlashes, collapseDuplicateSlashes,
prependForwardSlash, prependForwardSlash,
@ -58,6 +58,7 @@ export class App {
#pipeline: SSRRoutePipeline; #pipeline: SSRRoutePipeline;
#onRequest: MiddlewareEndpointHandler | undefined; #onRequest: MiddlewareEndpointHandler | undefined;
#middlewareLoaded: boolean; #middlewareLoaded: boolean;
#adapterLogger: AstroIntegrationLogger;
constructor(manifest: SSRManifest, streaming = true) { constructor(manifest: SSRManifest, streaming = true) {
this.#manifest = manifest; this.#manifest = manifest;
@ -68,10 +69,14 @@ export class App {
this.#baseWithoutTrailingSlash = removeTrailingForwardSlash(this.#manifest.base); this.#baseWithoutTrailingSlash = removeTrailingForwardSlash(this.#manifest.base);
this.#pipeline = new SSRRoutePipeline(this.#createEnvironment(streaming)); this.#pipeline = new SSRRoutePipeline(this.#createEnvironment(streaming));
this.#middlewareLoaded = false; this.#middlewareLoaded = false;
this.#adapterLogger = new AstroIntegrationLogger(
this.#logger.options,
this.#manifest.adapterName
);
} }
set setManifest(newManifest: SSRManifest) { getAdapterLogger(): AstroIntegrationLogger {
this.#manifest = newManifest; return this.#adapterLogger;
} }
/** /**

View file

@ -163,7 +163,7 @@ export async function generatePages(opts: StaticBuildOptions, internals: BuildIn
opts.settings.adapter?.adapterFeatures?.functionPerRoute opts.settings.adapter?.adapterFeatures?.functionPerRoute
) { ) {
// forcing to use undefined, so we fail in an expected way if the module is not even there. // forcing to use undefined, so we fail in an expected way if the module is not even there.
const ssrEntry = ssrEntryPage?.manifest?.pageModule; const ssrEntry = ssrEntryPage?.pageModule;
if (ssrEntry) { if (ssrEntry) {
await generatePage(pageData, ssrEntry, builtPaths, pipeline); await generatePage(pageData, ssrEntry, builtPaths, pipeline);
} else { } else {

View file

@ -178,6 +178,8 @@ function vitePluginSSRSplit(
imports.push(...ssrCode.imports); imports.push(...ssrCode.imports);
contents.push(...ssrCode.contents); contents.push(...ssrCode.contents);
exports.push('export { pageModule }');
return `${imports.join('\n')}${contents.join('\n')}${exports.join('\n')}`; return `${imports.join('\n')}${contents.join('\n')}${exports.join('\n')}`;
} }
return void 0; return void 0;

View file

@ -39,6 +39,7 @@ export function createAPIContext({
props, props,
adapterName, adapterName,
}: CreateAPIContext): APIContext { }: CreateAPIContext): APIContext {
initResponseWithEncoding();
const context = { const context = {
cookies: new AstroCookies(request), cookies: new AstroCookies(request),
request, request,
@ -91,28 +92,44 @@ export function createAPIContext({
type ResponseParameters = ConstructorParameters<typeof Response>; type ResponseParameters = ConstructorParameters<typeof Response>;
export class ResponseWithEncoding extends Response { export let ResponseWithEncoding: ReturnType<typeof initResponseWithEncoding>;
constructor(body: ResponseParameters[0], init: ResponseParameters[1], encoding?: BufferEncoding) { // TODO Remove this after StackBlitz supports Node 18.
// If a body string is given, try to encode it to preserve the behaviour as simple objects. let initResponseWithEncoding = () => {
// We don't do the full handling as simple objects so users can control how headers are set instead. class LocalResponseWithEncoding extends Response {
if (typeof body === 'string') { constructor(
// In NodeJS, we can use Buffer.from which supports all BufferEncoding body: ResponseParameters[0],
if (typeof Buffer !== 'undefined' && Buffer.from) { init: ResponseParameters[1],
body = Buffer.from(body, encoding); encoding?: BufferEncoding
) {
// If a body string is given, try to encode it to preserve the behaviour as simple objects.
// We don't do the full handling as simple objects so users can control how headers are set instead.
if (typeof body === 'string') {
// In NodeJS, we can use Buffer.from which supports all BufferEncoding
if (typeof Buffer !== 'undefined' && Buffer.from) {
body = Buffer.from(body, encoding);
}
// In non-NodeJS, use the web-standard TextEncoder for utf-8 strings
else if (encoding == null || encoding === 'utf8' || encoding === 'utf-8') {
body = encoder.encode(body);
}
} }
// In non-NodeJS, use the web-standard TextEncoder for utf-8 strings
else if (encoding == null || encoding === 'utf8' || encoding === 'utf-8') { super(body, init);
body = encoder.encode(body);
if (encoding) {
this.headers.set('X-Astro-Encoding', encoding);
} }
} }
super(body, init);
if (encoding) {
this.headers.set('X-Astro-Encoding', encoding);
}
} }
}
// Set the module scoped variable.
ResponseWithEncoding = LocalResponseWithEncoding;
// Turn this into a noop.
initResponseWithEncoding = (() => {}) as any;
return LocalResponseWithEncoding;
};
export async function callEndpoint<MiddlewareResult = Response | EndpointOutput>( export async function callEndpoint<MiddlewareResult = Response | EndpointOutput>(
mod: EndpointHandler, mod: EndpointHandler,

View file

@ -1,4 +1,3 @@
import boxen from 'boxen';
import { import {
bgCyan, bgCyan,
bgGreen, bgGreen,
@ -107,34 +106,29 @@ export function serverStart({
} }
export function telemetryNotice() { export function telemetryNotice() {
const headline = yellow(`Astro now collects ${bold('anonymous')} usage data.`); const headline = `${cyan('◆')} Astro collects completely anonymous usage data.`;
const why = `This ${bold('optional program')} will help shape our roadmap.`; const why = dim(' This optional program helps shape our roadmap.');
const more = `For more info, visit ${underline('https://astro.build/telemetry')}`; const disable = dim(' Run `npm run astro telemetry disable` to opt-out.');
const box = boxen([headline, why, '', more].join('\n'), { const details = ` Details: ${underline('https://astro.build/telemetry')}`;
margin: 0, return [headline, why, disable, details].map((v) => ' ' + v).join('\n');
padding: 1,
borderStyle: 'round',
borderColor: 'yellow',
});
return box;
} }
export function telemetryEnabled() { export function telemetryEnabled() {
return `\n ${green('◉')} Anonymous telemetry is ${bgGreen( return `${green('◉')} Anonymous telemetry is now ${bgGreen(black(' enabled '))}\n ${dim(
black(' enabled ') 'Thank you for improving Astro!'
)}. Thank you for improving Astro!\n`; )}\n`;
} }
export function telemetryDisabled() { export function telemetryDisabled() {
return `\n ${yellow('◯')} Anonymous telemetry is ${bgYellow( return `${yellow('◯')} Anonymous telemetry is now ${bgYellow(black(' disabled '))}\n ${dim(
black(' disabled ') "We won't ever record your usage data."
)}. We won't share any usage data.\n`; )}\n`;
} }
export function telemetryReset() { export function telemetryReset() {
return `\n ${cyan('◆')} Anonymous telemetry has been ${bgCyan( return `${cyan('◆')} Anonymous telemetry has been ${bgCyan(black(' reset '))}\n ${dim(
black(' reset ') 'You may be prompted again.'
)}. You may be prompted again.\n`; )}\n`;
} }
export function fsStrictWarning() { export function fsStrictWarning() {

View file

@ -1,6 +1,7 @@
import { createRequire } from 'node:module'; import { createRequire } from 'node:module';
import { fileURLToPath, pathToFileURL } from 'node:url'; import { fileURLToPath, pathToFileURL } from 'node:url';
import type { AstroInlineConfig, PreviewModule, PreviewServer } from '../../@types/astro'; import type { AstroInlineConfig, PreviewModule, PreviewServer } from '../../@types/astro';
import { AstroIntegrationLogger } from '../../core/logger/core.js';
import { telemetry } from '../../events/index.js'; import { telemetry } from '../../events/index.js';
import { eventCliSession } from '../../events/session.js'; import { eventCliSession } from '../../events/session.js';
import { runHookConfigDone, runHookConfigSetup } from '../../integrations/index.js'; import { runHookConfigDone, runHookConfigSetup } from '../../integrations/index.js';
@ -62,6 +63,7 @@ export default async function preview(inlineConfig: AstroInlineConfig): Promise<
host: getResolvedHostForHttpServer(settings.config.server.host), host: getResolvedHostForHttpServer(settings.config.server.host),
port: settings.config.server.port, port: settings.config.server.port,
base: settings.config.base, base: settings.config.base,
logger: new AstroIntegrationLogger(logger.options, settings.adapter.name),
}); });
return server; return server;

View file

@ -1,18 +1,20 @@
import type { import type {
GetStaticPathsResult,
Page, Page,
PaginateFunction, PaginateFunction,
PaginateOptions,
Params, Params,
Props, Props,
RouteData, RouteData,
} from '../../@types/astro'; } from '../../@types/astro';
import { AstroError, AstroErrorData } from '../errors/index.js'; import { AstroError, AstroErrorData } from '../errors/index.js';
export function generatePaginateFunction(routeMatch: RouteData): PaginateFunction { export function generatePaginateFunction(
routeMatch: RouteData
): (...args: Parameters<PaginateFunction>) => ReturnType<PaginateFunction> {
return function paginateUtility( return function paginateUtility(
data: any[], data: any[],
args: { pageSize?: number; params?: Params; props?: Props } = {} args: PaginateOptions<Props, Params> = {}
) { ): ReturnType<PaginateFunction> {
let { pageSize: _pageSize, params: _params, props: _props } = args; let { pageSize: _pageSize, params: _params, props: _props } = args;
const pageSize = _pageSize || 10; const pageSize = _pageSize || 10;
const paramName = 'page'; const paramName = 'page';
@ -31,7 +33,7 @@ export function generatePaginateFunction(routeMatch: RouteData): PaginateFunctio
} }
const lastPage = Math.max(1, Math.ceil(data.length / pageSize)); const lastPage = Math.max(1, Math.ceil(data.length / pageSize));
const result: GetStaticPathsResult = [...Array(lastPage).keys()].map((num) => { const result = [...Array(lastPage).keys()].map((num) => {
const pageNum = num + 1; const pageNum = num + 1;
const start = pageSize === Infinity ? 0 : (pageNum - 1) * pageSize; // currentPage is 1-indexed const start = pageSize === Infinity ? 0 : (pageNum - 1) * pageSize; // currentPage is 1-indexed
const end = Math.min(start + pageSize, data.length); const end = Math.min(start + pageSize, data.length);

View file

@ -3,6 +3,7 @@ import type {
GetStaticPathsItem, GetStaticPathsItem,
GetStaticPathsResult, GetStaticPathsResult,
GetStaticPathsResultKeyed, GetStaticPathsResultKeyed,
PaginateFunction,
Params, Params,
RouteData, RouteData,
RuntimeMode, RuntimeMode,
@ -50,7 +51,9 @@ export async function callGetStaticPaths({
// Calculate your static paths. // Calculate your static paths.
let staticPaths: GetStaticPathsResult = []; let staticPaths: GetStaticPathsResult = [];
staticPaths = await mod.getStaticPaths({ staticPaths = await mod.getStaticPaths({
paginate: generatePaginateFunction(route), // Q: Why the cast?
// A: So users downstream can have nicer typings, we have to make some sacrifice in our internal typings, which necessitate a cast here
paginate: generatePaginateFunction(route) as PaginateFunction,
rss() { rss() {
throw new AstroError(AstroErrorData.GetStaticPathsRemovedRSSHelper); throw new AstroError(AstroErrorData.GetStaticPathsRemovedRSSHelper);
}, },

View file

@ -52,7 +52,8 @@ export function renderTransition(
} }
} }
} else if (animationName === 'none') { } else if (animationName === 'none') {
sheet.addAnimationRaw('old', 'animation: none; opacity: 0; mix-blend-mode: normal;'); sheet.addFallback('old', 'animation: none; mix-blend-mode: normal;');
sheet.addModern('old', 'animation: none; opacity: 0; mix-blend-mode: normal;');
sheet.addAnimationRaw('new', 'animation: none; mix-blend-mode: normal;'); sheet.addAnimationRaw('new', 'animation: none; mix-blend-mode: normal;');
} }
@ -88,11 +89,22 @@ class ViewTransitionStyleSheet {
} }
addAnimationRaw(image: 'old' | 'new' | 'group', animation: string) { addAnimationRaw(image: 'old' | 'new' | 'group', animation: string) {
const { scope, name } = this; this.addModern(image, animation);
this.addFallback(image, animation);
}
addModern(image: 'old' | 'new' | 'group', animation: string) {
const { name } = this;
this.addRule('modern', `::view-transition-${image}(${name}) { ${animation} }`); this.addRule('modern', `::view-transition-${image}(${name}) { ${animation} }`);
}
addFallback(image: 'old' | 'new' | 'group', animation: string) {
const { scope } = this;
this.addRule( this.addRule(
'fallback', 'fallback',
`[data-astro-transition-fallback="${image}"] [data-astro-transition-scope="${scope}"] { ${animation} }` // Two selectors here, the second in case there is an animation on the root.
`[data-astro-transition-fallback="${image}"] [data-astro-transition-scope="${scope}"],
[data-astro-transition-fallback="${image}"][data-astro-transition-scope="${scope}"] { ${animation} }`
); );
} }
@ -107,7 +119,8 @@ class ViewTransitionStyleSheet {
this.addRule('modern', `${prefix}::view-transition-${image}(${name}) { ${animation} }`); this.addRule('modern', `${prefix}::view-transition-${image}(${name}) { ${animation} }`);
this.addRule( this.addRule(
'fallback', 'fallback',
`${prefix}[data-astro-transition-fallback="${image}"] [data-astro-transition-scope="${scope}"] { ${animation} }` `${prefix}[data-astro-transition-fallback="${image}"] [data-astro-transition-scope="${scope}"],
${prefix}[data-astro-transition-fallback="${image}"][data-astro-transition-scope="${scope}"] { ${animation} }`
); );
} }
} }

View file

@ -45,7 +45,7 @@
"tiny-glob": "^0.2.9" "tiny-glob": "^0.2.9"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "workspace:^3.0.0-rc.7" "astro": "workspace:^3.0.0-rc.8"
}, },
"devDependencies": { "devDependencies": {
"astro": "workspace:*", "astro": "workspace:*",

View file

@ -1,45 +0,0 @@
// TODO: remove `getRuntime()` in Astro 3.0
import type { Cache, CacheStorage, IncomingRequestCfProperties } from '@cloudflare/workers-types';
export type WorkerRuntime<T = unknown> = {
name: 'cloudflare';
env: T;
waitUntil(promise: Promise<any>): void;
passThroughOnException(): void;
caches?: CacheStorage & { default: Cache };
cf?: IncomingRequestCfProperties;
};
export type PagesRuntime<T = unknown, U = unknown> = {
name: 'cloudflare';
env: T;
functionPath: string;
params: Record<string, string>;
data: U;
waitUntil(promise: Promise<any>): void;
next(request: Request): void;
caches?: CacheStorage & { default: Cache };
cf?: IncomingRequestCfProperties;
};
/**
* @deprecated since version 6.8.0
* The `getRuntime` utility has been deprecated and should be updated to the new [`Astro.locals`](https://docs.astro.build/en/guides/middleware/#locals) API.
* ```diff
* - import { getRuntime } from '@astrojs/cloudflare/runtime';
* - getRuntime(Astro.request);
*
* + const runtime = Astro.locals.runtime;
* ```
*/
export function getRuntime<T = unknown, U = unknown>(
request: Request
): WorkerRuntime<T> | PagesRuntime<T, U> {
if (!!request) {
return Reflect.get(request, Symbol.for('runtime'));
} else {
throw new Error(
'To retrieve the current cloudflare runtime you need to pass in the Astro request object'
);
}
}

View file

@ -1,6 +1,5 @@
--- ---
import { getRuntime } from '@astrojs/cloudflare/runtime'; const runtime = Astro.locals.runtime;
const runtime = getRuntime(Astro.request);
--- ---
<html> <html>
<head> <head>

View file

@ -1,5 +1,14 @@
# @astrojs/deno # @astrojs/deno
## 5.0.0-rc.2
### Patch Changes
- [#8245](https://github.com/withastro/astro/pull/8245) [`ed39fbf16`](https://github.com/withastro/astro/commit/ed39fbf168f7a30c4fbf5b5618b70146ce5d5b3e) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - TypeScript users now get better suggestions when configuring the Deno adapter.
- Updated dependencies [[`46c4c0e05`](https://github.com/withastro/astro/commit/46c4c0e053f830585b9ef229ce1c259df00a80f8), [`1048aca55`](https://github.com/withastro/astro/commit/1048aca550769415e528016e42b358ffbfd44b61), [`ffc9e2d3d`](https://github.com/withastro/astro/commit/ffc9e2d3de46049bf3d82140ef018f524fb03187), [`3674584e0`](https://github.com/withastro/astro/commit/3674584e02b161a698b429ceb66723918fdc56ac)]:
- astro@3.0.0-rc.8
## 5.0.0-rc.1 ## 5.0.0-rc.1
### Major Changes ### Major Changes

View file

@ -1,7 +1,7 @@
{ {
"name": "@astrojs/deno", "name": "@astrojs/deno",
"description": "Deploy your site to a Deno server", "description": "Deploy your site to a Deno server",
"version": "5.0.0-rc.1", "version": "5.0.0-rc.2",
"type": "module", "type": "module",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
"author": "withastro", "author": "withastro",
@ -36,7 +36,7 @@
"esbuild": "^0.19.2" "esbuild": "^0.19.2"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "workspace:^3.0.0-rc.7" "astro": "workspace:^3.0.0-rc.8"
}, },
"devDependencies": { "devDependencies": {
"astro": "workspace:*", "astro": "workspace:*",

View file

@ -75,7 +75,7 @@
"zod": "3.21.1" "zod": "3.21.1"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "workspace:^3.0.0-rc.7" "astro": "workspace:^3.0.0-rc.8"
}, },
"devDependencies": { "devDependencies": {
"@astrojs/markdown-remark": "workspace:*", "@astrojs/markdown-remark": "workspace:*",

View file

@ -54,7 +54,7 @@
"vfile": "^5.3.7" "vfile": "^5.3.7"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "workspace:^3.0.0-rc.7" "astro": "workspace:^3.0.0-rc.8"
}, },
"devDependencies": { "devDependencies": {
"@types/chai": "^4.3.5", "@types/chai": "^4.3.5",

View file

@ -43,7 +43,7 @@
"esbuild": "^0.19.2" "esbuild": "^0.19.2"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "workspace:^3.0.0-rc.7" "astro": "workspace:^3.0.0-rc.8"
}, },
"devDependencies": { "devDependencies": {
"@netlify/edge-functions": "^2.0.0", "@netlify/edge-functions": "^2.0.0",

View file

@ -37,7 +37,7 @@
"server-destroy": "^1.0.1" "server-destroy": "^1.0.1"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "workspace:^3.0.0-rc.7" "astro": "workspace:^3.0.0-rc.8"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^18.17.8", "@types/node": "^18.17.8",

View file

@ -1,6 +1,6 @@
import type { AstroAdapter, AstroIntegration } from 'astro'; import type { AstroAdapter, AstroIntegration } from 'astro';
import { AstroError } from 'astro/errors';
import type { Options, UserOptions } from './types'; import type { Options, UserOptions } from './types';
export function getAdapter(options: Options): AstroAdapter { export function getAdapter(options: Options): AstroAdapter {
return { return {
name: '@astrojs/node', name: '@astrojs/node',
@ -23,7 +23,7 @@ export function getAdapter(options: Options): AstroAdapter {
export default function createIntegration(userOptions: UserOptions): AstroIntegration { export default function createIntegration(userOptions: UserOptions): AstroIntegration {
if (!userOptions?.mode) { if (!userOptions?.mode) {
throw new Error(`[@astrojs/node] Setting the 'mode' option is required.`); throw new AstroError(`Setting the 'mode' option is required.`);
} }
let _options: Options; let _options: Options;

View file

@ -1,4 +1,5 @@
import type { CreatePreviewServer } from 'astro'; import type { CreatePreviewServer } from 'astro';
import { AstroError } from 'astro/errors';
import type http from 'node:http'; import type http from 'node:http';
import { fileURLToPath } from 'node:url'; import { fileURLToPath } from 'node:url';
import { getNetworkAddress } from './get-network-address.js'; import { getNetworkAddress } from './get-network-address.js';
@ -11,6 +12,7 @@ const preview: CreatePreviewServer = async function ({
host, host,
port, port,
base, base,
logger,
}) { }) {
type ServerModule = ReturnType<typeof createExports>; type ServerModule = ReturnType<typeof createExports>;
type MaybeServerModule = Partial<ServerModule>; type MaybeServerModule = Partial<ServerModule>;
@ -21,13 +23,13 @@ const preview: CreatePreviewServer = async function ({
if (typeof ssrModule.handler === 'function') { if (typeof ssrModule.handler === 'function') {
ssrHandler = ssrModule.handler; ssrHandler = ssrModule.handler;
} else { } else {
throw new Error( throw new AstroError(
`The server entrypoint doesn't have a handler. Are you sure this is the right file?` `The server entrypoint doesn't have a handler. Are you sure this is the right file?`
); );
} }
} catch (err) { } catch (err) {
if ((err as any).code === 'ERR_MODULE_NOT_FOUND') { if ((err as any).code === 'ERR_MODULE_NOT_FOUND') {
throw new Error( throw new AstroError(
`The server entrypoint ${fileURLToPath( `The server entrypoint ${fileURLToPath(
serverEntrypoint serverEntrypoint
)} does not exist. Have you ran a build yet?` )} does not exist. Have you ran a build yet?`
@ -63,13 +65,11 @@ const preview: CreatePreviewServer = async function ({
const address = getNetworkAddress('http', host, port); const address = getNetworkAddress('http', host, port);
if (host === undefined) { if (host === undefined) {
// eslint-disable-next-line no-console logger.info(
console.log(
`Preview server listening on \n local: ${address.local[0]} \t\n network: ${address.network[0]}\n` `Preview server listening on \n local: ${address.local[0]} \t\n network: ${address.network[0]}\n`
); );
} else { } else {
// eslint-disable-next-line no-console logger.info(`Preview server listening on ${address.local[0]}`);
console.log(`Preview server listening on ${address.local[0]}`);
} }
return server; return server;

View file

@ -4,6 +4,7 @@
* - https://github.com/apollographql/apollo-client/blob/main/src/utilities/common/responseIterator.ts * - https://github.com/apollographql/apollo-client/blob/main/src/utilities/common/responseIterator.ts
*/ */
import { AstroError } from 'astro/errors';
import type { ReadableStreamDefaultReadResult } from 'node:stream/web'; import type { ReadableStreamDefaultReadResult } from 'node:stream/web';
import { Readable as NodeReadableStream } from 'stream'; import { Readable as NodeReadableStream } from 'stream';
@ -221,5 +222,7 @@ export function responseIterator<T>(response: Response | Buffer): AsyncIterableI
if (isNodeReadableStream(body)) return nodeStreamIterator<T>(body); if (isNodeReadableStream(body)) return nodeStreamIterator<T>(body);
throw new Error('Unknown body type for responseIterator. Please pass a streamable response.'); throw new AstroError(
'Unknown body type for responseIterator. Please pass a streamable response.'
);
} }

View file

@ -37,6 +37,7 @@ export function getResolvedHostForHttpServer(host: string | boolean) {
} }
export default function startServer(app: NodeApp, options: Options) { export default function startServer(app: NodeApp, options: Options) {
const logger = app.getAdapterLogger();
const port = process.env.PORT ? Number(process.env.PORT) : options.port ?? 8080; const port = process.env.PORT ? Number(process.env.PORT) : options.port ?? 8080;
const { client } = resolvePaths(options); const { client } = resolvePaths(options);
const handler = middleware(app, options.mode); const handler = middleware(app, options.mode);
@ -59,13 +60,11 @@ export default function startServer(app: NodeApp, options: Options) {
const address = getNetworkAddress(protocol, host, port); const address = getNetworkAddress(protocol, host, port);
if (host === undefined) { if (host === undefined) {
// eslint-disable-next-line no-console logger.info(
console.log( `Server listening on \n local: ${address.local[0]} \t\n network: ${address.network[0]}\n`
`Preview server listening on \n local: ${address.local[0]} \t\n network: ${address.network[0]}\n`
); );
} else { } else {
// eslint-disable-next-line no-console logger.info(`Server listening on ${address.local[0]}`);
console.log(`Preview server listening on ${address.local[0]}`);
} }
return { return {

View file

@ -48,7 +48,7 @@
"vite": "^4.4.9" "vite": "^4.4.9"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "workspace:^3.0.0-rc.7", "astro": "workspace:^3.0.0-rc.8",
"svelte": "^3.55.0 || ^4.0.0" "svelte": "^3.55.0 || ^4.0.0"
}, },
"engines": { "engines": {

View file

@ -43,7 +43,7 @@
"vite": "^4.4.9" "vite": "^4.4.9"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "workspace:^3.0.0-rc.7", "astro": "workspace:^3.0.0-rc.8",
"tailwindcss": "^3.0.24" "tailwindcss": "^3.0.24"
} }
} }

View file

@ -1,5 +1,20 @@
# @astrojs/vercel # @astrojs/vercel
## 4.0.0-rc.5
### Major Changes
- [#8239](https://github.com/withastro/astro/pull/8239) [`52f0837bd`](https://github.com/withastro/astro/commit/52f0837bdeca0b54e07cbf76a7570bd042b98922) Thanks [@matthewp](https://github.com/matthewp)! - Vercel adapter now defaults to `functionPerRoute`.
With this change, `@astrojs/vercel/serverless` now splits each route into its own function. By doing this, the size of each function is reduced and startup time is faster.
You can disable this option, which will cause the code to be bundled into a single function, by setting `functionPerRoute` to `false`.
### Patch Changes
- Updated dependencies [[`46c4c0e05`](https://github.com/withastro/astro/commit/46c4c0e053f830585b9ef229ce1c259df00a80f8), [`1048aca55`](https://github.com/withastro/astro/commit/1048aca550769415e528016e42b358ffbfd44b61), [`ffc9e2d3d`](https://github.com/withastro/astro/commit/ffc9e2d3de46049bf3d82140ef018f524fb03187), [`3674584e0`](https://github.com/withastro/astro/commit/3674584e02b161a698b429ceb66723918fdc56ac)]:
- astro@3.0.0-rc.8
## 4.0.0-rc.4 ## 4.0.0-rc.4
### Major Changes ### Major Changes

View file

@ -244,9 +244,11 @@ export default defineConfig({
}); });
``` ```
### Per-page functions ### Function bundling configuration
The Vercel adapter builds to a single function by default. Astro 2.7 added support for splitting your build into separate entry points per page. If you use this configuration the Vercel adapter will generate a separate function for each page. This can help reduce the size of each function so they are only bundling code used on that page. The Vercel adapter splits builds into a separate function per route by default. This helps reduce the size of each function, as it only bundles code used on that page.
You can disable this and build to a single function by setting the `functionPerRoute` configuration option to `false`:
```js ```js
// astro.config.mjs // astro.config.mjs
@ -256,7 +258,7 @@ import vercel from '@astrojs/vercel/serverless';
export default defineConfig({ export default defineConfig({
output: 'server', output: 'server',
adapter: vercel({ adapter: vercel({
functionPerRoute: true, functionPerRoute: false,
}), }),
}); });
``` ```

View file

@ -1,7 +1,7 @@
{ {
"name": "@astrojs/vercel", "name": "@astrojs/vercel",
"description": "Deploy your site to Vercel", "description": "Deploy your site to Vercel",
"version": "4.0.0-rc.4", "version": "4.0.0-rc.5",
"type": "module", "type": "module",
"author": "withastro", "author": "withastro",
"license": "MIT", "license": "MIT",
@ -17,8 +17,8 @@
"bugs": "https://github.com/withastro/astro/issues", "bugs": "https://github.com/withastro/astro/issues",
"homepage": "https://docs.astro.build/en/guides/integrations-guide/vercel/", "homepage": "https://docs.astro.build/en/guides/integrations-guide/vercel/",
"exports": { "exports": {
"./edge": "./dist/edge/adapter.js", "./edge": "./dist/edge/throw.js",
"./edge/entrypoint": "./dist/edge/entrypoint.js", "./edge/entrypoint": "./dist/edge/throw.js",
"./serverless": "./dist/serverless/adapter.js", "./serverless": "./dist/serverless/adapter.js",
"./serverless/entrypoint": "./dist/serverless/entrypoint.js", "./serverless/entrypoint": "./dist/serverless/entrypoint.js",
"./static": "./dist/static/adapter.js", "./static": "./dist/static/adapter.js",
@ -60,7 +60,7 @@
"web-vitals": "^3.4.0" "web-vitals": "^3.4.0"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "workspace:^3.0.0-rc.7" "astro": "workspace:^3.0.0-rc.8"
}, },
"devDependencies": { "devDependencies": {
"@types/set-cookie-parser": "^2.4.3", "@types/set-cookie-parser": "^2.4.3",

View file

@ -0,0 +1,18 @@
const msg = `
The Astro Vercel Edge adapter has been removed. We recommend switching to @astrojs/vercel/serverless and enabling Edge middleware.
import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel/serverless';
export default defineConfig({
output: 'server',
adapter: vercel({
edgeMiddleware: true,
})
})
`.trim();
throw new Error(msg);
// Make sure bundlers treat this as ESM.
export default {};

View file

@ -1,5 +1,5 @@
import type { AstroAdapter, AstroConfig, AstroIntegration, RouteData } from 'astro'; import type { AstroAdapter, AstroConfig, AstroIntegration, RouteData } from 'astro';
import { AstroError } from 'astro/errors';
import glob from 'fast-glob'; import glob from 'fast-glob';
import { basename } from 'node:path'; import { basename } from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url'; import { fileURLToPath, pathToFileURL } from 'node:url';
@ -77,7 +77,7 @@ export default function vercelServerless({
excludeFiles, excludeFiles,
imageService, imageService,
imagesConfig, imagesConfig,
functionPerRoute = false, functionPerRoute = true,
edgeMiddleware = false, edgeMiddleware = false,
}: VercelServerlessConfig = {}): AstroIntegration { }: VercelServerlessConfig = {}): AstroIntegration {
let _config: AstroConfig; let _config: AstroConfig;
@ -153,10 +153,9 @@ export default function vercelServerless({
serverEntry = config.build.serverEntry; serverEntry = config.build.serverEntry;
if (config.output === 'static') { if (config.output === 'static') {
throw new Error(` throw new AstroError(
[@astrojs/vercel] \`output: "server"\` or \`output: "hybrid"\` is required to use the serverless adapter. '`output: "server"` or `output: "hybrid"` is required to use the serverless adapter.'
);
`);
} }
}, },

View file

@ -4,7 +4,7 @@ import vercel from '@astrojs/vercel/serverless';
export default defineConfig({ export default defineConfig({
adapter: vercel({ adapter: vercel({
// Pass some value to make sure it doesn't error out // Pass some value to make sure it doesn't error out
includeFiles: ['included.js'] includeFiles: ['included.js'],
}), }),
output: 'server' output: 'server'
}); });

View file

@ -56,7 +56,7 @@
"vue": "^3.3.4" "vue": "^3.3.4"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "workspace:^3.0.0-rc.7", "astro": "workspace:^3.0.0-rc.8",
"vue": "^3.2.30" "vue": "^3.2.30"
}, },
"engines": { "engines": {

View file

@ -10,6 +10,9 @@ import { getSystemInfo, type SystemInfo } from './system-info.js';
export type AstroTelemetryOptions = { astroVersion: string; viteVersion: string }; export type AstroTelemetryOptions = { astroVersion: string; viteVersion: string };
export type TelemetryEvent = { eventName: string; payload: Record<string, any> }; export type TelemetryEvent = { eventName: string; payload: Record<string, any> };
// In the event of significant policy changes, update this!
const VALID_TELEMETRY_NOTICE_DATE = '2023-08-25';
type EventMeta = SystemInfo; type EventMeta = SystemInfo;
interface EventContext extends ProjectInfo { interface EventContext extends ProjectInfo {
anonymousId: string; anonymousId: string;
@ -20,6 +23,8 @@ export class AstroTelemetry {
private _anonymousProjectInfo: ProjectInfo | undefined; private _anonymousProjectInfo: ProjectInfo | undefined;
private config = new GlobalConfig({ name: 'astro' }); private config = new GlobalConfig({ name: 'astro' });
private debug = debug('astro:telemetry'); private debug = debug('astro:telemetry');
private isCI = isCI;
private env = process.env;
private get astroVersion() { private get astroVersion() {
return this.opts.astroVersion; return this.opts.astroVersion;
@ -28,10 +33,10 @@ export class AstroTelemetry {
return this.opts.viteVersion; return this.opts.viteVersion;
} }
private get ASTRO_TELEMETRY_DISABLED() { private get ASTRO_TELEMETRY_DISABLED() {
return process.env.ASTRO_TELEMETRY_DISABLED; return this.env.ASTRO_TELEMETRY_DISABLED;
} }
private get TELEMETRY_DISABLED() { private get TELEMETRY_DISABLED() {
return process.env.TELEMETRY_DISABLED; return this.env.TELEMETRY_DISABLED;
} }
constructor(private opts: AstroTelemetryOptions) { constructor(private opts: AstroTelemetryOptions) {
@ -47,7 +52,7 @@ export class AstroTelemetry {
*/ */
private getConfigWithFallback<T>(key: string, getValue: () => T): T { private getConfigWithFallback<T>(key: string, getValue: () => T): T {
const currentValue = this.config.get(key); const currentValue = this.config.get(key);
if (currentValue) { if (currentValue !== undefined) {
return currentValue; return currentValue;
} }
const newValue = getValue(); const newValue = getValue();
@ -75,7 +80,7 @@ export class AstroTelemetry {
private get anonymousProjectInfo(): ProjectInfo { private get anonymousProjectInfo(): ProjectInfo {
// NOTE(fks): this value isn't global, so it can't use getConfigWithFallback(). // NOTE(fks): this value isn't global, so it can't use getConfigWithFallback().
this._anonymousProjectInfo = this._anonymousProjectInfo || getProjectInfo(isCI); this._anonymousProjectInfo = this._anonymousProjectInfo || getProjectInfo(this.isCI);
return this._anonymousProjectInfo; return this._anonymousProjectInfo;
} }
@ -94,19 +99,29 @@ export class AstroTelemetry {
return this.config.clear(); return this.config.clear();
} }
async notify(callback: () => Promise<boolean>) { isValidNotice() {
if (this.isDisabled || isCI) { if (!this.notifyDate) return false;
const current = Number(this.notifyDate);
const valid = new Date(VALID_TELEMETRY_NOTICE_DATE).valueOf();
return current > valid;
}
async notify(callback: () => boolean | Promise<boolean>) {
if (this.isDisabled || this.isCI) {
this.debug(`[notify] telemetry has been disabled`);
return; return;
} }
// The end-user has already been notified about our telemetry integration! // The end-user has already been notified about our telemetry integration!
// Don't bother them about it again. // Don't bother them about it again.
// In the event of significant changes, we should invalidate old dates. if (this.isValidNotice()) {
if (this.notifyDate) { this.debug(`[notify] last notified on ${this.notifyDate}`);
return; return;
} }
const enabled = await callback(); const enabled = await callback();
this.config.set(KEY.TELEMETRY_NOTIFY_DATE, Date.now().toString()); this.config.set(KEY.TELEMETRY_NOTIFY_DATE, new Date().valueOf().toString());
this.config.set(KEY.TELEMETRY_ENABLED, enabled); this.config.set(KEY.TELEMETRY_ENABLED, enabled);
this.debug(`[notify] telemetry has been ${enabled ? 'enabled' : 'disabled'}`);
} }
async record(event: TelemetryEvent | TelemetryEvent[] = []) { async record(event: TelemetryEvent | TelemetryEvent[] = []) {
@ -117,7 +132,7 @@ export class AstroTelemetry {
// Skip recording telemetry if the feature is disabled // Skip recording telemetry if the feature is disabled
if (this.isDisabled) { if (this.isDisabled) {
this.debug('telemetry disabled'); this.debug('[record] telemetry has been disabled');
return Promise.resolve(); return Promise.resolve();
} }

View file

@ -1,9 +1,83 @@
import { expect } from 'chai'; import { expect } from 'chai';
import { AstroTelemetry } from '../dist/index.js'; import { AstroTelemetry } from '../dist/index.js';
function setup() {
const config = new Map();
const telemetry = new AstroTelemetry({ version: '0.0.0-test.1' });
const logs = [];
// Stub isCI to false so we can test user-facing behavior
telemetry.isCI = false;
// Stub process.env to properly test in Astro's own CI
telemetry.env = {};
// Override config so we can inspect it
telemetry.config = config;
// Override debug so we can inspect it
telemetry.debug.enabled = true;
telemetry.debug.log = (...args) => logs.push(args);
return { telemetry, config, logs };
}
describe('AstroTelemetry', () => { describe('AstroTelemetry', () => {
let oldCI;
before(() => {
oldCI = process.env.CI;
// Stub process.env.CI to `false`
process.env.CI = 'false';
});
after(() => {
process.env.CI = oldCI;
});
it('initializes when expected arguments are given', () => { it('initializes when expected arguments are given', () => {
const telemetry = new AstroTelemetry({ version: '0.0.0-test.1' }); const { telemetry } = setup();
expect(telemetry).to.be.instanceOf(AstroTelemetry); expect(telemetry).to.be.instanceOf(AstroTelemetry);
}); });
it('does not record event if disabled', async () => {
const { telemetry, config, logs } = setup();
telemetry.setEnabled(false);
const [key] = Array.from(config.keys());
expect(key).not.to.be.undefined;
expect(config.get(key)).to.be.false;
expect(telemetry.enabled).to.be.false;
expect(telemetry.isDisabled).to.be.true;
const result = await telemetry.record(['TEST']);
expect(result).to.be.undefined;
const [log] = logs;
expect(log).not.to.be.undefined;
expect(logs.join('')).to.match(/disabled/);
});
it('records event if enabled', async () => {
const { telemetry, config, logs } = setup();
telemetry.setEnabled(true);
const [key] = Array.from(config.keys());
expect(key).not.to.be.undefined;
expect(config.get(key)).to.be.true;
expect(telemetry.enabled).to.be.true;
expect(telemetry.isDisabled).to.be.false;
await telemetry.record(['TEST']);
expect(logs.length).to.equal(2);
});
it('respects disable from notify', async () => {
const { telemetry, config, logs } = setup();
await telemetry.notify(() => false);
const [key] = Array.from(config.keys());
expect(key).not.to.be.undefined;
expect(config.get(key)).to.be.false;
expect(telemetry.enabled).to.be.false;
expect(telemetry.isDisabled).to.be.true;
const [log] = logs;
expect(log).not.to.be.undefined;
expect(logs.join('')).to.match(/disabled/);
});
it('respects enable from notify', async () => {
const { telemetry, config, logs } = setup();
await telemetry.notify(() => true);
const [key] = Array.from(config.keys());
expect(key).not.to.be.undefined;
expect(config.get(key)).to.be.true;
expect(telemetry.enabled).to.be.true;
expect(telemetry.isDisabled).to.be.false;
const [log] = logs;
expect(log).not.to.be.undefined;
expect(logs.join('')).to.match(/enabled/);
});
}); });

View file

@ -125,7 +125,7 @@ importers:
examples/basics: examples/basics:
dependencies: dependencies:
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
examples/blog: examples/blog:
@ -140,23 +140,23 @@ importers:
specifier: ^3.0.0-rc.1 specifier: ^3.0.0-rc.1
version: link:../../packages/integrations/sitemap version: link:../../packages/integrations/sitemap
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
examples/component: examples/component:
devDependencies: devDependencies:
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
examples/deno: examples/deno:
dependencies: dependencies:
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
devDependencies: devDependencies:
'@astrojs/deno': '@astrojs/deno':
specifier: ^5.0.0-rc.1 specifier: ^5.0.0-rc.2
version: link:../../packages/integrations/deno version: link:../../packages/integrations/deno
examples/framework-alpine: examples/framework-alpine:
@ -171,7 +171,7 @@ importers:
specifier: ^3.12.3 specifier: ^3.12.3
version: 3.12.3 version: 3.12.3
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
examples/framework-lit: examples/framework-lit:
@ -183,7 +183,7 @@ importers:
specifier: ^0.2.1 specifier: ^0.2.1
version: 0.2.1 version: 0.2.1
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
lit: lit:
specifier: ^2.8.0 specifier: ^2.8.0
@ -207,7 +207,7 @@ importers:
specifier: ^3.0.0-rc.1 specifier: ^3.0.0-rc.1
version: link:../../packages/integrations/vue version: link:../../packages/integrations/vue
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
preact: preact:
specifier: ^10.17.1 specifier: ^10.17.1
@ -237,7 +237,7 @@ importers:
specifier: ^1.2.1 specifier: ^1.2.1
version: 1.2.1(preact@10.17.1) version: 1.2.1(preact@10.17.1)
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
preact: preact:
specifier: ^10.17.1 specifier: ^10.17.1
@ -255,7 +255,7 @@ importers:
specifier: ^18.2.7 specifier: ^18.2.7
version: 18.2.7 version: 18.2.7
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
react: react:
specifier: ^18.2.0 specifier: ^18.2.0
@ -270,7 +270,7 @@ importers:
specifier: ^3.0.0-rc.3 specifier: ^3.0.0-rc.3
version: link:../../packages/integrations/solid version: link:../../packages/integrations/solid
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
solid-js: solid-js:
specifier: ^1.7.11 specifier: ^1.7.11
@ -282,7 +282,7 @@ importers:
specifier: ^4.0.0-rc.2 specifier: ^4.0.0-rc.2
version: link:../../packages/integrations/svelte version: link:../../packages/integrations/svelte
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
svelte: svelte:
specifier: ^4.2.0 specifier: ^4.2.0
@ -294,7 +294,7 @@ importers:
specifier: ^3.0.0-rc.1 specifier: ^3.0.0-rc.1
version: link:../../packages/integrations/vue version: link:../../packages/integrations/vue
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
vue: vue:
specifier: ^3.3.4 specifier: ^3.3.4
@ -306,13 +306,13 @@ importers:
specifier: ^6.0.0-rc.1 specifier: ^6.0.0-rc.1
version: link:../../packages/integrations/node version: link:../../packages/integrations/node
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
examples/integration: examples/integration:
devDependencies: devDependencies:
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
examples/middleware: examples/middleware:
@ -321,7 +321,7 @@ importers:
specifier: ^6.0.0-rc.1 specifier: ^6.0.0-rc.1
version: link:../../packages/integrations/node version: link:../../packages/integrations/node
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
html-minifier: html-minifier:
specifier: ^4.0.0 specifier: ^4.0.0
@ -330,19 +330,19 @@ importers:
examples/minimal: examples/minimal:
dependencies: dependencies:
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
examples/non-html-pages: examples/non-html-pages:
dependencies: dependencies:
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
examples/portfolio: examples/portfolio:
dependencies: dependencies:
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
examples/ssr: examples/ssr:
@ -354,7 +354,7 @@ importers:
specifier: ^4.0.0-rc.2 specifier: ^4.0.0-rc.2
version: link:../../packages/integrations/svelte version: link:../../packages/integrations/svelte
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
svelte: svelte:
specifier: ^4.2.0 specifier: ^4.2.0
@ -366,7 +366,7 @@ importers:
specifier: ^0.5.0-rc.1 specifier: ^0.5.0-rc.1
version: link:../../packages/integrations/markdoc version: link:../../packages/integrations/markdoc
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
examples/with-markdown-plugins: examples/with-markdown-plugins:
@ -375,7 +375,7 @@ importers:
specifier: ^3.0.0-rc.1 specifier: ^3.0.0-rc.1
version: link:../../packages/markdown/remark version: link:../../packages/markdown/remark
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
hast-util-select: hast-util-select:
specifier: ^5.0.5 specifier: ^5.0.5
@ -396,7 +396,7 @@ importers:
examples/with-markdown-shiki: examples/with-markdown-shiki:
dependencies: dependencies:
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
examples/with-mdx: examples/with-mdx:
@ -408,7 +408,7 @@ importers:
specifier: ^3.0.0-rc.2 specifier: ^3.0.0-rc.2
version: link:../../packages/integrations/preact version: link:../../packages/integrations/preact
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
preact: preact:
specifier: ^10.17.1 specifier: ^10.17.1
@ -423,7 +423,7 @@ importers:
specifier: ^0.5.0 specifier: ^0.5.0
version: 0.5.0(nanostores@0.9.3)(preact@10.17.1) version: 0.5.0(nanostores@0.9.3)(preact@10.17.1)
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
nanostores: nanostores:
specifier: ^0.9.3 specifier: ^0.9.3
@ -444,7 +444,7 @@ importers:
specifier: ^1.6.0 specifier: ^1.6.0
version: 1.6.0 version: 1.6.0
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
autoprefixer: autoprefixer:
specifier: ^10.4.15 specifier: ^10.4.15
@ -462,7 +462,7 @@ importers:
examples/with-vite-plugin-pwa: examples/with-vite-plugin-pwa:
dependencies: dependencies:
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
vite-plugin-pwa: vite-plugin-pwa:
specifier: 0.16.4 specifier: 0.16.4
@ -474,7 +474,7 @@ importers:
examples/with-vitest: examples/with-vitest:
dependencies: dependencies:
astro: astro:
specifier: ^3.0.0-rc.7 specifier: ^3.0.0-rc.8
version: link:../../packages/astro version: link:../../packages/astro
vitest: vitest:
specifier: ^0.34.2 specifier: ^0.34.2