diff --git a/packages/integrations/image/src/endpoints/dev.ts b/packages/integrations/image/src/endpoints/dev.ts index 4d0ed365a..72ce4e950 100644 --- a/packages/integrations/image/src/endpoints/dev.ts +++ b/packages/integrations/image/src/endpoints/dev.ts @@ -1,8 +1,8 @@ // @ts-ignore -import loader from 'virtual:image-loader'; -import { lookup } from 'mrmime'; -import { loadImage } from '../utils.js'; import type { APIRoute } from 'astro'; +import { lookup } from 'mrmime'; +import loader from 'virtual:image-loader'; +import { loadImage } from '../utils.js'; export const get: APIRoute = async ({ request }) => { try { diff --git a/packages/integrations/image/src/endpoints/prod.ts b/packages/integrations/image/src/endpoints/prod.ts index 1ff56df48..ff760fc92 100644 --- a/packages/integrations/image/src/endpoints/prod.ts +++ b/packages/integrations/image/src/endpoints/prod.ts @@ -1,9 +1,9 @@ // @ts-ignore -import loader from 'virtual:image-loader'; +import type { APIRoute } from 'astro'; import etag from 'etag'; import { lookup } from 'mrmime'; +import loader from 'virtual:image-loader'; import { isRemoteImage, loadRemoteImage } from '../utils.js'; -import type { APIRoute } from 'astro'; export const get: APIRoute = async ({ request }) => { try { diff --git a/packages/integrations/image/src/index.ts b/packages/integrations/image/src/index.ts index 753537c24..e44b7230b 100644 --- a/packages/integrations/image/src/index.ts +++ b/packages/integrations/image/src/index.ts @@ -1,7 +1,14 @@ +import type { AstroConfig, AstroIntegration } from 'astro'; import fs from 'fs/promises'; import path from 'path'; -import { fileURLToPath } from 'url'; import slash from 'slash'; +import { fileURLToPath } from 'url'; +import type { + ImageAttributes, + IntegrationOptions, + SSRImageService, + TransformOptions, +} from './types'; import { ensureDir, isRemoteImage, @@ -10,13 +17,6 @@ import { propsToFilename, } from './utils.js'; import { createPlugin } from './vite-plugin-astro-image.js'; -import type { AstroConfig, AstroIntegration } from 'astro'; -import type { - ImageAttributes, - IntegrationOptions, - SSRImageService, - TransformOptions, -} from './types'; const PKG_NAME = '@astrojs/image'; const ROUTE_PATTERN = '/_image'; @@ -76,9 +76,9 @@ const createIntegration = (options: IntegrationOptions = {}): AstroIntegration = return { plugins: [createPlugin(_config, resolvedOptions)], optimizeDeps: { - include: ['image-size', 'sharp'] - } - } + include: ['image-size', 'sharp'], + }, + }; } return { diff --git a/packages/integrations/image/src/loaders/sharp.ts b/packages/integrations/image/src/loaders/sharp.ts index 8b029a285..b82a75044 100644 --- a/packages/integrations/image/src/loaders/sharp.ts +++ b/packages/integrations/image/src/loaders/sharp.ts @@ -1,6 +1,6 @@ import sharp from 'sharp'; +import type { OutputFormat, SSRImageService, TransformOptions } from '../types'; import { isAspectRatioString, isOutputFormat } from '../utils.js'; -import type { TransformOptions, OutputFormat, SSRImageService } from '../types'; class SharpService implements SSRImageService { async getImageAttributes(transform: TransformOptions) { diff --git a/packages/integrations/image/src/vite-plugin-astro-image.ts b/packages/integrations/image/src/vite-plugin-astro-image.ts index e2fcfffcb..f1b11ad09 100644 --- a/packages/integrations/image/src/vite-plugin-astro-image.ts +++ b/packages/integrations/image/src/vite-plugin-astro-image.ts @@ -1,10 +1,10 @@ -import fs from 'fs/promises'; -import { pathToFileURL } from 'url'; -import slash from 'slash'; -import { metadata } from './metadata.js'; -import type { PluginContext } from 'rollup'; -import type { Plugin, ResolvedConfig } from 'vite'; import type { AstroConfig } from 'astro'; +import fs from 'fs/promises'; +import type { PluginContext } from 'rollup'; +import slash from 'slash'; +import { pathToFileURL } from 'url'; +import type { Plugin, ResolvedConfig } from 'vite'; +import { metadata } from './metadata.js'; import type { IntegrationOptions } from './types'; export function createPlugin(config: AstroConfig, options: Required): Plugin { diff --git a/packages/webapi/mod.d.ts b/packages/webapi/mod.d.ts index 3750dcb3a..7150edbe7 100644 --- a/packages/webapi/mod.d.ts +++ b/packages/webapi/mod.d.ts @@ -1,5 +1,5 @@ export { pathToPosix } from './lib/utils'; -export { AbortController, AbortSignal, alert, atob, Blob, btoa, ByteLengthQueuingStrategy, cancelAnimationFrame, cancelIdleCallback, CanvasRenderingContext2D, CharacterData, clearTimeout, Comment, CountQueuingStrategy, CSSStyleSheet, CustomElementRegistry, CustomEvent, Document, DocumentFragment, DOMException, Element, Event, EventTarget, fetch, File, FormData, Headers, HTMLBodyElement, HTMLCanvasElement, HTMLDivElement, HTMLDocument, HTMLElement, HTMLHeadElement, HTMLHtmlElement, HTMLImageElement, HTMLSpanElement, HTMLStyleElement, HTMLTemplateElement, HTMLUnknownElement, Image, ImageData, IntersectionObserver, MediaQueryList, MutationObserver, Node, NodeFilter, NodeIterator, OffscreenCanvas, ReadableByteStreamController, ReadableStream, ReadableStreamBYOBReader, ReadableStreamBYOBRequest, ReadableStreamDefaultController, ReadableStreamDefaultReader, Request, requestAnimationFrame, requestIdleCallback, ResizeObserver, Response, setTimeout, ShadowRoot, structuredClone, StyleSheet, Text, TransformStream, TreeWalker, URLPattern, Window, WritableStream, WritableStreamDefaultController, WritableStreamDefaultWriter, } from './mod.js'; +export { AbortController, AbortSignal, alert, atob, Blob, btoa, ByteLengthQueuingStrategy, cancelAnimationFrame, cancelIdleCallback, CanvasRenderingContext2D, CharacterData, clearTimeout, Comment, CountQueuingStrategy, CSSStyleSheet, CustomElementRegistry, CustomEvent, Document, DocumentFragment, DOMException, Element, Event, EventTarget, fetch, File, FormData, Headers, HTMLBodyElement, HTMLCanvasElement, HTMLDivElement, HTMLDocument, HTMLElement, HTMLHeadElement, HTMLHtmlElement, HTMLImageElement, HTMLSpanElement, HTMLStyleElement, HTMLTemplateElement, HTMLUnknownElement, Image, ImageData, IntersectionObserver, MediaQueryList, MutationObserver, Node, NodeFilter, NodeIterator, OffscreenCanvas, ReadableByteStreamController, ReadableStream, ReadableStreamBYOBReader, ReadableStreamBYOBRequest, ReadableStreamDefaultController, ReadableStreamDefaultReader, Request, requestAnimationFrame, requestIdleCallback, ResizeObserver, Response, setTimeout, ShadowRoot, structuredClone, StyleSheet, Text, TransformStream, TreeWalker, URLPattern, Window, WritableStream, WritableStreamDefaultController, WritableStreamDefaultWriter } from './mod.js'; export declare const polyfill: { (target: any, options?: PolyfillOptions): any; internals(target: any, name: string): any;