diff options
author | 2024-11-21 04:45:51 -0800 | |
---|---|---|
committer | 2024-11-21 12:45:51 +0000 | |
commit | a9ce785146d78595fb4d52e1d39dc6ed01d04d66 (patch) | |
tree | ad98feb9ac29cb440b0bdd9163285f3c67a6b479 /packages | |
parent | 285c6e3598eac81632057a37ad74459cc65c357d (diff) | |
download | astro-a9ce785146d78595fb4d52e1d39dc6ed01d04d66.tar.gz astro-a9ce785146d78595fb4d52e1d39dc6ed01d04d66.tar.zst astro-a9ce785146d78595fb4d52e1d39dc6ed01d04d66.zip |
[ci] release (beta) (#12430)astro@5.0.0-beta.9@astrojs/vue@5.0.0-beta.2@astrojs/svelte@6.0.2-beta.0@astrojs/solid-js@4.4.4-beta.0@astrojs/react@3.6.3-beta.0@astrojs/preact@3.5.4-beta.0
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'packages')
24 files changed, 312 insertions, 80 deletions
diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index 178d2d9c1..c94391811 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,195 @@ # astro +## 5.0.0-beta.9 + +### Minor Changes + +- [#12067](https://github.com/withastro/astro/pull/12067) [`c48916c`](https://github.com/withastro/astro/commit/c48916cc4e6f7c31e3563d04b68a8698d8775b65) Thanks [@stramel](https://github.com/stramel)! - Adds experimental support for built-in SVG components. + + This feature allows you to import SVG files directly into your Astro project as components. By default, Astro will inline the SVG content into your HTML output. + + To enable this feature, set `experimental.svg` to `true` in your Astro config: + + ```js + { + experimental: { + svg: true, + }, + } + ``` + + To use this feature, import an SVG file in your Astro project, passing any common SVG attributes to the imported component. Astro also provides a `size` attribute to set equal `height` and `width` properties: + + ```astro + --- + import Logo from './path/to/svg/file.svg'; + --- + + <Logo size={24} /> + ``` + + For a complete overview, and to give feedback on this experimental API, see the [Feature RFC](https://github.com/withastro/roadmap/pull/1035). + +- [#12329](https://github.com/withastro/astro/pull/12329) [`8309c61`](https://github.com/withastro/astro/commit/8309c61f0dfa5991d3f6c5c5fca4403794d6fda2) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Adds a new `astro:routes:resolved` hook to the Integration API. Also update the `astro:build:done` hook by deprecating `routes` and adding a new `assets` map. + + When building an integration, you can now get access to routes inside the `astro:routes:resolved` hook: + + ```js + const integration = () => { + return { + name: 'my-integration', + hooks: { + 'astro:routes:resolved': ({ routes }) => { + console.log(routes); + }, + }, + }; + }; + ``` + + This hook runs before `astro:config:done`, and whenever a route changes in development. + + The `routes` array from `astro:build:done` is now deprecated, and exposed properties are now available on `astro:routes:resolved`, except for `distURL`. For this, you can use the newly exposed `assets` map: + + ```diff + const integration = () => { + + let routes + return { + name: 'my-integration', + hooks: { + + 'astro:routes:resolved': (params) => { + + routes = params.routes + + }, + 'astro:build:done': ({ + - routes + + assets + }) => { + + for (const route of routes) { + + const distURL = assets.get(route.pattern) + + if (distURL) { + + Object.assign(route, { distURL }) + + } + + } + console.log(routes) + } + } + } + } + ``` + +- [#12377](https://github.com/withastro/astro/pull/12377) [`af867f3`](https://github.com/withastro/astro/commit/af867f3910ecd8fc04a5337f591d84f03192e3fa) Thanks [@ascorbic](https://github.com/ascorbic)! - Adds experimental support for automatic responsive images + + This feature is experimental and may change in future versions. To enable it, set `experimental.responsiveImages` to `true` in your `astro.config.mjs` file. + + ```js title=astro.config.mjs + { + experimental: { + responsiveImages: true, + }, + } + ``` + + When this flag is enabled, you can pass a `layout` prop to any `<Image />` or `<Picture />` component to create a responsive image. When a layout is set, images have automatically generated `srcset` and `sizes` attributes based on the image's dimensions and the layout type. Images with `responsive` and `full-width` layouts will have styles applied to ensure they resize according to their container. + + ```astro + --- + import { Image, Picture } from 'astro:assets'; + import myImage from '../assets/my_image.png'; + --- + + <Image + src={myImage} + alt="A description of my image." + layout="responsive" + width={800} + height={600} + /> + <Picture + src={myImage} + alt="A description of my image." + layout="full-width" + formats={['avif', 'webp', 'jpeg']} + /> + ``` + + This `<Image />` component will generate the following HTML output: + + ```html title=Output + <img + src="/_astro/my_image.hash3.webp" + srcset=" + /_astro/my_image.hash1.webp 640w, + /_astro/my_image.hash2.webp 750w, + /_astro/my_image.hash3.webp 800w, + /_astro/my_image.hash4.webp 828w, + /_astro/my_image.hash5.webp 1080w, + /_astro/my_image.hash6.webp 1280w, + /_astro/my_image.hash7.webp 1600w + " + alt="A description of my image" + sizes="(min-width: 800px) 800px, 100vw" + loading="lazy" + decoding="async" + fetchpriority="auto" + width="800" + height="600" + style="--w: 800; --h: 600; --fit: cover; --pos: center;" + data-astro-image="responsive" + /> + ``` + + #### Responsive image properties + + These are additional properties available to the `<Image />` and `<Picture />` components when responsive images are enabled: + + - `layout`: The layout type for the image. Can be `responsive`, `fixed`, `full-width` or `none`. Defaults to value of `image.experimentalLayout`. + - `fit`: Defines how the image should be cropped if the aspect ratio is changed. Values match those of CSS `object-fit`. Defaults to `cover`, or the value of `image.experimentalObjectFit` if set. + - `position`: Defines the position of the image crop if the aspect ratio is changed. Values match those of CSS `object-position`. Defaults to `center`, or the value of `image.experimentalObjectPosition` if set. + - `priority`: If set, eagerly loads the image. Otherwise images will be lazy-loaded. Use this for your largest above-the-fold image. Defaults to `false`. + + #### Default responsive image settings + + You can enable responsive images for all `<Image />` and `<Picture />` components by setting `image.experimentalLayout` with a default value. This can be overridden by the `layout` prop on each component. + + **Example:** + + ```js title=astro.config.mjs + { + image: { + // Used for all `<Image />` and `<Picture />` components unless overridden + experimentalLayout: 'responsive', + }, + experimental: { + responsiveImages: true, + }, + } + ``` + + ```astro + --- + import { Image } from 'astro:assets'; + import myImage from '../assets/my_image.png'; + --- + + <Image src={myImage} alt="This will use responsive layout" width={800} height={600} /> + + <Image src={myImage} alt="This will use full-width layout" layout="full-width" /> + + <Image src={myImage} alt="This will disable responsive images" layout="none" /> + ``` + + For a complete overview, and to give feedback on this experimental API, see the [Responsive Images RFC](https://github.com/withastro/roadmap/blob/responsive-images/proposals/0053-responsive-images.md). + +- [#12475](https://github.com/withastro/astro/pull/12475) [`3f02d5f`](https://github.com/withastro/astro/commit/3f02d5f12b167514fff6eb9693b4e25c668e7a31) Thanks [@ascorbic](https://github.com/ascorbic)! - Changes the default content config location from `src/content/config.*` to `src/content.config.*`. + + The previous location is still supported, and is required if the `legacy.collections` flag is enabled. + +### Patch Changes + +- [#12424](https://github.com/withastro/astro/pull/12424) [`4364bff`](https://github.com/withastro/astro/commit/4364bff27332e52f92da72392620a36110daee42) Thanks [@ematipico](https://github.com/ematipico)! - Fixes an issue where an incorrect usage of Astro actions was lost when porting the fix from v4 to v5 + +- [#12438](https://github.com/withastro/astro/pull/12438) [`c8f877c`](https://github.com/withastro/astro/commit/c8f877cad2d8f1780f70045413872d5b9d32ebed) Thanks [@ascorbic](https://github.com/ascorbic)! - Fixes a bug where legacy content types were generated for content layer collections if they were in the content directory + ## 5.0.0-beta.8 ### Minor Changes diff --git a/packages/astro/client.d.ts b/packages/astro/client.d.ts index f9badff24..0832344b4 100644 --- a/packages/astro/client.d.ts +++ b/packages/astro/client.d.ts @@ -111,7 +111,7 @@ declare module '*.svg' { type Props = { /** * Accesible, short-text description - * + * * {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title|MDN Reference} */ title?: string; @@ -122,9 +122,9 @@ declare module '*.svg' { /** * Override the default rendering mode for SVGs */ - mode?: import('./dist/assets/utils/svg.js').SvgRenderMode - } & astroHTML.JSX.SVGAttributes - + mode?: import('./dist/assets/utils/svg.js').SvgRenderMode; + } & astroHTML.JSX.SVGAttributes; + const Component: ((_props: Props) => any) & ImageMetadata; export default Component; } diff --git a/packages/astro/package.json b/packages/astro/package.json index 3ca98a18a..67c68dab2 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "5.0.0-beta.8", + "version": "5.0.0-beta.9", "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.", "type": "module", "author": "withastro", diff --git a/packages/astro/src/assets/utils/index.ts b/packages/astro/src/assets/utils/index.ts index 98044ac9f..3fae18200 100644 --- a/packages/astro/src/assets/utils/index.ts +++ b/packages/astro/src/assets/utils/index.ts @@ -13,4 +13,4 @@ export { } from './remotePattern.js'; export { hashTransform, propsToFilename } from './transformToPath.js'; export { inferRemoteSize } from './remoteProbe.js'; -export { makeSvgComponent } from './svg.js' +export { makeSvgComponent } from './svg.js'; diff --git a/packages/astro/src/assets/utils/svg.ts b/packages/astro/src/assets/utils/svg.ts index 70088ba64..6f9c54381 100644 --- a/packages/astro/src/assets/utils/svg.ts +++ b/packages/astro/src/assets/utils/svg.ts @@ -1,7 +1,7 @@ import { parse, renderSync } from 'ultrahtml'; -import type { ImageMetadata } from '../types.js'; import type { SvgComponentProps } from '../runtime.js'; import { dropAttributes } from '../runtime.js'; +import type { ImageMetadata } from '../types.js'; function parseSvg(contents: string) { const root = parse(contents); @@ -13,7 +13,11 @@ function parseSvg(contents: string) { export type SvgRenderMode = 'inline' | 'sprite'; -export function makeSvgComponent(meta: ImageMetadata, contents: Buffer | string, options?: { mode?: SvgRenderMode }) { +export function makeSvgComponent( + meta: ImageMetadata, + contents: Buffer | string, + options?: { mode?: SvgRenderMode }, +) { const file = typeof contents === 'string' ? contents : contents.toString('utf-8'); const { attributes, body: children } = parseSvg(file); const props: SvgComponentProps = { diff --git a/packages/astro/src/assets/vite-plugin-assets.ts b/packages/astro/src/assets/vite-plugin-assets.ts index 7cb04c1bd..e09fc1597 100644 --- a/packages/astro/src/assets/vite-plugin-assets.ts +++ b/packages/astro/src/assets/vite-plugin-assets.ts @@ -17,8 +17,8 @@ import { getAssetsPrefix } from './utils/getAssetsPrefix.js'; import { isESMImportedImage } from './utils/imageKind.js'; import { emitESMImage } from './utils/node/emitAsset.js'; import { getProxyCode } from './utils/proxy.js'; -import { hashTransform, propsToFilename } from './utils/transformToPath.js'; import { makeSvgComponent } from './utils/svg.js'; +import { hashTransform, propsToFilename } from './utils/transformToPath.js'; const resolvedVirtualModuleId = '\0' + VIRTUAL_MODULE_ID; @@ -217,7 +217,9 @@ export default function assets({ settings }: { settings: AstroSettings }): vite. if (settings.config.experimental.svg && /\.svg$/.test(id)) { const { contents, ...metadata } = imageMetadata; // We know that the contents are present, as we only emit this property for SVG files - return makeSvgComponent(metadata, contents!, { mode: settings.config.experimental.svg.mode }); + return makeSvgComponent(metadata, contents!, { + mode: settings.config.experimental.svg.mode, + }); } // We can only reliably determine if an image is used on the server, as we need to track its usage throughout the entire build. diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts index af3dd82ea..3ddaf3e0c 100644 --- a/packages/astro/src/core/config/schema.ts +++ b/packages/astro/src/core/config/schema.ts @@ -537,16 +537,16 @@ export const AstroConfigSchema = z.object({ .boolean() .optional() .default(ASTRO_CONFIG_DEFAULTS.experimental.responsiveImages), - svg: z.union([ - z.boolean(), - z - .object({ - mode: z - .union([z.literal('inline'), z.literal('sprite')]) - .optional() - .default(ASTRO_CONFIG_DEFAULTS.experimental.svg.mode), - }) - ]) + svg: z + .union([ + z.boolean(), + z.object({ + mode: z + .union([z.literal('inline'), z.literal('sprite')]) + .optional() + .default(ASTRO_CONFIG_DEFAULTS.experimental.svg.mode), + }), + ]) .optional() .transform((svgConfig) => { // Handle normalization of `experimental.svg` config boolean values diff --git a/packages/astro/src/core/routing/manifest/create.ts b/packages/astro/src/core/routing/manifest/create.ts index 621164084..6dbcf18ae 100644 --- a/packages/astro/src/core/routing/manifest/create.ts +++ b/packages/astro/src/core/routing/manifest/create.ts @@ -8,6 +8,7 @@ import { fileURLToPath } from 'node:url'; import { bold } from 'kleur/colors'; import pLimit from 'p-limit'; import { toRoutingStrategy } from '../../../i18n/utils.js'; +import { runHookRoutesResolved } from '../../../integrations/hooks.js'; import { getPrerenderDefault } from '../../../prerender/utils.js'; import type { AstroConfig } from '../../../types/public/config.js'; import type { RouteData, RoutePart } from '../../../types/public/internal.js'; @@ -20,7 +21,6 @@ import { routeComparator } from '../priority.js'; import { getRouteGenerator } from './generator.js'; import { getPattern } from './pattern.js'; import { getRoutePrerenderOption } from './prerender.js'; -import { runHookRoutesResolved } from '../../../integrations/hooks.js'; const require = createRequire(import.meta.url); interface Item { diff --git a/packages/astro/src/core/sync/index.ts b/packages/astro/src/core/sync/index.ts index 832a55b28..67fdccc54 100644 --- a/packages/astro/src/core/sync/index.ts +++ b/packages/astro/src/core/sync/index.ts @@ -253,20 +253,22 @@ async function syncContentCollections( if (isAstroError(e)) { throw e; } - let configFile + let configFile; try { const contentPaths = getContentPaths(settings.config, fs); - if(contentPaths.config.exists) { + if (contentPaths.config.exists) { const matches = /\/(src\/.+)/.exec(contentPaths.config.url.href); if (matches) { - configFile = matches[1] + configFile = matches[1]; } } } catch { // ignore } - const hint = AstroUserError.is(e) ? e.hint : AstroErrorData.GenerateContentTypesError.hint(configFile); + const hint = AstroUserError.is(e) + ? e.hint + : AstroErrorData.GenerateContentTypesError.hint(configFile); throw new AstroError( { ...AstroErrorData.GenerateContentTypesError, diff --git a/packages/astro/src/types/astro.ts b/packages/astro/src/types/astro.ts index 654652c42..1227ed381 100644 --- a/packages/astro/src/types/astro.ts +++ b/packages/astro/src/types/astro.ts @@ -13,7 +13,7 @@ import type { InjectedScriptStage, InjectedType, } from './public/integrations.js'; -import type { InternalInjectedRoute, RouteData, ResolvedInjectedRoute } from './public/internal.js'; +import type { InternalInjectedRoute, ResolvedInjectedRoute, RouteData } from './public/internal.js'; import type { DevToolbarAppEntry } from './public/toolbar.js'; export type SerializedRouteData = Omit< diff --git a/packages/astro/src/types/public/config.ts b/packages/astro/src/types/public/config.ts index a01dc42cd..16261cd75 100644 --- a/packages/astro/src/types/public/config.ts +++ b/packages/astro/src/types/public/config.ts @@ -1130,11 +1130,11 @@ export interface ViteUserConfig extends OriginalViteUserConfig { * @name markdown.shikiConfig * @typeraw {Partial<ShikiConfig>} * @description - * - * Shiki is our default syntax highlighter. You can configure all options via the `markdown.shikiConfig` object: - * - * ```js title="astro.config.mjs" - * import { defineConfig } from 'astro/config'; + * + * Shiki is our default syntax highlighter. You can configure all options via the `markdown.shikiConfig` object: + * + * ```js title="astro.config.mjs" + * import { defineConfig } from 'astro/config'; * * export default defineConfig({ * markdown: { @@ -1146,7 +1146,7 @@ export interface ViteUserConfig extends OriginalViteUserConfig { * // See note below for using dual light/dark themes * themes: { * light: 'github-light', - * dark: 'github-dark', + * dark: 'github-dark', * }, * // Disable the default colors * // https://shiki.style/guide/dual-themes#without-default-color @@ -1770,7 +1770,7 @@ export interface ViteUserConfig extends OriginalViteUserConfig { * @name experimental.contentIntellisense * @type {boolean} * @default `false` - * @version 5.x + * @version 5.x * @description * * Enables Intellisense features (e.g. code completion, quick hints) for your content collection entries in compatible editors. @@ -1901,7 +1901,7 @@ export interface ViteUserConfig extends OriginalViteUserConfig { * * The `widths` and `sizes` attributes are automatically generated based on the image's dimensions and the layout type, and in most cases should not be set manually. The generated `sizes` attribute for `responsive` and `full-width` images * is based on the assumption that the image is displayed at close to the full width of the screen when the viewport is smaller than the image's width. If it is significantly different (e.g. if it's in a multi-column layout on small screens) you may need to adjust the `sizes` attribute manually for best results. - * + * * The `densities` attribute is not compatible with responsive images and will be ignored if set. */ @@ -1912,13 +1912,13 @@ export interface ViteUserConfig extends OriginalViteUserConfig { * @name experimental.svg * @type {boolean|object} * @default `undefined` - * @version 5.x + * @version 5.x * @description - * + * * This feature allows you to import SVG files directly into your Astro project. By default, Astro will inline the SVG content into your HTML output. - * + * * To enable this feature, set `experimental.svg` to `true` in your Astro config: - * + * * ```js * { * experimental: { @@ -1926,20 +1926,20 @@ export interface ViteUserConfig extends OriginalViteUserConfig { * }, * } * ``` - * + * * To use this feature, import an SVG file in your Astro project, passing any common SVG attributes to the imported component. * Astro also provides a `size` attribute to set equal `height` and `width` properties: - * + * * ```astro * --- * import Logo from './path/to/svg/file.svg'; * --- - * + * * <Logo size={24} /> * ``` - * + * * For a complete overview, and to give feedback on this experimental API, - * see the [Feature RFC](https://github.com/withastro/roadmap/pull/1035). + * see the [Feature RFC](https://github.com/withastro/roadmap/pull/1035). */ svg?: { /** @@ -1947,17 +1947,17 @@ export interface ViteUserConfig extends OriginalViteUserConfig { * @name experimental.svg.mode * @type {string} * @default 'inline' - * + * * The default technique for handling imported SVG files. Astro will inline the SVG content into your HTML output if not specified. - * + * * - `inline`: Astro will inline the SVG content into your HTML output. * - `sprite`: Astro will generate a sprite sheet with all imported SVG files. - * + * * ```astro * --- * import Logo from './path/to/svg/file.svg'; * --- - * + * * <Logo size={24} mode="sprite" /> * ``` */ diff --git a/packages/astro/src/vite-plugin-astro-server/plugin.ts b/packages/astro/src/vite-plugin-astro-server/plugin.ts index 642565161..ab90021b3 100644 --- a/packages/astro/src/vite-plugin-astro-server/plugin.ts +++ b/packages/astro/src/vite-plugin-astro-server/plugin.ts @@ -1,6 +1,7 @@ import { AsyncLocalStorage } from 'node:async_hooks'; import type fs from 'node:fs'; import { IncomingMessage } from 'node:http'; +import { fileURLToPath } from 'node:url'; import type * as vite from 'vite'; import { normalizePath } from 'vite'; import type { SSRManifest, SSRManifestI18n } from '../core/app/types.js'; @@ -14,7 +15,9 @@ import { NOOP_MIDDLEWARE_FN } from '../core/middleware/noop-middleware.js'; import { createViteLoader } from '../core/module-loader/index.js'; import { injectDefaultDevRoutes } from '../core/routing/dev-default.js'; import { createRouteManifest } from '../core/routing/index.js'; +import { getRoutePrerenderOption } from '../core/routing/manifest/prerender.js'; import { toFallbackType, toRoutingStrategy } from '../i18n/utils.js'; +import { runHookRoutesResolved } from '../integrations/hooks.js'; import type { AstroSettings, ManifestData } from '../types/astro.js'; import { baseMiddleware } from './base.js'; import { createController } from './controller.js'; @@ -22,9 +25,6 @@ import { recordServerError } from './error.js'; import { DevPipeline } from './pipeline.js'; import { handleRequest } from './request.js'; import { setRouteError } from './server-state.js'; -import { fileURLToPath } from 'node:url'; -import { getRoutePrerenderOption } from '../core/routing/manifest/prerender.js'; -import { runHookRoutesResolved } from '../integrations/hooks.js'; export interface AstroPluginOptions { settings: AstroSettings; diff --git a/packages/astro/test/core-image-svg.test.js b/packages/astro/test/core-image-svg.test.js index d6134aaf7..e346cb6a7 100644 --- a/packages/astro/test/core-image-svg.test.js +++ b/packages/astro/test/core-image-svg.test.js @@ -53,7 +53,7 @@ describe('astro:assets - SVG Components', () => { assert.equal(!!$(this).attr('mode'), false); const $use = $(this).children('use'); assert.equal($use.length, 0); - }) + }); }); it('Adds the <svg> tag with the definition', () => { @@ -64,7 +64,7 @@ describe('astro:assets - SVG Components', () => { const $symbol = $svg.children('symbol'); assert.equal($symbol.length, 1); assert.equal($symbol.attr('id').startsWith('a:'), true); - + const $use = $svg.children('use'); assert.equal($use.length, 1); assert.equal($use.attr('href').startsWith('#a:'), true); @@ -78,7 +78,7 @@ describe('astro:assets - SVG Components', () => { const $symbol = $svg.children('symbol'); assert.equal($symbol.length, 0); - const definitionId = $('#definition svg symbol').attr('id') + const definitionId = $('#definition svg symbol').attr('id'); const $use = $svg.children('use'); assert.equal($use.length, 1); assert.equal($use.attr('href').startsWith('#a:'), true); @@ -167,13 +167,13 @@ describe('astro:assets - SVG Components', () => { assert.equal($svg.attr('role'), 'img'); assert.equal(!!$svg.attr('mode'), false); - const $symbol = $svg.children('symbol') + const $symbol = $svg.children('symbol'); assert.equal($symbol.length, 0); - const $use = $svg.children('use') + const $use = $svg.children('use'); assert.equal($use.length, 0); const $path = $svg.children('path'); assert.equal($path.length, 1); - }) + }); it('adds the svg into the document directly', () => { let $svg = $('#inline svg'); assert.equal($svg.length, 1); @@ -183,9 +183,9 @@ describe('astro:assets - SVG Components', () => { assert.equal($svg.attr('role'), 'img'); assert.equal(!!$svg.attr('mode'), false); - const $symbol = $svg.children('symbol') + const $symbol = $svg.children('symbol'); assert.equal($symbol.length, 0); - const $use = $svg.children('use') + const $use = $svg.children('use'); assert.equal($use.length, 0); const $path = $svg.children('path'); assert.equal($path.length, 1); @@ -199,13 +199,13 @@ describe('astro:assets - SVG Components', () => { assert.equal($svg.attr('role'), 'img'); assert.equal(!!$svg.attr('mode'), false); - const $symbol = $svg.children('symbol') + const $symbol = $svg.children('symbol'); assert.equal($symbol.length, 0); - const $use = $svg.children('use') + const $use = $svg.children('use'); assert.equal($use.length, 0); const $path = $svg.children('path'); assert.equal($path.length, 1); - }) + }); it('adds the svg into the document as a sprite, overridding the default', () => { let $svg = $('#definition svg'); assert.equal($svg.length, 1); @@ -215,10 +215,10 @@ describe('astro:assets - SVG Components', () => { assert.equal($svg.attr('role'), 'img'); assert.equal(!!$svg.attr('mode'), false); - let $symbol = $svg.children('symbol') + let $symbol = $svg.children('symbol'); assert.equal($symbol.length, 1); assert.equal(!!$symbol.attr('viewBox'), true); - let $use = $svg.children('use') + let $use = $svg.children('use'); assert.equal($use.length, 1); let $path = $svg.children('path'); assert.equal($path.length, 0); @@ -231,14 +231,14 @@ describe('astro:assets - SVG Components', () => { assert.equal($svg.attr('role'), 'img'); assert.equal(!!$svg.attr('mode'), false); - $symbol = $svg.children('symbol') + $symbol = $svg.children('symbol'); assert.equal($symbol.length, 0); assert.equal(!!$symbol.attr('viewBox'), false); - $use = $svg.children('use') + $use = $svg.children('use'); assert.equal($use.length, 1); $path = $svg.children('path'); assert.equal($path.length, 0); - }) + }); }); describe('title', () => { let $; @@ -255,7 +255,7 @@ describe('astro:assets - SVG Components', () => { const $title = $('#base svg > title'); assert.equal($title.length, 1); - assert.equal($title.text(), 'GitHub Logo') + assert.equal($title.text(), 'GitHub Logo'); }); }); describe('strip', () => { @@ -291,11 +291,11 @@ describe('astro:assets - SVG Components', () => { assert.equal($svg.attr('class'), 'foobar'); assert.equal($svg.attr('data-state'), 'open'); - const $symbol = $svg.children('symbol') + const $symbol = $svg.children('symbol'); assert.equal($symbol.length, 0); - const $use = $svg.children('use') + const $use = $svg.children('use'); assert.equal($use.length, 0); - const $path = $svg.children('path') + const $path = $svg.children('path'); assert.equal($path.length, 1); }); it('allows overriding the role attribute', () => { @@ -337,7 +337,6 @@ describe('astro:assets - SVG Components', () => { useId = $('.two.use svg > use').attr('id'); assert.equal(defId, useId); - // Third SVG $svg = $('.three svg'); assert.equal($svg.length, 1); @@ -372,9 +371,11 @@ describe('astro:assets - SVG Components', () => { const $svg = $('svg'); assert.equal($svg.length, 2); - $svg.each(function() { assert.equal($(this).attr('role'), 'img') }); + $svg.each(function () { + assert.equal($(this).attr('role'), 'img'); + }); - const definitionId = $($svg[0]).children('symbol').attr('id') + const definitionId = $($svg[0]).children('symbol').attr('id'); const $reuse = $($svg[1]); const $symbol = $reuse.children('symbol'); diff --git a/packages/astro/test/data-collections-schema.test.js b/packages/astro/test/data-collections-schema.test.js index 119cf8542..ff405dca4 100644 --- a/packages/astro/test/data-collections-schema.test.js +++ b/packages/astro/test/data-collections-schema.test.js @@ -1,8 +1,8 @@ // @ts-check import assert from 'node:assert/strict'; import { before, describe, it } from 'node:test'; -import { loadFixture } from './test-utils.js'; import { removeDir } from '@astrojs/internal-helpers/fs'; +import { loadFixture } from './test-utils.js'; describe('Content Collections - data collections', () => { let fixture; diff --git a/packages/integrations/preact/CHANGELOG.md b/packages/integrations/preact/CHANGELOG.md index b7138a78d..1673a8415 100644 --- a/packages/integrations/preact/CHANGELOG.md +++ b/packages/integrations/preact/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/preact +## 3.5.4-beta.0 + +### Patch Changes + +- [#12481](https://github.com/withastro/astro/pull/12481) [`8a46e80`](https://github.com/withastro/astro/commit/8a46e8074d6afb4a23badbd59ed239d526294e8c) Thanks [@marbrex](https://github.com/marbrex)! - Resolve `vite` peer dependency problem for strict package managers like **Yarn in PnP mode**. + ## 3.5.3 ### Patch Changes diff --git a/packages/integrations/preact/package.json b/packages/integrations/preact/package.json index b441bca21..d039c95ff 100644 --- a/packages/integrations/preact/package.json +++ b/packages/integrations/preact/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/preact", "description": "Use Preact components within Astro", - "version": "3.5.3", + "version": "3.5.4-beta.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/react/CHANGELOG.md b/packages/integrations/react/CHANGELOG.md index 65eb7056c..777f6b75b 100644 --- a/packages/integrations/react/CHANGELOG.md +++ b/packages/integrations/react/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/react +## 3.6.3-beta.0 + +### Patch Changes + +- [#12481](https://github.com/withastro/astro/pull/12481) [`8a46e80`](https://github.com/withastro/astro/commit/8a46e8074d6afb4a23badbd59ed239d526294e8c) Thanks [@marbrex](https://github.com/marbrex)! - Resolve `vite` peer dependency problem for strict package managers like **Yarn in PnP mode**. + ## 3.6.2 ### Patch Changes diff --git a/packages/integrations/react/package.json b/packages/integrations/react/package.json index 0010b7fdf..1ce3c5032 100644 --- a/packages/integrations/react/package.json +++ b/packages/integrations/react/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/react", "description": "Use React components within Astro", - "version": "3.6.2", + "version": "3.6.3-beta.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/solid/CHANGELOG.md b/packages/integrations/solid/CHANGELOG.md index 2ded2af1e..845b016f1 100644 --- a/packages/integrations/solid/CHANGELOG.md +++ b/packages/integrations/solid/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/solid-js +## 4.4.4-beta.0 + +### Patch Changes + +- [#12481](https://github.com/withastro/astro/pull/12481) [`8a46e80`](https://github.com/withastro/astro/commit/8a46e8074d6afb4a23badbd59ed239d526294e8c) Thanks [@marbrex](https://github.com/marbrex)! - Resolve `vite` peer dependency problem for strict package managers like **Yarn in PnP mode**. + ## 4.4.3 ### Patch Changes diff --git a/packages/integrations/solid/package.json b/packages/integrations/solid/package.json index b798a69a0..f46629d0f 100644 --- a/packages/integrations/solid/package.json +++ b/packages/integrations/solid/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/solid-js", - "version": "4.4.3", + "version": "4.4.4-beta.0", "description": "Use Solid components within Astro", "type": "module", "types": "./dist/index.d.ts", diff --git a/packages/integrations/svelte/CHANGELOG.md b/packages/integrations/svelte/CHANGELOG.md index 5a8cf5355..f609cdfe0 100644 --- a/packages/integrations/svelte/CHANGELOG.md +++ b/packages/integrations/svelte/CHANGELOG.md @@ -1,5 +1,14 @@ # @astrojs/svelte +## 6.0.2-beta.0 + +### Patch Changes + +- [#12481](https://github.com/withastro/astro/pull/12481) [`8a46e80`](https://github.com/withastro/astro/commit/8a46e8074d6afb4a23badbd59ed239d526294e8c) Thanks [@marbrex](https://github.com/marbrex)! - Resolve `vite` peer dependency problem for strict package managers like **Yarn in PnP mode**. + +- Updated dependencies [[`c48916c`](https://github.com/withastro/astro/commit/c48916cc4e6f7c31e3563d04b68a8698d8775b65), [`4364bff`](https://github.com/withastro/astro/commit/4364bff27332e52f92da72392620a36110daee42), [`c8f877c`](https://github.com/withastro/astro/commit/c8f877cad2d8f1780f70045413872d5b9d32ebed), [`8309c61`](https://github.com/withastro/astro/commit/8309c61f0dfa5991d3f6c5c5fca4403794d6fda2), [`af867f3`](https://github.com/withastro/astro/commit/af867f3910ecd8fc04a5337f591d84f03192e3fa), [`3f02d5f`](https://github.com/withastro/astro/commit/3f02d5f12b167514fff6eb9693b4e25c668e7a31)]: + - astro@5.0.0-beta.9 + ## 6.0.1 ### Patch Changes diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json index e88e6d5e7..2d6aebe34 100644 --- a/packages/integrations/svelte/package.json +++ b/packages/integrations/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/svelte", - "version": "6.0.1", + "version": "6.0.2-beta.0", "description": "Use Svelte components within Astro", "type": "module", "types": "./dist/index.d.ts", @@ -49,7 +49,7 @@ "svelte": "^5.1.16" }, "peerDependencies": { - "astro": "^4.0.0", + "astro": "^5.0.0-beta.9", "svelte": "^5.1.16", "typescript": "^5.3.3" }, diff --git a/packages/integrations/vue/CHANGELOG.md b/packages/integrations/vue/CHANGELOG.md index 764f28483..9763a370e 100644 --- a/packages/integrations/vue/CHANGELOG.md +++ b/packages/integrations/vue/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/vue +## 5.0.0-beta.2 + +### Patch Changes + +- [#12481](https://github.com/withastro/astro/pull/12481) [`8a46e80`](https://github.com/withastro/astro/commit/8a46e8074d6afb4a23badbd59ed239d526294e8c) Thanks [@marbrex](https://github.com/marbrex)! - Resolve `vite` peer dependency problem for strict package managers like **Yarn in PnP mode**. + ## 5.0.0-beta.1 ### Patch Changes diff --git a/packages/integrations/vue/package.json b/packages/integrations/vue/package.json index 5817fab62..9b144f83c 100644 --- a/packages/integrations/vue/package.json +++ b/packages/integrations/vue/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/vue", - "version": "5.0.0-beta.1", + "version": "5.0.0-beta.2", "description": "Use Vue components within Astro", "type": "module", "types": "./dist/index.d.ts", |