Skip to content

Commit 6656169

Browse files
authored
fix: import runtime types from module entrypoint (#1384)
1 parent c5817f7 commit 6656169

36 files changed

+36
-36
lines changed

src/runtime/composables.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { $Img } from '../types'
1+
import type { $Img } from '../module'
22

33
import { createImage } from './image'
44
// @ts-expect-error virtual file

src/runtime/image.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defu } from 'defu'
22
import { hasProtocol, parseURL, joinURL, withLeadingSlash } from 'ufo'
3-
import type { ImageOptions, ImageSizesOptions, CreateImageOptions, ResolvedImage, ImageCTX, $Img, ImageSizes, ImageSizesVariant } from '../types/image'
3+
import type { ImageOptions, ImageSizesOptions, CreateImageOptions, ResolvedImage, ImageCTX, $Img, ImageSizes, ImageSizesVariant } from '../module'
44
import { imageMeta } from './utils/meta'
55
import { checkDensities, parseDensities, parseSize, parseSizes } from './utils'
66
import { prerenderStaticImages } from './utils/prerender'

src/runtime/plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Plugin } from 'nuxt/app'
2-
import type { $Img } from '../types'
2+
import type { $Img } from '../module'
33
import { defineNuxtPlugin, useImage } from '#imports'
44

