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 +1 -3
- package/content-types.template.d.ts +1 -0
- package/dist/@types/astro.d.ts +1 -1
- package/dist/assets/internal.d.ts +2 -2
- package/dist/assets/types.d.ts +4 -1
- package/dist/core/build/generate.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/runtime/server/scripts.js +3 -3
- package/package.json +1 -1
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;
|
package/dist/@types/astro.d.ts
CHANGED
|
@@ -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,
|
|
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:
|
|
9
|
+
export declare function getImage(options: UnresolvedImageTransform, imageConfig: AstroConfig['image']): Promise<GetImageResult>;
|
package/dist/assets/types.d.ts
CHANGED
|
@@ -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 {
|
package/dist/core/constants.js
CHANGED
package/dist/core/dev/dev.js
CHANGED
|
@@ -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.
|
|
23
|
+
const currentVersion = "3.1.1";
|
|
24
24
|
if (currentVersion.includes("-")) {
|
|
25
25
|
logger.warn(null, msg.prerelease({ currentVersion }));
|
|
26
26
|
}
|
package/dist/core/messages.js
CHANGED
|
@@ -50,7 +50,7 @@ function serverStart({
|
|
|
50
50
|
base,
|
|
51
51
|
isRestart = false
|
|
52
52
|
}) {
|
|
53
|
-
const version = "3.1.
|
|
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.
|
|
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
|
}
|