astro 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client.d.ts CHANGED
@@ -48,9 +48,7 @@ declare module 'astro:assets' {
48
48
  * This is functionally equivalent to using the `<Image />` component, as the component calls this function internally.
49
49
  */
50
50
  getImage: (
51
- options:
52
- | import('./dist/assets/types.js').ImageTransform
53
- | import('./dist/assets/types.js').UnresolvedImageTransform
51
+ options: import('./dist/assets/types.js').UnresolvedImageTransform
54
52
  ) => Promise<import('./dist/assets/types.js').GetImageResult>;
55
53
  imageConfig: import('./dist/@types/astro.js').AstroConfig['image'];
56
54
  getConfiguredImageService: typeof import('./dist/assets/index.js').getConfiguredImageService;
@@ -33,6 +33,7 @@ declare module 'astro:content' {
33
33
  import('astro/zod').ZodLiteral<'webp'>,
34
34
  import('astro/zod').ZodLiteral<'gif'>,
35
35
  import('astro/zod').ZodLiteral<'svg'>,
36
+ import('astro/zod').ZodLiteral<'avif'>,
36
37
  ]
37
38
  >;
38
39
  }>;
@@ -22,7 +22,7 @@ import type { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './../core/constants.js'
22
22
  export { type AstroIntegrationLogger };
23
23
  export type { MarkdownHeading, MarkdownMetadata, MarkdownRenderingResult, RehypePlugins, RemarkPlugins, ShikiConfig, } from '@astrojs/markdown-remark';
24
24
  export type { ExternalImageService, ImageService, LocalImageService, } from '../assets/services/service.js';
25
- export type { GetImageResult, ImageInputFormat, ImageMetadata, ImageOutputFormat, ImageQuality, ImageQualityPreset, ImageTransform, } from '../assets/types.js';
25
+ export type { GetImageResult, ImageInputFormat, ImageMetadata, ImageOutputFormat, ImageQuality, ImageQualityPreset, ImageTransform, UnresolvedImageTransform, } from '../assets/types.js';
26
26
  export type { RemotePattern } from '../assets/utils/remotePattern.js';
27
27
  export type { SSRManifest } from '../core/app/types.js';
28
28
  export type { AstroCookies } from '../core/cookies/index.js';
@@ -1,9 +1,9 @@
1
1
  import type { AstroConfig, AstroSettings } from '../@types/astro.js';
2
2
  import { type ImageService } from './services/service.js';
3
- import type { GetImageResult, ImageMetadata, ImageTransform, UnresolvedImageTransform } from './types.js';
3
+ import type { GetImageResult, ImageMetadata, UnresolvedImageTransform } from './types.js';
4
4
  export declare function injectImageEndpoint(settings: AstroSettings): AstroSettings;
5
5
  export declare function isESMImportedImage(src: ImageMetadata | string): src is ImageMetadata;
6
6
  export declare function isRemoteImage(src: ImageMetadata | string): src is string;
7
7
  export declare function isRemoteAllowed(src: string, { domains, remotePatterns, }: Partial<Pick<AstroConfig['image'], 'domains' | 'remotePatterns'>>): boolean;
8
8
  export declare function getConfiguredImageService(): Promise<ImageService>;
9
- export declare function getImage(options: ImageTransform | UnresolvedImageTransform, imageConfig: AstroConfig['image']): Promise<GetImageResult>;
9
+ export declare function getImage(options: UnresolvedImageTransform, imageConfig: AstroConfig['image']): Promise<GetImageResult>;
@@ -25,8 +25,11 @@ export interface ImageMetadata {
25
25
  format: ImageInputFormat;
26
26
  orientation?: number;
27
27
  }
28
+ /**
29
+ * A yet to be resolved image transform. Used by `getImage`
30
+ */
28
31
  export type UnresolvedImageTransform = Omit<ImageTransform, 'src'> & {
29
- src: Promise<{
32
+ src: ImageMetadata | string | Promise<{
30
33
  default: ImageMetadata;
31
34
  }>;
32
35
  };
@@ -218,7 +218,7 @@ async function generatePage(pageData, ssrEntry, builtPaths, pipeline) {
218
218
  styles,
219
219
  mod: pageModule
220
220
  };
221
- const icon = pageData.route.type === "page" ? green("\u25B6") : magenta("\u03BB");
221
+ const icon = pageData.route.type === "page" || pageData.route.type === "redirect" ? green("\u25B6") : magenta("\u03BB");
222
222
  if (isRelativePath(pageData.route.component)) {
223
223
  logger.info(null, `${icon} ${pageData.route.route}`);
224
224
  } else {
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "3.1.0";
1
+ const ASTRO_VERSION = "3.1.1";
2
2
  const SUPPORTED_MARKDOWN_FILE_EXTENSIONS = [
3
3
  ".markdown",
4
4
  ".mdown",
@@ -20,7 +20,7 @@ async function dev(inlineConfig) {
20
20
  base: restart.container.settings.config.base
21
21
  })
22
22
  );
23
- const currentVersion = "3.1.0";
23
+ const currentVersion = "3.1.1";
24
24
  if (currentVersion.includes("-")) {
25
25
  logger.warn(null, msg.prerelease({ currentVersion }));
26
26
  }
@@ -50,7 +50,7 @@ function serverStart({
50
50
  base,
51
51
  isRestart = false
52
52
  }) {
53
- const version = "3.1.0";
53
+ const version = "3.1.1";
54
54
  const localPrefix = `${dim("\u2503")} Local `;
55
55
  const networkPrefix = `${dim("\u2503")} Network `;
56
56
  const emptyPrefix = " ".repeat(11);
@@ -235,7 +235,7 @@ function printHelp({
235
235
  message.push(
236
236
  linebreak(),
237
237
  ` ${bgGreen(black(` ${commandName} `))} ${green(
238
- `v${"3.1.0"}`
238
+ `v${"3.1.1"}`
239
239
  )} ${headline}`
240
240
  );
241
241
  }
@@ -1,5 +1,5 @@
1
1
  import islandScript from "./astro-island.prebuilt.js";
2
- const ISLAND_STYLES = `<style>astro-island,astro-slot,astro-static-slot{display:contents}</style>`;
2
+ const ISLAND_STYLES = `<style style="display:none">astro-island,astro-slot,astro-static-slot{display:contents}</style>`;
3
3
  function determineIfNeedsHydrationScript(result) {
4
4
  if (result._metadata.hasHydrationScript) {
5
5
  return false;
@@ -24,12 +24,12 @@ function getDirectiveScriptText(result, directive) {
24
24
  function getPrescripts(result, type, directive) {
25
25
  switch (type) {
26
26
  case "both":
27
- return `${ISLAND_STYLES}<script>${getDirectiveScriptText(
27
+ return `${ISLAND_STYLES}<script style="display:none">${getDirectiveScriptText(
28
28
  result,
29
29
  directive
30
30
  )};${islandScript}</script>`;
31
31
  case "directive":
32
- return `<script>${getDirectiveScriptText(result, directive)}</script>`;
32
+ return `<script style="display:none">${getDirectiveScriptText(result, directive)}</script>`;
33
33
  }
34
34
  return "";
35
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
5
5
  "type": "module",
6
6
  "author": "withastro",