55
export default defineNuxtPlugin(() => {

src/runtime/providers/awsAmplify.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { stringifyQuery } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33

44
export const getImage: ProviderGetImage = (src, { modifiers, baseURL = '/_amplify/image' } = {}, ctx) => {
55
const validWidths = Object.values(ctx.options.screens || {}).sort((a, b) => a - b)

src/runtime/providers/bunny.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
export const operationsGenerator = createOperationsGenerator({

src/runtime/providers/caisy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
export const operationsGenerator = createOperationsGenerator({

src/runtime/providers/cloudflare.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL, encodeQueryItem } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
const operationsGenerator = createOperationsGenerator({

src/runtime/providers/cloudimage.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL, hasProtocol } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
const operationsGenerator = createOperationsGenerator({

src/runtime/providers/cloudinary.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { joinURL, encodePath } from 'ufo'
22
import { defu } from 'defu'
3-
import type { ProviderGetImage } from '../../types'
3+
import type { ProviderGetImage } from '../../module'
44
import { createOperationsGenerator } from '#image'
55

66
const convertHexToRgbFormat = (value: string) => value.startsWith('#') ? value.replace('#', 'rgb_') : value

src/runtime/providers/contentful.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { withBase, parseURL } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
// https://www.contentful.com/developers/docs/references/images-api/

src/runtime/providers/directus.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
export const operationsGenerator = createOperationsGenerator({

src/runtime/providers/edgio.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
const operationsGenerator = createOperationsGenerator({

src/runtime/providers/fastly.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
const operationsGenerator = createOperationsGenerator({

src/runtime/providers/glide.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// https://glide.thephpleague.com/2.0/api/quick-reference/
22

33
import { joinURL, encodeQueryItem, encodePath, withBase } from 'ufo'
4-
import type { ProviderGetImage } from '../../types'
4+
import type { ProviderGetImage } from '../../module'
55
import { createOperationsGenerator } from '#image'
66

77
const operationsGenerator = createOperationsGenerator({

src/runtime/providers/gumlet.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
export const operationsGenerator = createOperationsGenerator({

src/runtime/providers/imageengine.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
export const operationsGenerator = createOperationsGenerator({

src/runtime/providers/imagekit.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL, withQuery } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
const operationsGenerator = createOperationsGenerator({

src/runtime/providers/imgix.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
export const operationsGenerator = createOperationsGenerator({

src/runtime/providers/ipx.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL, encodePath, encodeParam } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
const operationsGenerator = createOperationsGenerator({

src/runtime/providers/netlifyImageCdn.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { encodeQueryItem } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
// https://docs.netlify.com/image-cdn/overview/

src/runtime/providers/netlifyLargeMedia.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { encodeQueryItem, joinURL } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
export const operationsGenerator = createOperationsGenerator({

src/runtime/providers/none.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import type { ProviderGetImage } from '../../types'
1+
import type { ProviderGetImage } from '../../module'
22

33
export const getImage: ProviderGetImage = url => ({ url })

src/runtime/providers/prepr/getImage.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { joinURL } from 'ufo'
22

3-
import type { ImageOptions, ResolvedImage, ImageCTX } from '../../../types'
3+
import type { ImageOptions, ResolvedImage, ImageCTX } from '../../../module'
44

55
import { formatter } from './formatter'
66
import { keyMap } from './keyMap'

src/runtime/providers/prismic.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL, parseQuery, parseURL, stringifyQuery } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { operationsGenerator } from './imgix'
44

55
const PRISMIC_IMGIX_BUCKET = 'https://images.prismic.io'

src/runtime/providers/sanity.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
const sanityCDN = 'https://cdn.sanity.io/images'

src/runtime/providers/sirv.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createOperationsGenerator } from '#image'
44

55
const deleteHash = (value: string) => value.startsWith('#') ? value.replace('#', '') : value

src/runtime/providers/storyblok.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { withBase, joinURL, parseURL } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33

44
// https://www.storyblok.com/docs/image-service
55
const storyblockCDN = 'https://a.storyblok.com'

src/runtime/providers/strapi.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { withBase, withoutLeadingSlash } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33

44
// https://strapi.io/documentation/developer-docs/latest/development/plugins/upload.html#upload
55

src/runtime/providers/twicpics.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { joinURL } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33
import { createMapper, createOperationsGenerator } from '#image'
44

55
const fits = createMapper({

src/runtime/providers/unsplash.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// https://unsplash.com/documentation#dynamically-resizable-images
22

33
import { getQuery, withBase, withQuery } from 'ufo'
4-
import type { ProviderGetImage } from '../../types'
4+
import type { ProviderGetImage } from '../../module'
55
import { operationsGenerator } from './imgix'
66

77
const unsplashCDN = 'https://images.unsplash.com/'

src/runtime/providers/uploadcare.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020

2121
import { joinURL, hasProtocol, withTrailingSlash } from 'ufo'
22-
import type { ProviderGetImage } from '../../types'
22+
import type { ProviderGetImage } from '../../module'
2323
import { createOperationsGenerator } from '#image'
2424

2525
const operationsGenerator = createOperationsGenerator({

src/runtime/providers/vercel.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { stringifyQuery } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33

44
// https://vercel.com/docs/more/adding-your-framework#images
55

src/runtime/providers/wagtail.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { withBase, joinURL } from 'ufo'
2-
import type { ProviderGetImage } from '../../types'
2+
import type { ProviderGetImage } from '../../module'
33

44
// https://docs.wagtail.org/en/v4.2.1/topics/images.html
55

src/runtime/providers/weserv.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { withBase } from 'ufo'
2-
import type { OperationGeneratorConfig, ProviderGetImage, ImageOptions } from '../../types'
2+
import type { OperationGeneratorConfig, ProviderGetImage, ImageOptions } from '../../module'
33
import { createOperationsGenerator } from '#image'
44
import { createError } from '#imports'
55

src/runtime/utils/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { OperationGeneratorConfig } from '../../types/image'
1+
import type { OperationGeneratorConfig } from '../../module'
22

33
export default function imageFetch(url: string) {
44
return fetch(cleanDoubleSlashes(url))

src/runtime/utils/meta.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ImageInfo, ImageCTX } from '../../types/image'
1+
import type { ImageInfo, ImageCTX } from '../../module'
22

33
export async function imageMeta(_ctx: ImageCTX, url: string): Promise<ImageInfo> {
44
// TODO: Reimplement cache using storage

0 commit comments

Comments
 (0)