Skip to content

Commit

Permalink
fix: import runtime types from module entrypoint (#1384)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Jun 14, 2024
1 parent c5817f7 commit 6656169
Show file tree
Hide file tree
Showing 36 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/runtime/composables.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { $Img } from '../types'
import type { $Img } from '../module'

import { createImage } from './image'
// @ts-expect-error virtual file
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/image.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defu } from 'defu'
import { hasProtocol, parseURL, joinURL, withLeadingSlash } from 'ufo'
import type { ImageOptions, ImageSizesOptions, CreateImageOptions, ResolvedImage, ImageCTX, $Img, ImageSizes, ImageSizesVariant } from '../types/image'
import type { ImageOptions, ImageSizesOptions, CreateImageOptions, ResolvedImage, ImageCTX, $Img, ImageSizes, ImageSizesVariant } from '../module'
import { imageMeta } from './utils/meta'
import { checkDensities, parseDensities, parseSize, parseSizes } from './utils'
import { prerenderStaticImages } from './utils/prerender'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Plugin } from 'nuxt/app'
import type { $Img } from '../types'
import type { $Img } from '../module'
import { defineNuxtPlugin, useImage } from '#imports'

export default defineNuxtPlugin(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/awsAmplify.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { stringifyQuery } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'

export const getImage: ProviderGetImage = (src, { modifiers, baseURL = '/_amplify/image' } = {}, ctx) => {
const validWidths = Object.values(ctx.options.screens || {}).sort((a, b) => a - b)
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/bunny.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

export const operationsGenerator = createOperationsGenerator({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/caisy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

export const operationsGenerator = createOperationsGenerator({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/cloudflare.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL, encodeQueryItem } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

const operationsGenerator = createOperationsGenerator({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/cloudimage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL, hasProtocol } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

const operationsGenerator = createOperationsGenerator({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/cloudinary.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { joinURL, encodePath } from 'ufo'
import { defu } from 'defu'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

const convertHexToRgbFormat = (value: string) => value.startsWith('#') ? value.replace('#', 'rgb_') : value
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/contentful.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { withBase, parseURL } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

// https://www.contentful.com/developers/docs/references/images-api/
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/directus.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

export const operationsGenerator = createOperationsGenerator({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/edgio.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

const operationsGenerator = createOperationsGenerator({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/fastly.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

const operationsGenerator = createOperationsGenerator({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/glide.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// https://glide.thephpleague.com/2.0/api/quick-reference/

import { joinURL, encodeQueryItem, encodePath, withBase } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

const operationsGenerator = createOperationsGenerator({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/gumlet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

export const operationsGenerator = createOperationsGenerator({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/imageengine.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

export const operationsGenerator = createOperationsGenerator({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/imagekit.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL, withQuery } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

const operationsGenerator = createOperationsGenerator({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/imgix.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

export const operationsGenerator = createOperationsGenerator({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/ipx.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL, encodePath, encodeParam } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

const operationsGenerator = createOperationsGenerator({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/netlifyImageCdn.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { encodeQueryItem } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

// https://docs.netlify.com/image-cdn/overview/
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/netlifyLargeMedia.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { encodeQueryItem, joinURL } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

export const operationsGenerator = createOperationsGenerator({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/none.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'

export const getImage: ProviderGetImage = url => ({ url })
2 changes: 1 addition & 1 deletion src/runtime/providers/prepr/getImage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { joinURL } from 'ufo'

import type { ImageOptions, ResolvedImage, ImageCTX } from '../../../types'
import type { ImageOptions, ResolvedImage, ImageCTX } from '../../../module'

import { formatter } from './formatter'
import { keyMap } from './keyMap'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/prismic.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL, parseQuery, parseURL, stringifyQuery } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { operationsGenerator } from './imgix'

const PRISMIC_IMGIX_BUCKET = 'https://images.prismic.io'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/sanity.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

const sanityCDN = 'https://cdn.sanity.io/images'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/sirv.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

const deleteHash = (value: string) => value.startsWith('#') ? value.replace('#', '') : value
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/storyblok.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { withBase, joinURL, parseURL } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'

// https://www.storyblok.com/docs/image-service
const storyblockCDN = 'https://a.storyblok.com'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/strapi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { withBase, withoutLeadingSlash } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'

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

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/twicpics.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinURL } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createMapper, createOperationsGenerator } from '#image'

const fits = createMapper({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/unsplash.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// https://unsplash.com/documentation#dynamically-resizable-images

import { getQuery, withBase, withQuery } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { operationsGenerator } from './imgix'

const unsplashCDN = 'https://images.unsplash.com/'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/uploadcare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/

import { joinURL, hasProtocol, withTrailingSlash } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'
import { createOperationsGenerator } from '#image'

const operationsGenerator = createOperationsGenerator({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/vercel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { stringifyQuery } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'

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

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/wagtail.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { withBase, joinURL } from 'ufo'
import type { ProviderGetImage } from '../../types'
import type { ProviderGetImage } from '../../module'

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

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/providers/weserv.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { withBase } from 'ufo'
import type { OperationGeneratorConfig, ProviderGetImage, ImageOptions } from '../../types'
import type { OperationGeneratorConfig, ProviderGetImage, ImageOptions } from '../../module'
import { createOperationsGenerator } from '#image'
import { createError } from '#imports'

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { OperationGeneratorConfig } from '../../types/image'
import type { OperationGeneratorConfig } from '../../module'

export default function imageFetch(url: string) {
return fetch(cleanDoubleSlashes(url))
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/utils/meta.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ImageInfo, ImageCTX } from '../../types/image'
import type { ImageInfo, ImageCTX } from '../../module'

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

0 comments on commit 6656169

Please sign in to comment.