[ci] format
This commit is contained in:
parent
98afed34f1
commit
88dad63322
6 changed files with 24 additions and 24 deletions
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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<IntegrationOptions>): Plugin {
|
||||
|
|
2
packages/webapi/mod.d.ts
vendored
2
packages/webapi/mod.d.ts
vendored
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue